Add check for empty choices in response chunks (#738)

This commit is contained in:
ShH Y
2026-01-28 05:11:00 +08:00
committed by GitHub
parent a04167c723
commit 880e7db0d0
+2
View File
@@ -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.