From a3417d047b14a92d7f6351616fdf472c25a5e9f3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 25 Jul 2023 16:32:01 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9D=20docs(config.yaml):=20add=20d?= =?UTF-8?q?ocumentation=20link=20for=20MotorheadMemory=20integration=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(memories.py):=20hide=20and=20make=20chat=5Fm?= =?UTF-8?q?emory=20field=20optional=20for=20MotorheadMemory=20frontend=20n?= =?UTF-8?q?ode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/config.yaml | 2 ++ src/backend/langflow/template/frontend_node/memories.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/backend/langflow/config.yaml b/src/backend/langflow/config.yaml index 3116e74c7..7a75d8ff4 100644 --- a/src/backend/langflow/config.yaml +++ b/src/backend/langflow/config.yaml @@ -153,6 +153,8 @@ memories: documentation: "https://python.langchain.com/docs/modules/memory/how_to/vectorstore_retriever_memory" MongoDBChatMessageHistory: documentation: "https://python.langchain.com/docs/modules/memory/integrations/mongodb_chat_message_history" + MotorheadMemory: + documentation: "https://python.langchain.com/docs/integrations/memory/motorhead_memory" prompts: ChatMessagePromptTemplate: documentation: "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates" diff --git a/src/backend/langflow/template/frontend_node/memories.py b/src/backend/langflow/template/frontend_node/memories.py index 374d36ff0..78337e786 100644 --- a/src/backend/langflow/template/frontend_node/memories.py +++ b/src/backend/langflow/template/frontend_node/memories.py @@ -94,6 +94,10 @@ class MemoryFrontendNode(FrontendNode): field.show = False field.required = False + if name == "MotorheadMemory" and field.name == "chat_memory": + field.show = False + field.required = False + class PostgresChatMessageHistoryFrontendNode(MemoryFrontendNode): name: str = "PostgresChatMessageHistory" From 41471b72a29591884a98af0768d1403ad6d02669 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 25 Jul 2023 16:45:00 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix(memories.py):=20fix=20co?= =?UTF-8?q?nditional=20statement=20for=20setting=20show=20and=20required?= =?UTF-8?q?=20properties=20of=20fields=20in=20MotorheadMemory=20class=20?= =?UTF-8?q?=E2=9C=A8=20feat(memories.py):=20add=20conditional=20statement?= =?UTF-8?q?=20to=20show=20client=5Fid=20field=20in=20MotorheadMemory=20cla?= =?UTF-8?q?ss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../langflow/template/frontend_node/memories.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/template/frontend_node/memories.py b/src/backend/langflow/template/frontend_node/memories.py index 78337e786..019dc0fa8 100644 --- a/src/backend/langflow/template/frontend_node/memories.py +++ b/src/backend/langflow/template/frontend_node/memories.py @@ -94,9 +94,13 @@ class MemoryFrontendNode(FrontendNode): field.show = False field.required = False - if name == "MotorheadMemory" and field.name == "chat_memory": - field.show = False - field.required = False + if name == "MotorheadMemory": + if field.name == "chat_memory": + field.show = False + field.required = False + elif field.name == "client_id": + field.show = True + field.advanced = False class PostgresChatMessageHistoryFrontendNode(MemoryFrontendNode):