Skip to content

Comments

feat(parser): add support for output_text in response parsing#1681

Open
alessiopelliccione wants to merge 1 commit intoopenai:masterfrom
alessiopelliccione:fix/responses-stream-output-text
Open

feat(parser): add support for output_text in response parsing#1681
alessiopelliccione wants to merge 1 commit intoopenai:masterfrom
alessiopelliccione:fix/responses-stream-output-text

Conversation

@alessiopelliccione
Copy link

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

Changes being requested

While consuming streaming responses (e.g. client.responses.stream(...)), the final snapshot sometimes arrived without an output_text field, so stream.finalResponse() returned an object where output_text was undefined.
This meant downstream code had to manually concatenate deltas, even though non-streaming responses already provide output_text.

The fix ensures both maybeParseResponse branches rebuild the text when the payload lacks it (or sets it to null), using a small shared helper around the existing addOutputText logic.

Additional context & links

Fixes #1662

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.

finalResponse() missing output_text field in streaming mode

1 participant