Skip to content

Commit f666597

Browse files
Ignore empty text parts in GoogleModel (#3360)
1 parent 4aa51fa commit f666597

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ async def _get_event_iterator(self) -> AsyncIterator[ModelResponseStreamEvent]:
677677
provider_name=self.provider_name,
678678
)
679679

680-
if part.text is not None:
680+
if part.text:
681681
if part.thought:
682682
yield self._parts_manager.handle_thinking_delta(vendor_part_id='thinking', content=part.text)
683683
else:
@@ -822,7 +822,7 @@ def _process_response_from_parts(
822822
elif part.code_execution_result is not None:
823823
assert code_execution_tool_call_id is not None
824824
item = _map_code_execution_result(part.code_execution_result, provider_name, code_execution_tool_call_id)
825-
elif part.text is not None:
825+
elif part.text:
826826
if part.thought:
827827
item = ThinkingPart(content=part.text)
828828
else:

0 commit comments

Comments
 (0)