Skip to content

Commit

Permalink
fix: StoreMessage.py to prevent errors on Component (#4162)
Browse files Browse the repository at this point in the history
* 📝 (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.
  • Loading branch information
Cristhianzl authored Oct 16, 2024
1 parent 047077c commit f14ead9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/backend/base/langflow/components/helpers/StoreMessage.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.",
Expand Down

0 comments on commit f14ead9

Please sign in to comment.