diff --git a/sgpt/handlers/handler.py b/sgpt/handlers/handler.py index a17d8024..1dd7e0f4 100644 --- a/sgpt/handlers/handler.py +++ b/sgpt/handlers/handler.py @@ -116,6 +116,8 @@ def get_completion( for chunk in response: delta = chunk.choices[0].delta + if not delta: continue + # LiteLLM uses dict instead of Pydantic object like OpenAI does. tool_calls = ( delta.get("tool_calls") if use_litellm else delta.tool_calls