Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

​Affine use custome OpenAI compatible API throw error #10652

Open
1 task done
joebnb opened this issue Mar 6, 2025 · 2 comments
Open
1 task done

​Affine use custome OpenAI compatible API throw error #10652

joebnb opened this issue Mar 6, 2025 · 2 comments

Comments

@joebnb
Copy link

joebnb commented Mar 6, 2025

What happened?

hello, i use self-hosted affine with copilot get some error need help

in affine confg.js i configured

AFFiNE.use('copilot', {
  openai: {
    baseURL: 'http://192.168.*.*:1234/v1/',
    apiKey: 'sk-111111111111111111111111111111111111111111111111', // actually lm studio won't check this
    jsonMode: false
  },
})

i'm sure the base url are accessible, my self hosted dify service also on the same server and use the api well.

the completion API were support by LM Studio
Image

when use copilot functions the api will response with error

Image

how can i solve it?

Distribution version

macOS x64 (Intel)

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • Yes

Relevant log output

[Nest] 1  - 03/06/2025, 5:56:11 AM   DEBUG [JobQueue] <allinone:ws:b33f0510-9d7d-4145-9ed1-612fe7894eeb> Job [doc.mergePendingDocUpdates] added; id=doc:merge-pending-updates:c0877d5b-601f-42ce-b11e-ded9e4820caf:AMpFGCzFwC
[Nest] 1  - 03/06/2025, 5:56:11 AM   DEBUG [JobQueue] <allinone:ws:414695ca-9208-428d-8ead-d1379aa7ef55> Job [doc.mergePendingDocUpdates] added; id=doc:merge-pending-updates:c0877d5b-601f-42ce-b11e-ded9e4820caf:AMpFGCzFwC
[Nest] 1  - 03/06/2025, 5:56:12 AM VERBOSE [Locker] <allinone:graphql:9ca80e27-0f27-4128-87dc-28100662d9f9> Client 2cc6bfdf-c2c1-4785-9c14-bb0d3a6f3520 is trying to lock resource copilot:session:fe77828a-88b5-4d04-ba9e-13fcafb22071:c0877d5b-601f-42ce-b11e-ded9e4820caf
[Nest] 1  - 03/06/2025, 5:56:12 AM VERBOSE [Locker] <allinone:graphql:17a2d7fb-4988-4748-ab3e-814e835661d9> Client c550c43a-9a25-4987-b497-ce2369edc284 is trying to lock resource copilot:message:fe77828a-88b5-4d04-ba9e-13fcafb22071:ecacb4fe-bfeb-4871-ac02-a79a9ac01f13
[Nest] 1  - 03/06/2025, 5:56:12 AM   ERROR [Sse] <allinone:http:c77d75e6-5891-4d32-aa4f-d804d9a9b2fa> copilot_provider_side_error ({"sessionId":"ecacb4fe-bfeb-4871-ac02-a79a9ac01f13","params":{},"throwInStream":true,"model":"gpt-4o"})
copilot_provider_side_error: Provider openai failed with unknown error: 400 "'response_format.type' must be 'json_schema'"
    at OpenAIProvider.handleError (file:///app/dist/plugins/copilot/providers/openai.js:132:20)
    at OpenAIProvider.generateTextStream (file:///app/dist/plugins/copilot/providers/openai.js:206:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[Nest] 1  - 03/06/2025, 5:56:14 AM VERBOSE [Locker] <allinone:graphql:8f0a2cf6-7f11-4b6d-832c-b0019c5a6a32> Client 9dc6e623-89ce-401a-acf8-5a29334dde2d is trying to lock resource copilot:session:fe77828a-88b5-4d04-ba9e-13fcafb22071:c0877d5b-601f-42ce-b11e-ded9e4820caf
[Nest] 1  - 03/06/2025, 5:56:14 AM VERBOSE [Locker] <allinone:graphql:2ea12979-1dcb-4d64-9754-fff55f950158> Client aa8d8b1c-e8f8-488e-95b8-b119d745d021 is trying to lock resource copilot:message:fe77828a-88b5-4d04-ba9e-13fcafb22071:ecacb4fe-bfeb-4871-ac02-a79a9ac01f13
[Nest] 1  - 03/06/2025, 5:56:14 AM   ERROR [Sse] <allinone:http:e818601b-4a4a-41e5-8caf-16a140206a4c> copilot_provider_side_error ({"sessionId":"ecacb4fe-bfeb-4871-ac02-a79a9ac01f13","params":{},"throwInStream":true,"model":"gpt-4o"})
copilot_provider_side_error: Provider openai failed with unknown error: 400 "'response_format.type' must be 'json_schema'"
    at OpenAIProvider.handleError (file:///app/dist/plugins/copilot/providers/openai.js:132:20)
    at OpenAIProvider.generateTextStream (file:///app/dist/plugins/copilot/providers/openai.js:206:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[Nest] 1  - 03/06/2025, 5:56:15 AM VERBOSE [Locker] <allinone:graphql:08dc1334-e82c-4fa9-b01c-e03ca975e2e8> Client 842e4794-90f8-4a12-8f77-e9ab40ae66c5 is trying to lock resource copilot:session:fe77828a-88b5-4d04-ba9e-13fcafb22071:c0877d5b-601f-42ce-b11e-ded9e4820caf
[Nest] 1  - 03/06/2025, 5:56:15 AM VERBOSE [Locker] <allinone:graphql:337fbc67-15c1-4162-bd7c-f37669cd0bf9> Client c32d96d6-dd79-4367-9561-e4df71df861c is trying to lock resource copilot:message:fe77828a-88b5-4d04-ba9e-13fcafb22071:ecacb4fe-bfeb-4871-ac02-a79a9ac01f13
[Nest] 1  - 03/06/2025, 5:56:15 AM   ERROR [Sse] <allinone:http:436008c7-1c70-4b69-883d-46f1f5bcdfb5> copilot_provider_side_error ({"sessionId":"ecacb4fe-bfeb-4871-ac02-a79a9ac01f13","params":{},"throwInStream":true,"model":"gpt-4o"})
copilot_provider_side_error: Provider openai failed with unknown error: 400 "'response_format.type' must be 'json_schema'"
    at OpenAIProvider.handleError (file:///app/dist/plugins/copilot/providers/openai.js:132:20)
    at OpenAIProvider.generateTextStream (file:///app/dist/plugins/copilot/providers/openai.js:206:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Anything else?

No response

@affine-issue-bot
Copy link

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day.
Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

@joebnb
Copy link
Author

joebnb commented Mar 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 *Untriaged
Development

No branches or pull requests

1 participant