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]

_handle_tool_call_message linting

Ishaan Jaff15e0a605e4a6
diff --git a/litellm/llms/mistral/mistral_chat_transformation.py b/litellm/llms/mistral/mistral_chat_transformation.py
index a93b1cae2a9..3e7a97c92f2 100644
--- a/litellm/llms/mistral/mistral_chat_transformation.py
+++ b/litellm/llms/mistral/mistral_chat_transformation.py
@@ -200,7 +200,7 @@ class MistralConfig(OpenAIGPTConfig):
"""
_tool_calls = message.get("tool_calls")
mistral_tool_calls: List[MistralToolCallMessage] = []
- if _tool_calls is not None:
+ if _tool_calls is not None and isinstance(_tool_calls, list):
for _tool in _tool_calls:
_tool_call_message = MistralToolCallMessage(
id=_tool.get("id"),