mirror of
https://github.com/TheR1D/shell_gpt.git
synced 2026-06-02 06:14:32 +02:00
Add check for empty choices in response chunks (#738)
This commit is contained in:
@@ -114,6 +114,8 @@ class Handler:
|
||||
|
||||
try:
|
||||
for chunk in response:
|
||||
if not chunk.choices:
|
||||
continue
|
||||
delta = chunk.choices[0].delta
|
||||
|
||||
# LiteLLM uses dict instead of Pydantic object like OpenAI does.
|
||||
|
||||
Reference in New Issue
Block a user