-
Notifications
You must be signed in to change notification settings - Fork 771
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
Inquiry about the 'Accept' header #375
Comments
Hi, thanks for your request here. You're correct that the server responds with const stream = await openai.chat.completions.create(
{
model: 'gpt-4',
messages: [{ role: 'user', content: 'Say this is a test' }],
stream: true,
},
{ headers: { Accept: 'text/event-stream' } },
); |
6 tasks
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirm this is a feature request for the Node library and not the underlying OpenAI API.
Describe the feature or improvement you're requesting
Hello,
I am currently using the openai-node package for my project, and I have a question regarding the 'Accept' header in the request made at this specific code snippet: core.ts.
In the mentioned code, the 'Accept' header is set to "application/json". However, when the 'stream' option is set to true, the response I receive is in the format of "text/event-stream".
I am using a unified API platform that converts API interfaces from different platforms to OPENAI format. Due to some platforms validating the 'Accept' header value, I am facing issues with the API requests failing.
Could you please confirm if setting the 'Accept' header to "application/json" in the mentioned code is compliant with the specifications? if it should be modified based on the expected response type?
Thank you for your assistance.
Additional context
No response
The text was updated successfully, but these errors were encountered: