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

Can not enable copilot plugin, only produces errors #9417

Closed
1 task
wtfbbqhax opened this issue Dec 29, 2024 · 11 comments
Closed
1 task

Can not enable copilot plugin, only produces errors #9417

wtfbbqhax opened this issue Dec 29, 2024 · 11 comments

Comments

@wtfbbqhax
Copy link

wtfbbqhax commented Dec 29, 2024

What happened?

Problem Overview:

I followed the guild https://docs.affine.pro/docs/self-host-affine, and noted that the AI features are not working. After some digging and searching I found that there are undocumented requirements that I'm finding difficult to resolve. I've tried to solve this myself in piecemeal, but I suspect I'm missing some more fundamental requirements.

Actual Results:

Whenver I invoke the AI Chat, I see the following errors in the logs:

[Nest] 1  - 12/29/2024, 11:45:48 AM   ERROR [GraphQL] Internal server error
GraphQLError: Unknown type "CreateChatSessionInput". Did you mean "CreateUserInput"?
    at Object.NamedType (/app/node_modules/graphql/validation/rules/KnownTypeNamesRule.js:65:11)
    at Object.enter (/app/node_modules/graphql/language/visitor.js:301:32)
    at Object.enter (/app/node_modules/graphql/utilities/TypeInfo.js:391:27)
    at visit (/app/node_modules/graphql/language/visitor.js:197:21)
    at validate (/app/node_modules/graphql/validation/validate.js:91:24)
    at processGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:101:61)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async internalExecuteOperation (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:644:16)
    at async runHttpQuery (/app/node_modules/@apollo/server/dist/cjs/runHttpQuery.js:135:29)
    at async runPotentiallyBatchedHttpQuery (/app/node_modules/@apollo/server/dist/cjs/httpBatching.js:37:16)
[Nest] 1  - 12/29/2024, 11:45:48 AM   ERROR [GraphQL] Internal server error
GraphQLError: Cannot query field "createCopilotSession" on type "Mutation".
    at Object.Field (/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:51:13)
    at Object.enter (/app/node_modules/graphql/language/visitor.js:301:32)
    at Object.enter (/app/node_modules/graphql/utilities/TypeInfo.js:391:27)
    at visit (/app/node_modules/graphql/language/visitor.js:197:21)
    at validate (/app/node_modules/graphql/validation/validate.js:91:24)
    at processGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:101:61)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async internalExecuteOperation (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:644:16)
    at async runHttpQuery (/app/node_modules/@apollo/server/dist/cjs/runHttpQuery.js:135:29)
    at async runPotentiallyBatchedHttpQuery (/app/node_modules/@apollo/server/dist/cjs/httpBatching.js:37:16)

I believe at the root of the problem, I'm not even enabling the copilot plugin correctly, I see no indications in the affine_server startup that indicates copilot or openai is being loaded/initialized.
image

I've modified my local ~/.affine/self-host/config/affine.js like so (key scrubbed)
Screenshot 2024-12-29 at 6 56 54 PM

And "restarted" the stack of software with docker compose down and docker compose up -d to restart.

I've also tried providing the API key using the .env file, restarting the stack of software same as above, but still no changes.
Screenshot 2024-12-29 at 6 58 59 PM

The result is always the same UI error, at best. However, many of the AI features produce no visible user errors or warnings.

Screenshot 2024-12-29 at 6 59 46 PM

Expected Results

Hopefully a functional set of AI chat and other features..

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

No response

Anything else?

No response

@Lanvaldear
Copy link

I also have this problem. Also as someone suggested i tried using legacy user API key and project API key.

@emengweb
Copy link

find out the datebase model has change to gpt-4o-2024-08-06 and gpt-4o-mini-2024-07-18, that cause custem api can not located the current AI model.

hope can add some way custem AI model name.

@GarryLai
Copy link

+1

@sunqiuming526
Copy link

the same problem here

@wtfbbqhax
Copy link
Author

wtfbbqhax commented Dec 30, 2024

I also have this problem. Also as someone suggested i tried using legacy user API key and project API key.

Hopefully not, As I have no existing legacy keys remaining, it appears I am no longer capable of generating new keys.

Relevant link to the discussions
#6996 (reply in thread)

@richie80
Copy link

Somewhere else I read they are doing an overhaul with the AI. Hopefully this is a quick fix and we don't have to wait for the AI improvements which are coming.

@tsic404
Copy link

tsic404 commented Dec 31, 2024

#8905 (comment)

@richie80
Copy link

richie80 commented Jan 3, 2025

Seems to be fixed in the coming release. Great, eager to try it

EYHN pushed a commit that referenced this issue Jan 4, 2025
@wtfbbqhax
Copy link
Author

Seems to be fixed in the coming release. Great, eager to try it

🤞🏻

@richie80
Copy link

richie80 commented Jan 6, 2025

confirming this is working again!

@forehalo
Copy link
Member

forehalo commented Jan 7, 2025

fixed in 0.19.5, guys

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

No branches or pull requests

8 participants