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

Add the default accept value for chat completions #396

Closed
wants to merge 1 commit into from

Conversation

c121914yu
Copy link

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Add the default headers Accept for chat completions.

Additional context & links

I found the stream requesting unavailable after upgrading from 3.x to 4.x. I checked both versions of the request header. And I found that the default Accept of version 3.x is "application/json, text/plain, /", but the default in version 4.x is only "application/json".

c99a93306d6fc403c2796f40940d9b1

When I tried to rewrite the request header in 4.x, I found that the request completed successfully.

image

Of course, I am not requesting api.openapi.com directly, but I think this "Accept " value should be relaxed to make it compatible with more third-party systems.

@rattrayalex
Copy link
Collaborator

Thanks for the PR, we'll take a look soon

@rattrayalex
Copy link
Collaborator

We don't want to change Accept globally (as implemented here), but we do want to send the correct Accept header for streaming requests.

You can follow #375 where we are tracking this.

In the meantime, as you noted, you can work around this with a second { headers: { Accept: 'text/event-stream' } }, argument.

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

Successfully merging this pull request may close these issues.

2 participants