check if attribute choices is present (#535)
This commit is contained in:
parent
e7c9b0fa42
commit
134ee46f5b
1 changed files with 1 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ class OpenAI(LLM):
|
|||
stream=True,
|
||||
**args,
|
||||
):
|
||||
if len(chunk.choices) == 0:
|
||||
if not hasattr(chunk, "choices") or len(chunk.choices) == 0:
|
||||
continue
|
||||
yield chunk.choices[0].delta
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue