From 2725e24ced035aa11b80e932c30fd4fd383c0e2c Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 9 Aug 2023 21:11:00 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(constants.py):=20add=20Base?= =?UTF-8?q?Memory=20to=20LANGCHAIN=5FBASE=5FTYPES=20to=20support=20custom?= =?UTF-8?q?=20memory=20implementation=20in=20Langchain=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 📝 WHY: The addition of BaseMemory to LANGCHAIN_BASE_TYPES allows for the customization of the memory component in the Langchain interface. This enables users to implement their own memory functionality according to their specific needs. --- src/backend/langflow/interface/custom/constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/langflow/interface/custom/constants.py b/src/backend/langflow/interface/custom/constants.py index 83cf4b463..891fc75f9 100644 --- a/src/backend/langflow/interface/custom/constants.py +++ b/src/backend/langflow/interface/custom/constants.py @@ -8,6 +8,7 @@ from langchain.text_splitter import TextSplitter from langchain.tools import Tool from langchain.vectorstores.base import VectorStore from langchain.schema import BaseOutputParser +from langchain.schema.memory import BaseMemory LANGCHAIN_BASE_TYPES = { @@ -22,6 +23,7 @@ LANGCHAIN_BASE_TYPES = { "Embeddings": Embeddings, "BaseRetriever": BaseRetriever, "BaseOutputParser": BaseOutputParser, + "BaseMemory": BaseMemory, } # Langchain base types plus Python base types