From 6fa295b8a8f7bc17d3f8bd054b6380b2fde4ceec Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 29 Jun 2023 18:37:52 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(memories.py):=20fix=20condit?= =?UTF-8?q?ion=20to=20add=20extra=20fields=20in=20MemoryFrontendNode=20cla?= =?UTF-8?q?ss=20=E2=9C=A8=20feat(memories.py):=20add=20show=20attribute=20?= =?UTF-8?q?to=20entity=5Fstore=20field=20in=20MemoryFrontendNode=20class?= =?UTF-8?q?=20The=20condition=20to=20add=20extra=20fields=20in=20the=20Mem?= =?UTF-8?q?oryFrontendNode=20class=20has=20been=20fixed=20to=20correctly?= =?UTF-8?q?=20check=20if=20any=20of=20the=20base=20classes=20are=20in=20a?= =?UTF-8?q?=20list=20of=20base=20message=20classes.=20Additionally,=20the?= =?UTF-8?q?=20show=20attribute=20has=20been=20added=20to=20the=20entity=5F?= =?UTF-8?q?store=20field=20in=20the=20MemoryFrontendNode=20class=20to=20co?= =?UTF-8?q?ntrol=20its=20visibility.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/template/frontend_node/memories.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/template/frontend_node/memories.py b/src/backend/langflow/template/frontend_node/memories.py index 6d9368823..37177c72e 100644 --- a/src/backend/langflow/template/frontend_node/memories.py +++ b/src/backend/langflow/template/frontend_node/memories.py @@ -11,7 +11,8 @@ class MemoryFrontendNode(FrontendNode): def add_extra_fields(self) -> None: # chat history should have another way to add common field? # prevent adding incorect field in ChatMessageHistory - if "BaseChatMessageHistory" in self.base_classes: + base_message_classes = ["BaseEntityStore", "BaseChatMessageHistory"] + if any(base_class in self.base_classes for base_class in base_message_classes): return # add return_messages field @@ -77,6 +78,10 @@ class MemoryFrontendNode(FrontendNode): field.required = False if field.name == "url": field.show = True + if field.name == "entity_store": + field.show = True + if name == "SQLiteEntityStore": + field.show = True class PostgresChatMessageHistoryFrontendNode(MemoryFrontendNode):