fix(mistralai): handle null content in tool call responses (#34268)

This commit is contained in:
Nhan Nguyen
2025-12-12 13:18:56 -05:00
committed by GitHub
parent 914730cf8d
commit 7829b722b1
2 changed files with 54 additions and 1 deletions

View File

@@ -148,7 +148,8 @@ def _convert_mistral_chat_message_to_message(
if role != "assistant":
msg = f"Expected role to be 'assistant', got {role}"
raise ValueError(msg)
content = cast("str", _message["content"])
# Mistral returns None for tool invocations
content = _message.get("content", "") or ""
additional_kwargs: dict = {}
tool_calls = []