Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Memory fixes.

BillSchumachera861dec67642
diff --git a/scripts/memory/local.py b/scripts/memory/local.py
index fb10522426..8dc90021ff 100644
--- a/scripts/memory/local.py
+++ b/scripts/memory/local.py
@@ -44,6 +44,8 @@ class LocalCache(MemoryProviderSingleton):
Returns: None
"""
+ if 'Command Error:' in text:
+ return ""
self.data.texts.append(text)
embedding = get_ada_embedding(text)
@@ -64,6 +66,7 @@ class LocalCache(MemoryProviderSingleton):
option=SAVE_OPTIONS
)
f.write(out)
+ return text
def clear(self) -> str:
"""
diff --git a/scripts/memory/redismem.py b/scripts/memory/redismem.py
index 296d0cce2c..2082fe5887 100644
--- a/scripts/memory/redismem.py
+++ b/scripts/memory/redismem.py
@@ -69,6 +69,8 @@ class RedisMemory(MemoryProviderSingleton):
Returns: Message indicating that the data has been added.
"""
+ if 'Command Error:' in data:
+ return ""
vector = get_ada_embedding(data)
vector = np.array(vector).astype(np.float32).tobytes()
data_dict = {
@@ -132,7 +134,7 @@ class RedisMemory(MemoryProviderSingleton):
except Exception as e:
print("Error calling Redis search: ", e)
return None
- return list(results.docs)
+ return [result.data for result in results.docs]
def get_stats(self):
"""