Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

refactor: Update batch update method documentation to clarify optiona… (#2982)

Anirudh S9e9dcd70e149
diff --git a/mem0/client/main.py b/mem0/client/main.py
index ac15e9e7b..aba36dbd7 100644
--- a/mem0/client/main.py
+++ b/mem0/client/main.py
@@ -447,16 +447,13 @@ class MemoryClient:
"""Batch update memories.
Args:
- memories: List of memory dictionaries to update. Each dictionary
- must contain:
+ memories: List of memory dictionaries to update. Each dictionary must contain:
- memory_id (str): ID of the memory to update
- - text (str): New text content for the memory
+ - text (str, optional): New text content for the memory
+ - metadata (dict, optional): New metadata for the memory
Returns:
- str: Message indicating the success of the batch update.
-
- Raises:
- APIError: If the API request fails.
+ Dict[str, Any]: The response from the server.
"""
response = self.client.put("/v1/batch/", json={"memories": memories})
response.raise_for_status()
@@ -1232,16 +1229,13 @@ class AsyncMemoryClient:
"""Batch update memories.
Args:
- memories: List of memory dictionaries to update. Each dictionary
- must contain:
+ memories: List of memory dictionaries to update. Each dictionary must contain:
- memory_id (str): ID of the memory to update
- - text (str): New text content for the memory
+ - text (str, optional): New text content for the memory
+ - metadata (dict, optional): New metadata for the memory
Returns:
- str: Message indicating the success of the batch update.
-
- Raises:
- APIError: If the API request fails.
+ Dict[str, Any]: The response from the server.
"""
response = await self.async_client.put("/v1/batch/", json={"memories": memories})
response.raise_for_status()