Skip to content

Commit

Permalink
feat: allow to set Prefix in AIMessage (for MistralAI)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain DEPARTE committed Dec 20, 2024
1 parent 5a351a1 commit a226708
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/partners/mistralai/langchain_mistralai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a226708

Please sign in to comment.