Skip to content

fix(openai): preserve logprobs for streaming chat spans#215

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit intomainfrom
abhi-fix-180-stream-logprobs
Open

fix(openai): preserve logprobs for streaming chat spans#215
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit intomainfrom
abhi-fix-180-stream-logprobs

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

Accumulate per-chunk logprob content and refusal entries when postprocessing chat completion streams so traced output matches non-streaming calls. Also read finish_reason from the streamed choice and add a VCR regression test for the wrapped sync path.

Closes #180

@starfolkai
Copy link
Copy Markdown

starfolkai bot commented Apr 7, 2026

Drop into this review session: sfk devbox connect pr-215-braintrust-sdk-python-2bd0 --attach

No serious bugs or issues found 🎉

Accumulate per-chunk logprob content and refusal entries when
postprocessing chat completion streams so traced output matches
non-streaming calls. Also read finish_reason from the streamed
choice and add a VCR regression test for the wrapped sync path.

Closes #180
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.

[BOT ISSUE] OpenAI: chat completions streaming discards logprobs from chunks

2 participants