Skip to content

Commit

Permalink
fix(internal): handle leading whitespace in message content
Browse files Browse the repository at this point in the history
  • Loading branch information
blingblin-g committed Feb 4, 2025
1 parent 7a6517d commit 825d229
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openai/lib/streaming/chat/_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def _accumulate_chunk(self, chunk: ChatCompletionChunk) -> ParsedChatCompletionS
raise ContentFilterFinishReasonError()

if (
choice_snapshot.message.content
choice_snapshot.message.content.strip()
and not choice_snapshot.message.refusal
and is_given(self._rich_response_format)
):
Expand Down

0 comments on commit 825d229

Please sign in to comment.