The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Enable serialization for anthropic (#6049)
Nuno Camposa9b3b2e3270a
diff --git a/langchain/chat_models/anthropic.py b/langchain/chat_models/anthropic.pyindex 5f21cdeb3c..a9f3d0e02d 100644--- a/langchain/chat_models/anthropic.py+++ b/langchain/chat_models/anthropic.py@@ -44,6 +44,10 @@ class ChatAnthropic(BaseChatModel, _AnthropicCommon):"""Return type of chat model."""return "anthropic-chat"+ @property+ def lc_serializable(self) -> bool:+ return True+def _convert_one_message_to_text(self, message: BaseMessage) -> str:if isinstance(message, ChatMessage):message_text = f"\n\n{message.role.capitalize()}: {message.content}"