Skip to content

Commit 4d39c9b

Browse files
authored
Fix bug related to Azure OpenAI streaming response
1 parent 66fa21a commit 4d39c9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,9 @@ async def _get_event_iterator(self) -> AsyncIterator[ModelResponseStreamEvent]:
11711171
except IndexError:
11721172
continue
11731173

1174+
if choice.delta is None:
1175+
continue
1176+
11741177
# Handle the text part of the response
11751178
content = choice.delta.content
11761179
if content is not None:

0 commit comments

Comments
 (0)