mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
fix(mistralai): handle null content in tool call responses (#34268)
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user