From f499e6ea6a90c00074ef244ce0e5f172d0e7a8a6 Mon Sep 17 00:00:00 2001 From: Nikita Pokidyshev Date: Fri, 28 Jul 2023 03:45:27 +0400 Subject: [PATCH] Add FunctionMessage to _message_from_dict (#8374) --- libs/langchain/langchain/schema/messages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/langchain/langchain/schema/messages.py b/libs/langchain/langchain/schema/messages.py index 8895ed7e25..c926bcc8f6 100644 --- a/libs/langchain/langchain/schema/messages.py +++ b/libs/langchain/langchain/schema/messages.py @@ -230,6 +230,8 @@ def _message_from_dict(message: dict) -> BaseMessage: return SystemMessage(**message["data"]) elif _type == "chat": return ChatMessage(**message["data"]) + elif _type == "function": + return FunctionMessage(**message["data"]) else: raise ValueError(f"Got unexpected message type: {_type}")