fix(fastapi): adds missing parts check in unstructured google stream

This commit is contained in:
sauravniraula 2025-08-20 20:46:49 +05:45
parent 9ba0346935
commit 4156933c9b
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326

View file

@ -950,7 +950,11 @@ class LLMClient:
max_output_tokens=max_tokens,
),
):
if not (event.candidates and event.candidates[0].content):
if not (
event.candidates
and event.candidates[0].content
and event.candidates[0].content.parts
):
continue
generated_contents.append(event.candidates[0].content)