Fix dependency and tests and updated docstring (#3337)

This commit is contained in:
Parshva Daftari
2025-08-19 02:12:24 +05:30
committed by GitHub
parent 346b913ace
commit c8ee17b884
6 changed files with 53 additions and 22 deletions
+21 -4
View File
@@ -730,10 +730,14 @@ class Memory(MemoryBase):
Args:
memory_id (str): ID of the memory to update.
data (dict): Data to update the memory with.
data (str): New content to update the memory with.
Returns:
dict: Updated memory.
dict: Success message indicating the memory was updated.
Example:
>>> m.update(memory_id="mem_123", data="Likes to play tennis on weekends")
{'message': 'Memory updated successfully!'}
"""
capture_event("mem0.update", self, {"memory_id": memory_id, "sync_type": "sync"})
@@ -994,6 +998,15 @@ class AsyncMemory(MemoryBase):
else:
self.graph = None
self.config.vector_store.config.collection_name = "mem0migrations"
if self.config.vector_store.provider in ["faiss", "qdrant"]:
provider_path = f"migrations_{self.config.vector_store.provider}"
self.config.vector_store.config.path = os.path.join(mem0_dir, provider_path)
os.makedirs(self.config.vector_store.config.path, exist_ok=True)
self._telemetry_vector_store = VectorStoreFactory.create(
self.config.vector_store.provider, self.config.vector_store.config
)
capture_event("mem0.init", self, {"sync_type": "async"})
@classmethod
@@ -1580,10 +1593,14 @@ class AsyncMemory(MemoryBase):
Args:
memory_id (str): ID of the memory to update.
data (dict): Data to update the memory with.
data (str): New content to update the memory with.
Returns:
dict: Updated memory.
dict: Success message indicating the memory was updated.
Example:
>>> await m.update(memory_id="mem_123", data="Likes to play tennis on weekends")
{'message': 'Memory updated successfully!'}
"""
capture_event("mem0.update", self, {"memory_id": memory_id, "sync_type": "async"})