Skip to content

Commit

Permalink
Doc: Update Batch API-Reference (#2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Khant authored Dec 17, 2024
1 parent be4188c commit 6b99457
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/api-reference/memory/batch-delete.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: 'Batch Delete Memories'
openapi: delete /v1/memories/batch/
openapi: delete /v1/batch/
---
2 changes: 1 addition & 1 deletion docs/api-reference/memory/batch-update.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: 'Batch Update Memories'
openapi: put /v1/memories/batch/
openapi: put /v1/batch/
---
8 changes: 4 additions & 4 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3586,7 +3586,7 @@
]
}
},
"/v1/memories/batch/": {
"/v1/batch/": {
"put": {
"tags": [
"memories"
Expand Down Expand Up @@ -3739,15 +3739,15 @@
"x-code-samples": [
{
"lang": "Python",
"source": "# To use the Python SDK, install the package:\n# pip install mem0ai\n\nfrom mem0 import MemoryClient\nclient = MemoryClient(api_key=\"your-api-key\")\n\ndelete_memories = [\n \"285ed74b-6e05-4043-b16b-3abd5b533496\",\n \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\"\n]\n\nresponse = client.batch_delete(delete_memories)\nprint(response)"
"source": "# To use the Python SDK, install the package:\n# pip install mem0ai\n\nfrom mem0 import MemoryClient\nclient = MemoryClient(api_key=\"your-api-key\")\n\ndelete_memories = [\n {\"memory_id\": \"285ed74b-6e05-4043-b16b-3abd5b533496\"},\n {\"memory_id\": \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\"}\n]\n\nresponse = client.batch_delete(delete_memories)\nprint(response)"
},
{
"lang": "JavaScript",
"source": "// To use the JavaScript SDK, install the package:\n// npm i mem0ai\n\nimport MemoryClient from 'mem0ai';\nconst client = new MemoryClient({ apiKey: \"your-api-key\" });\n\nconst deleteMemories = [\n \"285ed74b-6e05-4043-b16b-3abd5b533496\",\n \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\"\n];\n\nclient.batchDelete(deleteMemories)\n .then(response => console.log('Batch delete response:', response))\n .catch(error => console.error(error));"
"source": "// To use the JavaScript SDK, install the package:\n// npm i mem0ai\n\nimport MemoryClient from 'mem0ai';\nconst client = new MemoryClient({ apiKey: \"your-api-key\" });\n\nconst deleteMemories = [\n { memory_id: \"285ed74b-6e05-4043-b16b-3abd5b533496\" },\n { memory_id: \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\" }\n];\n\nclient.batchDelete(deleteMemories)\n .then(response => console.log('Batch delete response:', response))\n .catch(error => console.error(error));"
},
{
"lang": "cURL",
"source": "curl -X DELETE \"https://api.mem0.ai/v1/memories/batch/\" \\\n -H \"Authorization: Token your-api-key\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"memory_ids\": [\n \"285ed74b-6e05-4043-b16b-3abd5b533496\",\n \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\"\n ]\n }'"
"source": "curl -X DELETE \"https://api.mem0.ai/v1/memories/batch/\" \\\n -H \"Authorization: Token your-api-key\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"delete_memories\": [\n {\n \"memory_id\": \"285ed74b-6e05-4043-b16b-3abd5b533496\"\n },\n {\n \"memory_id\": \"2c9bd859-d1b7-4d33-a6b8-94e0147c4f07\"\n }\n ]\n }'"
}
]
}
Expand Down

0 comments on commit 6b99457

Please sign in to comment.