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

Correctly set Accept header to text/event-stream for completion streaming #1815

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mathetake
Copy link

@mathetake mathetake commented Oct 23, 2024

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

Changes being requested

Previously, the standard Accept header was set to application/json unconditionally.
However, streaming response returns content-type: text/event-stream following
the specification of server-sent-events.

This correctly sets the Accept header to it accordingly in order to comply with the
standard. The exact same problem exists in other SDKS (e.g. https://github.com/openai/openai-[go/pull/94](https://www.golinks.io/pull/94?trackSource=github))

Additional context & links


Context: I am an Envoy Proxy community member and from a network proxy perspective, the discrepancy from the web standard is not a good thing. Hope this brings an attention to the problem as the fix is clearly a single line!

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.

1 participant