Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix mistral stream test

Ishaan Jaffer9856fb75d15f
diff --git a/litellm/types/utils.py b/litellm/types/utils.py
index 05fc23a2c6b..1f5a32d1a62 100644
--- a/litellm/types/utils.py
+++ b/litellm/types/utils.py
@@ -819,6 +819,8 @@ class Delta(OpenAIObject):
if tool_call.get("index", None) is None:
tool_call["index"] = current_index
current_index += 1
+ if tool_call.get("type", None) is None:
+ tool_call["type"] = "function"
self.tool_calls.append(ChatCompletionDeltaToolCall(**tool_call))
elif isinstance(tool_call, ChatCompletionDeltaToolCall):
self.tool_calls.append(tool_call)