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 4d39c9b commit 74ac8c4Copy full SHA for 74ac8c4
pydantic_ai_slim/pydantic_ai/models/openai.py
@@ -1171,12 +1171,8 @@ async def _get_event_iterator(self) -> AsyncIterator[ModelResponseStreamEvent]:
1171
except IndexError:
1172
continue
1173
1174
- if choice.delta is None:
1175
- continue
1176
-
1177
# Handle the text part of the response
1178
- content = choice.delta.content
1179
- if content is not None:
+ if (delta := choice.delta) is not None and (content := delta.content) is not None:
1180
maybe_event = self._parts_manager.handle_text_delta(
1181
vendor_part_id='content',
1182
content=content,
0 commit comments