From 9e9dcd70e1499dbf399ba04c64fd23de05964db3 Mon Sep 17 00:00:00 2001 From: Anirudh S Date: Wed, 13 Aug 2025 01:25:53 +0530 Subject: [PATCH] =?UTF-8?q?refactor:=20Update=20batch=20update=20method=20?= =?UTF-8?q?documentation=20to=20clarify=20optiona=E2=80=A6=20(#2982)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mem0/client/main.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) 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()