fix: StoreMessage.py to prevent errors on Component (#4162)

* 📝 (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.
This commit is contained in:
Cristhian Zanforlin Lousa 2024-10-15 22:38:26 -03:00 committed by GitHub
commit f14ead9739
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.",