You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: Streamed chat completions with n>1 merge all choices' texts into one message #9779
When a Chat Completions request is made with n > 1, the provider interleaves the choices' deltas in a single stream. The streaming parser merges every choice of a chunk into one update tagged with the shared chunk id (message_id=chunk.id), so the final ChatResponse concatenates the alternatives' texts in arrival order into a single message, while the non-streaming parser emits one assistant Message per choice.
The non-streaming path (_parse_response_from_openai) already produces one Message per choice, so the streamed and non-streamed results disagree for the same request.
Tool calls are already choice-aware in streaming (tool_call_choice_index scoping), so this looks like an oversight for text rather than an intentional merge. Related: #9768 added per-message identity to the Responses client for the same class of aggregation problem.
changed the title [-]Streamed chat completions with n>1 merge all choices' texts into one message[/-][+]Python: Streamed chat completions with n>1 merge all choices' texts into one message[/+]on Oct 28, 2026
Activity
[-]Streamed chat completions with n>1 merge all choices' texts into one message[/-][+]Python: Streamed chat completions with n>1 merge all choices' texts into one message[/+]eavanvalkenburg commentedon Oct 28, 2026
We do not support N>1, closing.