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:
Ryan Kraus 2024-02-05 13:13:25 -05:00 committed by GitHub
parent 54fcd476bb
commit b3c3b58f2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}")