diff --git a/libs/partners/mistralai/langchain_mistralai/chat_models.py b/libs/partners/mistralai/langchain_mistralai/chat_models.py index be973f3b9ec78..686e4a7e6a8dd 100644 --- a/libs/partners/mistralai/langchain_mistralai/chat_models.py +++ b/libs/partners/mistralai/langchain_mistralai/chat_models.py @@ -345,6 +345,8 @@ def _convert_message_to_mistral_chat_message( message_dict["content"] = "" else: message_dict["content"] = message.content + if "prefix" in message.additional_kwargs: + message_dict["prefix"] = message.additional_kwargs["prefix"] return message_dict elif isinstance(message, SystemMessage): return dict(role="system", content=message.content)