mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Enable serialization for anthropic (#6049)
This commit is contained in:
parent
6ac5d80286
commit
a9b3b2e327
@ -44,6 +44,10 @@ class ChatAnthropic(BaseChatModel, _AnthropicCommon):
|
|||||||
"""Return type of chat model."""
|
"""Return type of chat model."""
|
||||||
return "anthropic-chat"
|
return "anthropic-chat"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def lc_serializable(self) -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
def _convert_one_message_to_text(self, message: BaseMessage) -> str:
|
def _convert_one_message_to_text(self, message: BaseMessage) -> str:
|
||||||
if isinstance(message, ChatMessage):
|
if isinstance(message, ChatMessage):
|
||||||
message_text = f"\n\n{message.role.capitalize()}: {message.content}"
|
message_text = f"\n\n{message.role.capitalize()}: {message.content}"
|
||||||
|
Loading…
Reference in New Issue
Block a user