We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
continue generating
I am using openai-stream library to build a chat application. We need support continue generating response feature like the one we have in ChatGPT. Looking at the code of the library I understand that OpenAIError is thrown when finish_reason is equal to length https://github.com/SpellcraftAI/openai-streams/blob/canary/src/lib/streaming/streams.ts#L80.
OpenAIError
length
In my code I don't get handle to this error in the catch block. The console.error line is never called. The code looks like as shown below
console.error
try { const stream = await OpenAI("chat", { model: "gpt-3.5-turbo", messages: [ { role: "system", content: DEFAULT_SYSTEM_PROMPT, }, ...messagesToSend, ], max_tokens: 1000, temperature: DEFAULT_TEMPERATURE, }); return new Response(stream); } catch (e) { console.error("Error: ", e) }
Can you guide me how to handle errors?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using openai-stream library to build a chat application. We need support continue generating response feature like the one we have in ChatGPT. Looking at the code of the library I understand that
OpenAIError
is thrown when finish_reason is equal tolength
https://github.com/SpellcraftAI/openai-streams/blob/canary/src/lib/streaming/streams.ts#L80.In my code I don't get handle to this error in the catch block. The
console.error
line is never called. The code looks like as shown belowCan you guide me how to handle errors?
The text was updated successfully, but these errors were encountered: