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
+13 -3
View File
@@ -265,12 +265,17 @@ class MemoryClient:
) -> Dict[str, Any]:
"""
Update a memory by ID.
Args:
memory_id (str): Memory ID.
text (str, optional): Data to update in the memory.
text (str, optional): New content to update the memory with.
metadata (dict, optional): Metadata to update in the memory.
Returns:
Dict[str, Any]: The response from the server.
Example:
>>> client.update(memory_id="mem_123", text="Likes to play tennis on weekends")
"""
if text is None and metadata is None:
raise ValueError("Either text or metadata must be provided for update.")
@@ -1054,13 +1059,18 @@ class AsyncMemoryClient:
self, memory_id: str, text: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None
) -> Dict[str, Any]:
"""
Update a memory by ID.
Update a memory by ID asynchronously.
Args:
memory_id (str): Memory ID.
text (str, optional): Data to update in the memory.
text (str, optional): New content to update the memory with.
metadata (dict, optional): Metadata to update in the memory.
Returns:
Dict[str, Any]: The response from the server.
Example:
>>> await client.update(memory_id="mem_123", text="Likes to play tennis on weekends")
"""
if text is None and metadata is None:
raise ValueError("Either text or metadata must be provided for update.")