[bug_improvement]: Update hash changed and Vector base class improved (#2034)

This commit is contained in:
Mayank
2024-11-20 23:18:34 +05:30
committed by GitHub
parent 5ab09ffd5a
commit 751f5d5a19
2 changed files with 7 additions and 2 deletions

View File

@@ -582,7 +582,7 @@ class Memory(MemoryBase):
new_metadata = metadata or {}
new_metadata["data"] = data
new_metadata["hash"] = existing_memory.payload.get("hash")
new_metadata["hash"] = hashlib.md5(data.encode()).hexdigest()
new_metadata["created_at"] = existing_memory.payload.get("created_at")
new_metadata["updated_at"] = datetime.now(pytz.timezone("US/Pacific")).isoformat()

View File

@@ -38,7 +38,7 @@ class VectorStoreBase(ABC):
pass
@abstractmethod
def delete_col(self, name):
def delete_col(self):
"""Delete a collection."""
pass
@@ -46,3 +46,8 @@ class VectorStoreBase(ABC):
def col_info(self, name):
"""Get information about a collection."""
pass
@abstractmethod
def list(self, filters=None, limit=None):
"""List all memories."""
pass