fix(fastapi): adds missing parts check in unstructured google stream
This commit is contained in:
parent
9ba0346935
commit
4156933c9b
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue