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

finish_reason missing from streaming responses when None #19

Open
daveb1976 opened this issue Feb 17, 2025 · 0 comments
Open

finish_reason missing from streaming responses when None #19

daveb1976 opened this issue Feb 17, 2025 · 0 comments

Comments

@daveb1976
Copy link

The finish_reason field doesn't appear to be being passed through to the client.

Here's an example of the incoming data from OpenAI:

final returned processed chunk: ModelResponseStream(id='chatcmpl-B1z1HwsKbjazcsxVWxtBgG1FEOFEJ', created=1739812588, model='gpt-4o', object='chat.completion.chunk', system_fingerprint='fp_523b9b6e5f', choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, refusal=None, content='?', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], stream_options={'include_usage': True}, citations=None)

The response looks like this:

data: {"id":"chatcmpl-B1z1HwsKbjazcsxVWxtBgG1FEOFEJ","created":1739812588,"model":"gpt-4o","object":"chat.completion.chunk","system_fingerprint":"fp_523b9b6e5f","choices":[{"index":0,"delta":{"content":"?"}}],"stream_options":{"include_usage":true}}

It does get returned on the last message when it is something other than None.

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

No branches or pull requests

1 participant