refactor: Update batch update method documentation to clarify optiona… (#2982)
This commit is contained in:
+8
-14
@@ -447,16 +447,13 @@ class MemoryClient:
|
|||||||
"""Batch update memories.
|
"""Batch update memories.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
memories: List of memory dictionaries to update. Each dictionary
|
memories: List of memory dictionaries to update. Each dictionary must contain:
|
||||||
must contain:
|
|
||||||
- memory_id (str): ID of the memory to update
|
- 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:
|
Returns:
|
||||||
str: Message indicating the success of the batch update.
|
Dict[str, Any]: The response from the server.
|
||||||
|
|
||||||
Raises:
|
|
||||||
APIError: If the API request fails.
|
|
||||||
"""
|
"""
|
||||||
response = self.client.put("/v1/batch/", json={"memories": memories})
|
response = self.client.put("/v1/batch/", json={"memories": memories})
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
@@ -1232,16 +1229,13 @@ class AsyncMemoryClient:
|
|||||||
"""Batch update memories.
|
"""Batch update memories.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
memories: List of memory dictionaries to update. Each dictionary
|
memories: List of memory dictionaries to update. Each dictionary must contain:
|
||||||
must contain:
|
|
||||||
- memory_id (str): ID of the memory to update
|
- 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:
|
Returns:
|
||||||
str: Message indicating the success of the batch update.
|
Dict[str, Any]: The response from the server.
|
||||||
|
|
||||||
Raises:
|
|
||||||
APIError: If the API request fails.
|
|
||||||
"""
|
"""
|
||||||
response = await self.async_client.put("/v1/batch/", json={"memories": memories})
|
response = await self.async_client.put("/v1/batch/", json={"memories": memories})
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user