Skip to content

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. openai/openai-go#94, openai/openai-python#1815)

Additional context & links

Fixes #375


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!

@mathetake mathetake requested a review from a team as a code owner October 23, 2024 17:15
@mathetake mathetake changed the title Correctly set Accept header to text/event-stream for streaming Correctly set Accept header to text/event-stream for completion streaming Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inquiry about the 'Accept' header
2 participants