File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
pydantic_ai_slim/pydantic_ai/models Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ async def _get_event_iterator(self) -> AsyncIterator[ModelResponseStreamEvent]:
399
399
raise UnexpectedModelBehavior ('Streamed response has no content field' ) # pragma: no cover
400
400
assert candidate .content .parts is not None
401
401
for part in candidate .content .parts :
402
- if part .text :
402
+ if part .text is not None :
403
403
yield self ._parts_manager .handle_text_delta (vendor_part_id = 'content' , content = part .text )
404
404
elif part .function_call :
405
405
maybe_event = self ._parts_manager .handle_tool_call_delta (
@@ -447,7 +447,7 @@ def _process_response_from_parts(
447
447
) -> ModelResponse :
448
448
items : list [ModelResponsePart ] = []
449
449
for part in parts :
450
- if part .text :
450
+ if part .text is not None :
451
451
items .append (TextPart (content = part .text ))
452
452
elif part .function_call :
453
453
assert part .function_call .name is not None
You can’t perform that action at this time.
0 commit comments