From a9b3b2e3270aa24cb3cc4680c1e19d6eda86b013 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 13 Jun 2023 06:39:10 +0100 Subject: [PATCH] Enable serialization for anthropic (#6049) --- langchain/chat_models/anthropic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/langchain/chat_models/anthropic.py b/langchain/chat_models/anthropic.py index 5f21cdeb..a9f3d0e0 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}"