diff --git a/libs/partners/mistralai/langchain_mistralai/chat_models.py b/libs/partners/mistralai/langchain_mistralai/chat_models.py index 85924a714543c..aed0f70542786 100644 --- a/libs/partners/mistralai/langchain_mistralai/chat_models.py +++ b/libs/partners/mistralai/langchain_mistralai/chat_models.py @@ -353,7 +353,9 @@ def _convert_message_to_mistral_chat_message( "role": "tool", "content": message.content, "name": message.name, - "tool_call_id": message.tool_call_id, + "tool_call_id": _convert_tool_call_id_to_mistral_compatible( + message.tool_call_id + ), } else: raise ValueError(f"Got unknown type {message}")