From f14ead9739e87210a40b451a701ba32cbc82d45c Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Tue, 15 Oct 2024 22:38:26 -0300 Subject: [PATCH] fix: StoreMessage.py to prevent errors on Component (#4162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 (StoreMessage.py): Update input types in StoreMessageComponent to include StrInput for sender, sender_name, and session_id to improve data handling and consistency. * 📝 (StoreMessage.py): Update imports to use the correct MessageTextInput class from langflow.inputs.inputs module for sender, sender_name, and session_id inputs in StoreMessageComponent class. This change ensures consistency and improves code readability. --- .../base/langflow/components/helpers/StoreMessage.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/base/langflow/components/helpers/StoreMessage.py b/src/backend/base/langflow/components/helpers/StoreMessage.py index 8e685125e..8341f2cf7 100644 --- a/src/backend/base/langflow/components/helpers/StoreMessage.py +++ b/src/backend/base/langflow/components/helpers/StoreMessage.py @@ -1,5 +1,6 @@ from langflow.custom import Component from langflow.inputs import HandleInput, MessageInput +from langflow.inputs.inputs import MessageTextInput from langflow.memory import get_messages, store_message from langflow.schema.message import Message from langflow.template import Output @@ -20,20 +21,20 @@ class StoreMessageComponent(Component): input_types=["BaseChatMessageHistory"], info="The external memory to store the message. If empty, it will use the Langflow tables.", ), - MessageInput( + MessageTextInput( name="sender", display_name="Sender", info="The sender of the message. Might be Machine or User. " "If empty, the current sender parameter will be used.", advanced=True, ), - MessageInput( + MessageTextInput( name="sender_name", display_name="Sender Name", info="The name of the sender. Might be AI or User. If empty, the current sender parameter will be used.", advanced=True, ), - MessageInput( + MessageTextInput( name="session_id", display_name="Session ID", info="The session ID of the chat. If empty, the current session ID parameter will be used.",