From aa5a966f15b1a076312bef034a1523c2bde38a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 29 Jul 2024 14:15:05 +0200 Subject: [PATCH] fix: Store message should not override sender by default --- .../base/langflow/components/helpers/StoreMessage.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/backend/base/langflow/components/helpers/StoreMessage.py b/src/backend/base/langflow/components/helpers/StoreMessage.py index 651110a4088..c43e3157063 100644 --- a/src/backend/base/langflow/components/helpers/StoreMessage.py +++ b/src/backend/base/langflow/components/helpers/StoreMessage.py @@ -23,15 +23,13 @@ class StoreMessageComponent(Component): StrInput( name="sender", display_name="Sender", - info="The sender of the message.", - value=MESSAGE_SENDER_AI, + info="The sender of the message. Might be Machine or User. If empty, the current sender parameter will be used.", advanced=True, ), StrInput( name="sender_name", display_name="Sender Name", - info="The name of the sender.", - value=MESSAGE_SENDER_NAME_AI, + info="The name of the sender. Might be AI or User. If empty, the current sender parameter will be used.", advanced=True, ), StrInput( @@ -50,8 +48,8 @@ def store_message(self) -> Message: message = self.message message.session_id = self.session_id or message.session_id - message.sender = self.sender or message.sender - message.sender_name = self.sender_name or message.sender_name + message.sender = self.sender or message.sender or MESSAGE_SENDER_AI + message.sender_name = self.sender_name or message.sender_name or MESSAGE_SENDER_NAME_AI if self.memory: # override session_id