Skip to content

The agent engineering platform.

anthropic[patch]: Fix message type lookup in Anthropic Partners (#16563)

JongRok BAEK3b8eba32f93c
diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py
index 91cc511248..812b829589 100644
--- a/libs/partners/anthropic/langchain_anthropic/chat_models.py
+++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py
@@ -16,7 +16,7 @@ from langchain_core.outputs import ChatGeneration, ChatGenerationChunk, ChatResu
from langchain_core.pydantic_v1 import Field, SecretStr, root_validator
from langchain_core.utils import convert_to_secret_str
-_message_type_lookups = {"human": "user", "assistant": "ai"}
+_message_type_lookups = {"human": "user", "ai": "assistant"}
def _format_messages(messages: List[BaseMessage]) -> Tuple[Optional[str], List[Dict]]: