Commit 4fc52529
Changed files (1)
src
openai
lib
streaming
chat
src/openai/lib/streaming/chat/_completions.py
@@ -439,7 +439,7 @@ class ChatCompletionStreamState(Generic[ResponseFormatT]):
and not choice_snapshot.message.refusal
and is_given(self._rich_response_format)
# partial parsing fails on white-space
- and choice_snapshot.message.content.strip()
+ and choice_snapshot.message.content.lstrip()
):
choice_snapshot.message.parsed = from_json(
bytes(choice_snapshot.message.content, "utf-8"),