mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-17 21:11:40 +00:00
partners[anthropic]: fix anthropic chat model message type lookup keys (#19034)
- **Description:** Fixing message formatting issue in ChatAnthropic model by adding dictionary keys for `AIMessageChunk `and `HumanMessageChunk` - **Issue:** #19025 - **Twitter handle:** @maximeperrin_ Co-authored-by: Maxime Perrin <mperrin@doing.fr> Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
d64bd32b20
commit
5ac0d1f67b
@ -56,7 +56,12 @@ from langchain_core.utils.function_calling import convert_to_openai_tool
|
||||
|
||||
from 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:
|
||||
|
Loading…
Reference in New Issue
Block a user