We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66fa21a commit a4ba046Copy full SHA for a4ba046
pydantic_ai_slim/pydantic_ai/models/openai.py
@@ -1173,7 +1173,7 @@ async def _get_event_iterator(self) -> AsyncIterator[ModelResponseStreamEvent]:
1173
1174
# Handle the text part of the response
1175
content = choice.delta.content
1176
- if content is not None:
+ if (delta := choice.delta) is not None and (content := delta.content) is not None:
1177
maybe_event = self._parts_manager.handle_text_delta(
1178
vendor_part_id='content',
1179
content=content,
0 commit comments