The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
partners[anthropic]: fix anthropic chat model message type lookup keys (#19034)
Maxime Perrin5ac0d1f67b4e
diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.pyindex 6b2aa154e0..ef09aa3799 100644--- a/libs/partners/anthropic/langchain_anthropic/chat_models.py+++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py@@ -56,7 +56,12 @@ from langchain_core.utils.function_calling import convert_to_openai_toolfrom langchain_anthropic.output_parsers import ToolsOutputParser-_message_type_lookups = {"human": "user", "ai": "assistant"}+_message_type_lookups = {+ "human": "user",+ "ai": "assistant",+ "AIMessageChunk": "assistant",+ "HumanMessageChunk": "user",+}def _format_image(image_url: str) -> Dict: