mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 08:03:39 +00:00
core[patch]: Fixed bug in dict to message conversion. (#17023)
- **Description**: We discovered a bug converting dictionaries to messages where the ChatMessageChunk message type isn't handled. This PR adds support for that message type. - **Issue**: #17022 - **Dependencies**: None - **Twitter handle**: None
This commit is contained in:
parent
54fcd476bb
commit
b3c3b58f2c
@ -92,6 +92,8 @@ def _message_from_dict(message: dict) -> BaseMessage:
|
||||
return ToolMessageChunk(**message["data"])
|
||||
elif _type == "SystemMessageChunk":
|
||||
return SystemMessageChunk(**message["data"])
|
||||
elif _type == "ChatMessageChunk":
|
||||
return ChatMessageChunk(**message["data"])
|
||||
else:
|
||||
raise ValueError(f"Got unexpected message type: {_type}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user