mistral[patch]: ensure tool call IDs in tool messages are correctly formatted (#28422)

Fixes tests for cross-provider compatibility:
https://github.com/langchain-ai/langchain/actions/runs/12085358877/job/33702420504#step:10:376
This commit is contained in:
ccurme 2024-11-29 08:56:06 -05:00 committed by GitHub
parent 2813e86407
commit c2f1d022a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}")