From 62bd93a4d2bf24b9e99e4598cb37e3f722f1f113 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Wed, 12 Apr 2023 17:48:08 -0700 Subject: [PATCH] Import NoMemory and add it as a memory_backend option in get_memory function --- scripts/memory/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/memory/__init__.py b/scripts/memory/__init__.py index a07f9fd8..d407f087 100644 --- a/scripts/memory/__init__.py +++ b/scripts/memory/__init__.py @@ -1,4 +1,5 @@ from memory.local import LocalCache +from memory.no_memory import NoMemory # List of supported memory backends # Add a backend to this list if the import attempt is successful @@ -34,6 +35,8 @@ def get_memory(cfg, init=False): " use Redis as a memory backend.") else: memory = RedisMemory(cfg) + elif cfg.memory_backend == "no_memory": + memory = NoMemory(cfg) if memory is None: memory = LocalCache(cfg) @@ -50,4 +53,5 @@ __all__ = [ "LocalCache", "RedisMemory", "PineconeMemory", + "NoMemory" ]