Skip to content

Commit 825d229

Browse files
committed
fix(internal): handle leading whitespace in message content
1 parent 7a6517d commit 825d229

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/openai/lib/streaming/chat/_completions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def _accumulate_chunk(self, chunk: ChatCompletionChunk) -> ParsedChatCompletionS
431431
raise ContentFilterFinishReasonError()
432432

433433
if (
434-
choice_snapshot.message.content
434+
choice_snapshot.message.content.strip()
435435
and not choice_snapshot.message.refusal
436436
and is_given(self._rich_response_format)
437437
):

0 commit comments

Comments
 (0)