Jordan-Gilliam / ai-template

Mercury - Train your own custom GPT. Chat with any file, or website.
The Unlicense
422 stars 66 forks source link

Error: Expected content-type to be text/event-stream, Actual: application/json; charset=utf-8 #10

Open topcook opened 1 year ago

topcook commented 1 year ago

When I try to run this project, I got this error. It is caught in query.ts file. image this function occurs this error. What is the solution? Thanks.

haimh commented 1 year ago

Just replaced modelName from "gpt-4" to "gpt-turbo-3.5-16k" in "./lib/chain.ts" then it worked like a champ in my case. Hope that help! ================== ./lib/chain.ts ============= const docChain = loadQAChain( new OpenAIChat({ temperature: 0, modelName: "gpt-3.5-turbo-16k", //change this to older versions (e.g. gpt-3.5-turbo) if you don't have access to gpt-4 streaming: Boolean(onTokenStream), callbackManager: onTokenStream ? CallbackManager.fromHandlers({ async handleLLMNewToken(token) { onTokenStream(token) }, }) : undefined, }), { prompt: IMPROVED_QA_PROMPT } )

topcook commented 1 year ago

@haimh Thanks for your reply. But I still got that error. Could you share the github repo working in your side? Thanks.

haimh commented 1 year ago

@haimh Thanks for your reply. But I still got that error. Could you share the github repo working in your side? Thanks.

I used main repo in github. Good luck!