diff --git a/fern/openapi.json b/fern/openapi.json index a8d89ff0..9d8e1e6e 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -80,15 +80,11 @@ "description": "Compare the field for equality or inequality" }, "value": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "boolean" - } - ], - "description": "Numeric or boolean value to compare against" + "description": "Numeric or boolean value to compare against", + "type": [ + "number", + "boolean" + ] } }, "required": [ @@ -343,6 +339,10 @@ { "name": "Organization", "description": "Read and update organization-wide settings" + }, + { + "name": "Feedback", + "description": "Report bugs, request features, and flag documentation issues" } ], "paths": { @@ -464,10 +464,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -584,10 +584,20 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst doc = await client.add(\"user_123\", {\n content: \"Sarah is being promoted to VP of Product.\",\n id: \"chat_session_1\",\n metadata: { type: \"conversation\" },\n dreaming: \"instant\",\n});\nconsole.log(doc.id, doc.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\ndoc = client.add(\n \"user_123\",\n content=\"Sarah is being promoted to VP of Product.\",\n id=\"chat_session_1\",\n metadata={\"type\": \"conversation\"},\n dreaming=\"instant\",\n)\nprint(doc.id, doc.status)" + }, { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"content\": \"Sarah is being promoted to VP of Product.\",\n \"dreaming\": \"instant\",\n \"id\": \"chat_session_1\",\n \"metadata\": { \"type\": \"conversation\" }\n }'" + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"content\": \"Sarah is being promoted to VP of Product.\",\n \"id\": \"chat_session_1\",\n \"metadata\": { \"type\": \"conversation\" },\n \"dreaming\": \"instant\"\n }'" } ] }, @@ -701,10 +711,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -741,7 +751,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst res = await client.documents.delete(\"user_123\", {\n ids: [\"chat_session_1\", \"doc_roadmap\"],\n});\nconsole.log(res.count, res.errors);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nres = client.documents.delete(\"user_123\", ids=[\"chat_session_1\", \"doc_roadmap\"])\nprint(res.count, res.errors)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X DELETE \"https://api.supermemory.ai/ns/user_123/document\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"ids\": [\"chat_session_1\", \"doc_roadmap\"] }'" + } + ] } }, "/ns/{namespace}/document/batch": { @@ -777,7 +804,7 @@ "failed", "error" ], - "description": "The document's processing state, as for a single add; error when this item failed" + "description": "The document's processing state after this request, or error when this item failed" }, "error": { "description": "Failure reason", @@ -891,10 +918,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -1026,6 +1053,16 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst res = await client.documents.batchAdd(\"user_123\", {\n documents: [\n { content: \"Q3 roadmap notes\", id: \"doc_roadmap\" },\n { content: \"Gift policy for VP promotions\", id: \"doc_gifts\" },\n ],\n dreaming: \"instant\",\n});\nconsole.log(res.count, res.failed);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nres = client.documents.batch_add(\n \"user_123\",\n documents=[\n {\"content\": \"Q3 roadmap notes\", \"id\": \"doc_roadmap\"},\n {\"content\": \"Gift policy for VP promotions\", \"id\": \"doc_gifts\"},\n ],\n dreaming=\"instant\",\n)\nprint(res.count, res.failed)" + }, { "lang": "bash", "label": "cURL", @@ -1051,16 +1088,12 @@ "example": "doc_xyz789" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], "description": "Extracted or caller-provided document title", - "example": "API Rate Limiting Policy" + "example": "API Rate Limiting Policy", + "type": [ + "string", + "null" + ] }, "type": { "type": "string", @@ -1068,27 +1101,19 @@ "example": "text" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the document, when available" + "description": "Generated summary of the document, when available", + "type": [ + "string", + "null" + ] }, "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], "description": "Canonical extracted text used for processing and recall", - "example": "Our API rate limits are 100 req/min on free and 1000 on pro." + "example": "Our API rate limits are 100 req/min on free and 1000 on pro.", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -1118,21 +1143,30 @@ ], "description": "Current extraction and memory-processing status" }, + "dreamingStatus": { + "type": "string", + "enum": [ + "dreaming", + "done" + ], + "description": "Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does." + }, "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the document was created" }, "updatedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp of the latest document update" } }, "required": [ "status", + "dreamingStatus", "createdAt", "updatedAt" ], @@ -1176,7 +1210,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the chunk was created" } }, @@ -1247,13 +1281,13 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when this memory version was created" }, "updatedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp of the latest update to this version" } }, @@ -1361,10 +1395,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -1400,10 +1434,20 @@ } ], "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst doc = await client.documents.get(\"user_123\", \"doc_abc123\", {\n include: [\"chunks\", \"memories\"],\n});\nconsole.log(doc.system.status, doc.chunks?.length, doc.memories?.length);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\ndoc = client.documents.get(\"user_123\", \"doc_abc123\", include=[\"chunks\", \"memories\"])\nprint(doc.system.status, len(doc.chunks or []), len(doc.memories or []))" + }, { "lang": "bash", "label": "cURL", - "source": "curl \"https://api.supermemory.ai/ns/project_123/document/doc_abc123?include=chunks,memories\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + "source": "curl \"https://api.supermemory.ai/ns/user_123/document/doc_abc123?include=chunks,memories\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" } ] }, @@ -1534,10 +1578,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -1656,10 +1700,20 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst updated = await client.documents.update(\"user_123\", \"chat_session_1\", {\n content: \"Updated notes: Sarah is now VP of Product.\",\n metadata: { type: \"conversation\" },\n});\nconsole.log(updated.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nupdated = client.documents.update(\n \"user_123\",\n \"chat_session_1\",\n content=\"Updated notes: Sarah is now VP of Product.\",\n metadata={\"type\": \"conversation\"},\n)\nprint(updated.status)" + }, { "lang": "bash", "label": "cURL", - "source": "curl -X PATCH \"https://api.supermemory.ai/ns/user_123/document/chat_session_1\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"content\": \"Updated notes \u2014 Sarah is now VP of Product.\",\n \"metadata\": { \"type\": \"conversation\" }\n }'" + "source": "curl -X PATCH \"https://api.supermemory.ai/ns/user_123/document/chat_session_1\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"content\": \"Updated notes: Sarah is now VP of Product.\",\n \"metadata\": { \"type\": \"conversation\" }\n }'" } ] } @@ -1782,10 +1836,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -1862,7 +1916,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\nimport { openAsBlob } from \"node:fs\";\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst doc = await client.documents.uploadFile(\"user_123\", {\n file: await openAsBlob(\"notes.pdf\"),\n metadata: JSON.stringify({ source: \"upload\" }), // multipart: metadata is a JSON string\n});\nconsole.log(doc.id, doc.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\nimport json\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nwith open(\"notes.pdf\", \"rb\") as f:\n doc = client.documents.upload_file(\n \"user_123\",\n file=f,\n metadata=json.dumps({\"source\": \"upload\"}), # multipart: metadata is a JSON string\n )\nprint(doc.id, doc.status)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document/file\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -F \"file=@notes.pdf\" \\\n -F 'metadata={\"source\":\"upload\"}'" + } + ] } }, "/ns/{namespace}/document/file/{id}": { @@ -1993,10 +2064,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -2085,7 +2156,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\nimport { openAsBlob } from \"node:fs\";\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst doc = await client.documents.replaceWithFile(\"user_123\", \"doc_abc123\", {\n file: await openAsBlob(\"notes-v2.pdf\"),\n metadata: JSON.stringify({ revision: 2 }),\n});\nconsole.log(doc.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\nimport json\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nwith open(\"notes-v2.pdf\", \"rb\") as f:\n doc = client.documents.replace_with_file(\n \"user_123\",\n \"doc_abc123\",\n file=f,\n metadata=json.dumps({\"revision\": 2}),\n )\nprint(doc.status)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document/file/doc_abc123\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -F \"file=@notes-v2.pdf\" \\\n -F 'metadata={\"revision\":2}'" + } + ] }, "patch": { "operationId": "patchNsByNamespaceDocumentFileById", @@ -2214,10 +2302,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents." @@ -2303,7 +2391,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst doc = await client.documents.updateFile(\"user_123\", \"doc_abc123\", {\n metadata: JSON.stringify({ reviewed: true }), // file is optional here\n});\nconsole.log(doc.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\nimport json\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\ndoc = client.documents.update_file(\n \"user_123\",\n \"doc_abc123\",\n metadata=json.dumps({\"reviewed\": True}), # file is optional here\n)\nprint(doc.status)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X PATCH \"https://api.supermemory.ai/ns/user_123/document/file/doc_abc123\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -F 'metadata={\"reviewed\":true}'" + } + ] } }, "/ns/{namespace}/search": { @@ -2407,13 +2512,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -2472,13 +2573,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -2537,13 +2634,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -2598,26 +2691,18 @@ "description": "Source document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source document title" + "description": "Source document title", + "type": [ + "string", + "null" + ] }, "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Detected source or content type" + "description": "Detected source or content type", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -2628,15 +2713,11 @@ "description": "Public metadata attached to the source document" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the source document" + "description": "Generated summary of the source document", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -2761,10 +2842,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace to search. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -2876,6 +2957,16 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { results, searchTime } = await client.search(\"user_123\", {\n query: \"gift ideas for a VP promotion after a Tokyo offsite\",\n searchMode: \"hybrid\",\n limit: 5,\n include: { related: true },\n filter: {\n operator: \"and\",\n operands: [\n { field: \"category\", operator: \"eq\", value: \"work\" },\n { field: \"importance\", operator: \"gte\", value: 0.8 },\n ],\n },\n});\nfor (const r of results) console.log(r.similarity.toFixed(2), r.memory ?? r.chunk);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nresponse = client.search(\n \"user_123\",\n query=\"gift ideas for a VP promotion after a Tokyo offsite\",\n search_mode=\"hybrid\",\n limit=5,\n include={\"related\": True},\n filter={\n \"operator\": \"and\",\n \"operands\": [\n {\"field\": \"category\", \"operator\": \"eq\", \"value\": \"work\"},\n {\"field\": \"importance\", \"operator\": \"gte\", \"value\": 0.8},\n ],\n },\n)\nfor r in response.results:\n print(round(r.similarity, 2), r.memory or r.chunk)" + }, { "lang": "bash", "label": "cURL", @@ -3046,10 +3137,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace to search. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -3089,10 +3180,20 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { profile } = await client.profile(\"user_123\");\nconsole.log(profile.static.map((m) => m.memory));\nconsole.log(profile.dynamic.map((m) => m.memory));" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nprofile = client.profile(\"user_123\").profile\nprint([m.memory for m in profile.static])\nprint([m.memory for m in profile.dynamic])" + }, { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/profile\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"filter\": {\n \"field\": \"region\",\n \"operator\": \"eq\",\n \"value\": \"us-west\"\n }\n }'" + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/profile\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{}'" } ] } @@ -3174,25 +3275,30 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace to search. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." } ], "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst buckets = await client.profiles.getBuckets(\"user_123\");\nconsole.log(buckets);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nbuckets = client.profiles.get_buckets(\"user_123\")\nprint(buckets)" + }, { "lang": "bash", "label": "cURL", "source": "curl \"https://api.supermemory.ai/ns/user_123/profile/buckets\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" - }, - { - "lang": "typescript", - "label": "TypeScript SDK", - "source": "import Supermemory from \"supermemory\";\n\nconst client = new Supermemory({\n apiKey: process.env.SUPERMEMORY_API_KEY,\n});\n\nconst res = await fetch(\"https://api.supermemory.ai/ns/user_123/profile/buckets\", {\n headers: {\n Authorization: `Bearer ${process.env.SUPERMEMORY_API_KEY}`,\n },\n});\nconst data = await res.json();\nconsole.log(data);" } ] }, @@ -3302,10 +3408,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace to search. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -3344,7 +3450,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.profiles.setBuckets(\"user_123\", {\n buckets: {\n work: \"Job, team, and current projects\",\n preferences: \"Food, travel, and communication preferences\",\n },\n});" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.profiles.set_buckets(\n \"user_123\",\n buckets={\n \"work\": \"Job, team, and current projects\",\n \"preferences\": \"Food, travel, and communication preferences\",\n },\n)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X PUT \"https://api.supermemory.ai/ns/user_123/profile/buckets\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"buckets\": {\n \"work\": \"Job, team, and current projects\",\n \"preferences\": \"Food, travel, and communication preferences\"\n }\n }'" + } + ] }, "delete": { "operationId": "deleteNsByNamespaceProfileBuckets", @@ -3452,10 +3575,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "The isolated namespace to search. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -3492,7 +3615,24 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.profiles.deleteBuckets(\"user_123\", { buckets: [\"work\"] });" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.profiles.delete_buckets(\"user_123\", buckets=[\"work\"])" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X DELETE \"https://api.supermemory.ai/ns/user_123/profile/buckets\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"buckets\": [\"work\"] }'" + } + ] } }, "/ns/{namespace}/memories": { @@ -3625,10 +3765,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace containing the memories to forget. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -3665,6 +3805,16 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst res = await client.memories.forget(\"user_123\", { ids: [\"mem_1\", \"mem_2\"] });\nconsole.log(res.count, res.errors);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nres = client.memories.forget(\"user_123\", ids=[\"mem_1\", \"mem_2\"])\nprint(res.count, res.errors)" + }, { "lang": "bash", "label": "cURL", @@ -3803,10 +3953,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace containing the memories to forget. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -3842,6 +3992,16 @@ } }, "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\n// Preview first, then run again with dryRun: false\nconst preview = await client.memories.forgetMatching(\"user_123\", {\n query: \"forget everything about the old pricing plan\",\n dryRun: true,\n});\nconsole.log(preview.matches.map((m) => m.memory));" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\n# Preview first, then run again with dry_run=False\npreview = client.memories.forget_matching(\n \"user_123\",\n query=\"forget everything about the old pricing plan\",\n dry_run=True,\n)\nprint([m.memory for m in preview.matches])" + }, { "lang": "bash", "label": "cURL", @@ -3858,10 +4018,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace containing the resources to list. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope resources." @@ -3950,7 +4110,7 @@ "default": { "forgotten": false }, - "description": "Optional extras, matching search's include", + "description": "Optional extras", "example": { "forgotten": true }, @@ -3988,30 +4148,22 @@ "description": "Stable document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Extracted or caller-provided document title" + "description": "Extracted or caller-provided document title", + "type": [ + "string", + "null" + ] }, "type": { "type": "string", "description": "Detected source or content type" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the document, when available" + "description": "Generated summary of the document, when available", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -4022,15 +4174,11 @@ "description": "Public metadata attached to the document" }, "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Original source URL, when the document was ingested from the web" + "description": "Original source URL, when the document was ingested from the web", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -4039,21 +4187,30 @@ "type": "string", "description": "Current extraction and memory-processing status" }, - "createdAt": { + "dreamingStatus": { + "type": "string", + "enum": [ + "dreaming", + "done" + ], + "description": "Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does." + }, + "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the document was created" }, "updatedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp of the latest document update" } }, "required": [ "status", + "dreamingStatus", "createdAt", "updatedAt" ], @@ -4110,7 +4267,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the chunk was created" } }, @@ -4185,13 +4342,13 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when this memory version was created" }, "updatedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp of the latest update to this version" } }, @@ -4310,6 +4467,23 @@ "summary": "List resources", "tags": [ "Content Management" + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst page = await client.list(\"user_123\", \"documents\", {\n page: 1,\n limit: 20,\n sort: \"createdAt\",\n order: \"desc\",\n filter: { field: \"type\", operator: \"eq\", value: \"conversation\" },\n});\nconsole.log(page.documents.length, page.pagination.totalPages);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.list(\n \"user_123\",\n \"documents\",\n page=1,\n limit=20,\n sort=\"createdAt\",\n order=\"desc\",\n filter={\"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\"},\n)\nprint(len(page.documents), page.pagination.total_pages)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/list/documents?page=1&limit=20&sort=createdAt&order=desc\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"filter\": { \"field\": \"type\", \"operator\": \"eq\", \"value\": \"conversation\" } }'" + } ] } }, @@ -4399,7 +4573,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "When url stops working" } }, @@ -4409,26 +4583,18 @@ ] }, "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required." + "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required.", + "type": [ + "string", + "null" + ] }, "account": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Account on the provider side, usually an email" + "description": "Account on the provider side, usually an email", + "type": [ + "string", + "null" + ] }, "capabilities": { "type": "object", @@ -4455,16 +4621,10 @@ "type": "string" }, "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } + "type": [ + "string", + "number", + "boolean" ] } }, @@ -4504,7 +4664,7 @@ "type": "null" } ], - "description": "What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything.", + "description": "What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything.", "example": { "labels": [ { @@ -4543,15 +4703,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -4567,7 +4723,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -4575,7 +4731,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -4618,7 +4774,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the connector was created" }, "lastSuccessfulSyncAt": { @@ -4626,7 +4782,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -4666,15 +4822,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -4690,7 +4842,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -4698,7 +4850,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -4740,13 +4892,9 @@ "type": "string" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": [ + "string", + "null" ] }, "errorCode": { @@ -4795,7 +4943,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ @@ -4918,7 +5066,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "listAll" + "x-speakeasy-name-override": "listAll", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { connectors } = await client.connectors.listAll({ provider: \"notion\", limit: 50 });\nfor (const c of connectors) console.log(c.namespace, c.provider, c.latestRun?.system.status);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.connectors.list_all(provider=\"notion\", limit=50)\nfor c in page.connectors:\n print(c.namespace, c.provider, c.latest_run.system.status if c.latest_run else None)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/connectors?provider=notion&limit=50\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } + ] } }, "/ns/{namespace}/connectors": { @@ -4929,10 +5094,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -5242,7 +5407,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "When url stops working" } }, @@ -5340,7 +5505,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "create" + "x-speakeasy-name-override": "create", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { id, authorization } = await client.connectors.create(\"user_123\", {\n provider: \"notion\",\n redirectUrl: \"https://app.example.com/connected\",\n});\n// OAuth providers return authorization.url to send the user to; config providers return null\nconsole.log(id, authorization?.url, authorization?.expiresAt);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nsetup = client.connectors.create(\n \"user_123\",\n request={\"provider\": \"notion\", \"redirectUrl\": \"https://app.example.com/connected\"},\n)\n# OAuth providers return authorization.url to send the user to; config providers return None\nprint(setup.id, setup.authorization.url if setup.authorization else None)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/connectors\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"provider\": \"notion\", \"redirectUrl\": \"https://app.example.com/connected\" }'" + } + ] }, "get": { "operationId": "getNsByNamespaceConnectors", @@ -5349,10 +5531,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -5439,7 +5621,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "When url stops working" } }, @@ -5449,26 +5631,18 @@ ] }, "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required." + "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required.", + "type": [ + "string", + "null" + ] }, "account": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Account on the provider side, usually an email" + "description": "Account on the provider side, usually an email", + "type": [ + "string", + "null" + ] }, "capabilities": { "type": "object", @@ -5495,16 +5669,10 @@ "type": "string" }, "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } + "type": [ + "string", + "number", + "boolean" ] } }, @@ -5544,7 +5712,7 @@ "type": "null" } ], - "description": "What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything.", + "description": "What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything.", "example": { "labels": [ { @@ -5583,15 +5751,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -5607,7 +5771,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -5615,7 +5779,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -5658,7 +5822,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the connector was created" }, "lastSuccessfulSyncAt": { @@ -5666,7 +5830,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -5706,15 +5870,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -5730,7 +5890,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -5738,7 +5898,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -5780,13 +5940,9 @@ "type": "string" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": [ + "string", + "null" ] }, "errorCode": { @@ -5835,7 +5991,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ @@ -5958,7 +6114,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "list" + "x-speakeasy-name-override": "list", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { connectors } = await client.connectors.list(\"user_123\");\nfor (const c of connectors) console.log(c.id, c.provider, c.documentCount);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.connectors.list(\"user_123\")\nfor c in page.connectors:\n print(c.id, c.provider, c.document_count)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/ns/user_123/connectors\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } + ] } }, "/ns/{namespace}/connectors/{id}": { @@ -5969,10 +6142,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -6051,7 +6224,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "When url stops working" } }, @@ -6061,26 +6234,18 @@ ] }, "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required." + "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required.", + "type": [ + "string", + "null" + ] }, "account": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Account on the provider side, usually an email" + "description": "Account on the provider side, usually an email", + "type": [ + "string", + "null" + ] }, "capabilities": { "type": "object", @@ -6107,16 +6272,10 @@ "type": "string" }, "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } + "type": [ + "string", + "number", + "boolean" ] } }, @@ -6156,7 +6315,7 @@ "type": "null" } ], - "description": "What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything.", + "description": "What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything.", "example": { "labels": [ { @@ -6195,15 +6354,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -6219,7 +6374,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -6227,7 +6382,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -6270,7 +6425,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the connector was created" }, "lastSuccessfulSyncAt": { @@ -6278,7 +6433,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -6318,15 +6473,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -6342,7 +6493,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -6350,7 +6501,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -6392,13 +6543,9 @@ "type": "string" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": [ + "string", + "null" ] }, "errorCode": { @@ -6447,7 +6594,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ @@ -6542,7 +6689,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "get" + "x-speakeasy-name-override": "get", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst connector = await client.connectors.get(\"user_123\", \"conn_abc123\", {\n include: [\"syncs\", \"picker\"],\n});\nconsole.log(connector.latestRun?.system.status, connector.syncs?.length, connector.picker?.url);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nconnector = client.connectors.get(\"user_123\", \"conn_abc123\", include=[\"syncs\", \"picker\"])\nprint(connector.latest_run, connector.syncs, connector.picker)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/ns/user_123/connectors/conn_abc123?include=syncs,picker\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } + ] }, "patch": { "operationId": "patchNsByNamespaceConnectorsById", @@ -6551,10 +6715,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -6669,7 +6833,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "When url stops working" } }, @@ -6679,26 +6843,18 @@ ] }, "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required." + "description": "Namespace the connector syncs into. Null only for connectors created before namespaces were required.", + "type": [ + "string", + "null" + ] }, "account": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Account on the provider side, usually an email" + "description": "Account on the provider side, usually an email", + "type": [ + "string", + "null" + ] }, "capabilities": { "type": "object", @@ -6725,16 +6881,10 @@ "type": "string" }, "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } + "type": [ + "string", + "number", + "boolean" ] } }, @@ -6774,7 +6924,7 @@ "type": "null" } ], - "description": "What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything.", + "description": "What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything.", "example": { "labels": [ { @@ -6813,15 +6963,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -6837,7 +6983,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -6845,7 +6991,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -6888,7 +7034,7 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the connector was created" }, "lastSuccessfulSyncAt": { @@ -6896,7 +7042,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -6936,15 +7082,11 @@ ] }, "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Customer-safe error message" + "description": "Customer-safe error message", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -6960,7 +7102,7 @@ "startedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when the run started" }, "completedAt": { @@ -6968,7 +7110,7 @@ { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" @@ -7010,13 +7152,9 @@ "type": "string" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": [ + "string", + "null" ] }, "errorCode": { @@ -7065,7 +7203,7 @@ "expiresAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ @@ -7160,7 +7298,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "update" + "x-speakeasy-name-override": "update", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.connectors.update(\"user_123\", \"conn_abc123\", {\n documentLimit: 500,\n selection: { repos: [\"123456789\"] }, // provider-specific selection\n});" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.connectors.update(\n \"user_123\",\n \"conn_abc123\",\n document_limit=500,\n selection={\"repos\": [\"123456789\"]}, # provider-specific selection\n)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X PATCH \"https://api.supermemory.ai/ns/user_123/connectors/conn_abc123\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"documentLimit\": 500, \"selection\": { \"repos\": [\"123456789\"] } }'" + } + ] }, "delete": { "operationId": "deleteNsByNamespaceConnectorsById", @@ -7169,10 +7324,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -7285,7 +7440,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "delete" + "x-speakeasy-name-override": "delete", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.connectors.delete(\"user_123\", \"conn_abc123\", { deleteDocuments: true });" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.connectors.delete(\"user_123\", \"conn_abc123\", delete_documents=True)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X DELETE \"https://api.supermemory.ai/ns/user_123/connectors/conn_abc123?deleteDocuments=true\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } + ] } }, "/ns/{namespace}/connectors/{id}/sync": { @@ -7296,10 +7468,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -7435,7 +7607,24 @@ "Connectors" ], "x-speakeasy-group": "connectors", - "x-speakeasy-name-override": "sync" + "x-speakeasy-name-override": "sync", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst run = await client.connectors.sync(\"user_123\", \"conn_abc123\");\nconsole.log(run.status); // \"queued\"; 409 if a sync is already running" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nrun = client.connectors.sync(\"user_123\", \"conn_abc123\")\nprint(run.status) # \"queued\"; 409 if a sync is already running" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/connectors/conn_abc123/sync\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } + ] } }, "/namespaces": { @@ -7475,15 +7664,11 @@ "description": "Number of current, recallable memories in the namespace" }, "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable purpose or scope of the namespace" + "description": "Human-readable purpose or scope of the namespace", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -7633,6 +7818,23 @@ }, "description": "Maximum namespaces to return per page" } + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { namespaces } = await client.namespaces.list({ page: 1, limit: 50 });\nconsole.log(namespaces.map((ns) => ns.namespace));" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.namespaces.list(page=1, limit=50)\nprint([ns.namespace for ns in page.namespaces])" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/namespaces?page=1&limit=50\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } ] } }, @@ -7673,15 +7875,11 @@ "description": "Number of current, recallable memories in the namespace" }, "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable purpose or scope of the namespace" + "description": "Human-readable purpose or scope of the namespace", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -7831,6 +8029,23 @@ }, "description": "Maximum namespaces to return per page" } + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst { namespaces, pagination } = await client.namespaces.list({ page: 1, limit: 50 });\nfor (const ns of namespaces) console.log(ns.namespace, ns.documentCount, ns.memoryCount);\nconsole.log(pagination.totalPages);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\npage = client.namespaces.list(page=1, limit=50)\nfor ns in page.namespaces:\n print(ns.namespace, ns.document_count, ns.memory_count)\nprint(page.pagination.total_pages)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/ns?page=1&limit=50\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } ] } }, @@ -7850,15 +8065,11 @@ "description": "Namespace identifier used in API paths" }, "supportingContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Background that helps Supermemory interpret documents and form better memories in this namespace" + "description": "Background that helps Supermemory interpret documents and form better memories in this namespace", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -7958,14 +8169,31 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." } + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst ns = await client.namespaces.get(\"user_123\");\nconsole.log(ns.supportingContext, ns.system.createdAt);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nns = client.namespaces.get(\"user_123\")\nprint(ns.supporting_context, ns.system.created_at)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/ns/user_123\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } ] }, "patch": { @@ -7975,10 +8203,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -8023,15 +8251,11 @@ "description": "Namespace identifier used in API paths" }, "supportingContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Background that helps Supermemory interpret documents and form better memories in this namespace" + "description": "Background that helps Supermemory interpret documents and form better memories in this namespace", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -8125,6 +8349,23 @@ "summary": "Update namespace settings", "tags": [ "Namespaces" + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.namespaces.update(\"user_123\", {\n supportingContext: \"A paying customer on the Pro plan; prefers concise answers.\",\n});" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.namespaces.update(\n \"user_123\",\n supporting_context=\"A paying customer on the Pro plan; prefers concise answers.\",\n)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X PATCH \"https://api.supermemory.ai/ns/user_123\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"supportingContext\": \"A paying customer on the Pro plan; prefers concise answers.\" }'" + } ] }, "delete": { @@ -8314,10 +8555,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace identifier. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents and memories." @@ -8333,6 +8574,23 @@ }, "description": "Destination namespace that should receive this namespace's content before deletion. Omit to permanently delete the content." } + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\n// Move everything into another namespace instead of deleting: add { moveTo: \"project_main\" }\nconst res = await client.namespaces.delete(\"project_old\");\nconsole.log(res.status); // \"deleted\", or \"queued\" when moving" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\n# Move everything into another namespace instead of deleting: add move_to=\"project_main\"\nres = client.namespaces.delete(\"project_old\")\nprint(res.status) # \"deleted\", or \"queued\" when moving" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X DELETE \"https://api.supermemory.ai/ns/project_old?moveTo=project_main\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } ] } }, @@ -8348,15 +8606,11 @@ "type": "object", "properties": { "organizationalContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Shared background that helps Supermemory interpret content consistently across every namespace" + "description": "Shared background that helps Supermemory interpret content consistently across every namespace", + "type": [ + "string", + "null" + ] }, "namespaceCount": { "type": "integer", @@ -8408,6 +8662,23 @@ "summary": "Get organization settings", "tags": [ "Organization" + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst org = await client.organization.get();\nconsole.log(org.organizationalContext, org.namespaceCount);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\norg = client.organization.get()\nprint(org.organizational_context, org.namespace_count)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/organization\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + } ] }, "patch": { @@ -8450,15 +8721,11 @@ "type": "object", "properties": { "organizationalContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Shared background that helps Supermemory interpret content consistently across every namespace" + "description": "Shared background that helps Supermemory interpret content consistently across every namespace", + "type": [ + "string", + "null" + ] }, "namespaceCount": { "type": "integer", @@ -8527,13 +8794,30 @@ "summary": "Update organization settings", "tags": [ "Organization" + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nawait client.organization.update({\n organizationalContext: \"Acme sells billing software to dental clinics.\",\n});" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nclient.organization.update(\n organizational_context=\"Acme sells billing software to dental clinics.\",\n)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl -X PATCH \"https://api.supermemory.ai/organization\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"organizationalContext\": \"Acme sells billing software to dental clinics.\" }'" + } ] } }, "/ns/{namespace}/memories/{id}": { "get": { "operationId": "getNsByNamespaceMemoriesById", - "description": "Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document.", + "description": "Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document.", "responses": { "200": { "content": { @@ -8585,13 +8869,13 @@ "createdAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp when this memory version was created" }, "updatedAt": { "type": "string", "format": "date-time", - "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", "description": "ISO 8601 timestamp of the latest update to this version" } }, @@ -8629,13 +8913,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -8672,26 +8952,18 @@ "description": "Source document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source document title" + "description": "Source document title", + "type": [ + "string", + "null" + ] }, "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Detected source or content type" + "description": "Detected source or content type", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -8702,15 +8974,11 @@ "description": "Public metadata attached to the source document" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the source document" + "description": "Generated summary of the source document", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -8749,7 +9017,7 @@ "system" ] }, - "description": "Earlier versions this memory updates, nearest first" + "description": "Earlier versions this memory updates" }, "children": { "type": "array", @@ -8771,13 +9039,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -8814,26 +9078,18 @@ "description": "Source document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source document title" + "description": "Source document title", + "type": [ + "string", + "null" + ] }, "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Detected source or content type" + "description": "Detected source or content type", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -8844,15 +9100,11 @@ "description": "Public metadata attached to the source document" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the source document" + "description": "Generated summary of the source document", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -8891,7 +9143,7 @@ "system" ] }, - "description": "Newer versions that update this memory, nearest first" + "description": "Newer versions that update this memory" }, "siblings": { "type": "array", @@ -8913,13 +9165,9 @@ }, "version": { "description": "Version number within the related memory's history", - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "type": [ + "number", + "null" ] }, "memory": { @@ -8956,26 +9204,18 @@ "description": "Source document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source document title" + "description": "Source document title", + "type": [ + "string", + "null" + ] }, "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Detected source or content type" + "description": "Detected source or content type", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -8986,15 +9226,11 @@ "description": "Public metadata attached to the source document" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the source document" + "description": "Generated summary of the source document", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -9033,7 +9269,7 @@ "system" ] }, - "description": "Memories connected by extends or derives, nearest first" + "description": "Memories connected by extends or derives" } }, "required": [ @@ -9051,26 +9287,18 @@ "description": "Source document identifier" }, "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source document title" + "description": "Source document title", + "type": [ + "string", + "null" + ] }, "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Detected source or content type" + "description": "Detected source or content type", + "type": [ + "string", + "null" + ] }, "metadata": { "type": "object", @@ -9081,15 +9309,11 @@ "description": "Public metadata attached to the source document" }, "summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Generated summary of the source document" + "description": "Generated summary of the source document", + "type": [ + "string", + "null" + ] }, "system": { "type": "object", @@ -9205,10 +9429,10 @@ "in": "path", "name": "namespace", "schema": { + "example": "user_alex", "type": "string", "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "pattern": "^[a-zA-Z0-9_:-]+$" }, "required": true, "description": "Namespace containing the memories to forget. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope memories." @@ -9250,10 +9474,221 @@ "minimum": 1, "maximum": 100 }, - "description": "Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many." + "description": "Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links." + } + ], + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript SDK", + "source": "import { Supermemory } from \"supermemory\";\n\nconst client = new Supermemory(); // reads SUPERMEMORY_API_KEY\n\nconst memory = await client.memories.get(\"user_123\", \"mem_abc123\", {\n include: [\"related\", \"documents\"],\n});\nconsole.log(memory.memory, memory.isLatest);" + }, + { + "lang": "python", + "label": "Python SDK", + "source": "from supermemory import Supermemory\n\nclient = Supermemory() # reads SUPERMEMORY_API_KEY\n\nmemory = client.memories.get(\"user_123\", \"mem_abc123\", include=[\"related\", \"documents\"])\nprint(memory.memory, memory.is_latest)" + }, + { + "lang": "bash", + "label": "cURL", + "source": "curl \"https://api.supermemory.ai/ns/user_123/memories/mem_abc123?include=related,documents\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" } ] } + }, + "/feedback": { + "post": { + "operationId": "postFeedback", + "summary": "Send feedback", + "description": "Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up.\n\nAuthentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota.", + "tags": [ + "Feedback" + ], + "security": [ + {}, + { + "bearerAuth": [] + } + ], + "x-codeSamples": [ + { + "lang": "bash", + "label": "cURL", + "source": "curl -X POST \"https://api.supermemory.ai/feedback\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"type\": \"bug\",\n \"title\": \"Search misses documents added in the last minute\",\n \"description\": \"Documents report status done but do not appear in /v4/search for about a minute.\",\n \"endpoint\": \"POST /v4/search\",\n \"client\": \"my-agent/1.0\"\n }'" + } + ], + "responses": { + "202": { + "description": "Feedback received", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Feedback reference", + "example": "fb_k3m9q2x7wd" + }, + "remaining": { + "type": "number", + "description": "Submissions left for this caller until 00:00 UTC", + "example": 2 + } + }, + "required": [ + "id", + "remaining" + ] + } + } + } + }, + "400": { + "description": "Invalid request body", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse" + }, + { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + ] + } + } + } + }, + "401": { + "description": "An API key is invalid or required for this request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "The API key cannot access this endpoint or namespace", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Daily limit reached. The Retry-After header gives the seconds until it resets.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Slack rejected the feedback or delivery could not be confirmed. Only confirmed rejections are refunded; do not automatically retry uncertain deliveries.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Feedback is not available on this deployment", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bug", + "feature_request", + "docs", + "other" + ], + "description": "Kind of feedback", + "example": "bug" + }, + "title": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "One-line summary", + "example": "Search returns no results for documents still in indexing" + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 5000, + "description": "What happened, with enough detail for an engineer to act on it", + "example": "Documents added less than a minute ago are missing from /v4/search results even though GET /v3/documents/{id} reports status done." + }, + "endpoint": { + "description": "API operation the feedback is about", + "example": "POST /v4/search", + "type": "string", + "maxLength": 200 + }, + "requestId": { + "description": "Request ID of a failing call, if there is one", + "type": "string", + "maxLength": 200 + }, + "expected": { + "description": "What you expected to happen", + "type": "string", + "maxLength": 2000 + }, + "actual": { + "description": "What actually happened", + "type": "string", + "maxLength": 2000 + }, + "client": { + "description": "Agent, tool or SDK sending the feedback", + "example": "claude-code/2.1, supermemory-sdk-ts/5.0.0", + "type": "string", + "maxLength": 200 + }, + "contactEmail": { + "description": "Where to reach you about this feedback", + "type": "string", + "maxLength": 320, + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + } + }, + "required": [ + "type", + "title", + "description" + ] + } + } + } + } + } } } } diff --git a/pyproject.toml b/pyproject.toml index 808b0526..81e13413 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "5.0.0" +version = "5.0.1" description = "The official Python library for the Supermemory API" readme = "README.md" license = "Apache-2.0" diff --git a/reference.md b/reference.md index adcaa31d..42406f42 100644 --- a/reference.md +++ b/reference.md @@ -476,7 +476,7 @@ client.list(
-**include:** `typing.Optional[ListRequestInclude]` — Optional extras, matching search's include +**include:** `typing.Optional[ListRequestInclude]` — Optional extras
@@ -1797,7 +1797,7 @@ client.memories.forget_matching(
-Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document. +Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document.
@@ -1863,7 +1863,7 @@ client.memories.get(
-**related_limit:** `typing.Optional[int]` — Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many. +**related_limit:** `typing.Optional[int]` — Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links.
@@ -2973,3 +2973,145 @@ client.organization.update( +## Feedback +
client.feedback.post_feedback(...) -> PostFeedbackResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up. + +Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from supermemory import Supermemory +from supermemory.environment import SupermemoryEnvironment + +client = Supermemory( + api_key="", + environment=SupermemoryEnvironment.DEFAULT, +) + +client.feedback.post_feedback( + type="bug", + title="Search returns no results for documents still in indexing", + description="Documents added less than a minute ago are missing from /v4/search results even though GET /v3/documents/{id} reports status done.", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**type:** `PostFeedbackRequestType` — Kind of feedback + +
+
+ +
+
+ +**title:** `str` — One-line summary + +
+
+ +
+
+ +**description:** `str` — What happened, with enough detail for an engineer to act on it + +
+
+ +
+
+ +**endpoint:** `typing.Optional[str]` — API operation the feedback is about + +
+
+ +
+
+ +**request_id:** `typing.Optional[str]` — Request ID of a failing call, if there is one + +
+
+ +
+
+ +**expected:** `typing.Optional[str]` — What you expected to happen + +
+
+ +
+
+ +**actual:** `typing.Optional[str]` — What actually happened + +
+
+ +
+
+ +**client:** `typing.Optional[str]` — Agent, tool or SDK sending the feedback + +
+
+ +
+
+ +**contact_email:** `typing.Optional[str]` — Where to reach you about this feedback + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ diff --git a/src/supermemory/__init__.py b/src/supermemory/__init__.py index 77a5cffa..109c4c94 100644 --- a/src/supermemory/__init__.py +++ b/src/supermemory/__init__.py @@ -60,9 +60,11 @@ DocumentInput, DocumentListItem, DocumentListItemSystem, + DocumentListItemSystemDreamingStatus, DocumentRef, DocumentRefStatus, DocumentSystem, + DocumentSystemDreamingStatus, DocumentSystemStatus, DreamingMode, ErrorResponse, @@ -150,14 +152,17 @@ WebCrawlerConfig, ) from .errors import ( + BadGatewayError, ForbiddenError, PaymentRequiredError, ServiceUnavailableError, + TooManyRequestsError, UnauthorizedError, ) - from . import connectors, documents, memories, namespaces, organization, profiles + from . import connectors, documents, feedback, memories, namespaces, organization, profiles from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient from .environment import SupermemoryEnvironment + from .feedback import PostFeedbackRequestType, PostFeedbackResponse, PostFeedbackResponseParams from .requests import ( BadRequestErrorBodyParams, BatchAddItemResultParams, @@ -276,6 +281,7 @@ WebCrawlerConfigParams, ) _dynamic_imports: typing.Dict[str, str] = { + "BadGatewayError": ".errors", "BadRequestErrorBody": ".types", "BadRequestErrorBodyParams": ".requests", "BatchAddItemResult": ".types", @@ -374,12 +380,14 @@ "DocumentListItem": ".types", "DocumentListItemParams": ".requests", "DocumentListItemSystem": ".types", + "DocumentListItemSystemDreamingStatus": ".types", "DocumentListItemSystemParams": ".requests", "DocumentParams": ".requests", "DocumentRef": ".types", "DocumentRefParams": ".requests", "DocumentRefStatus": ".types", "DocumentSystem": ".types", + "DocumentSystemDreamingStatus": ".types", "DocumentSystemParams": ".requests", "DocumentSystemStatus": ".types", "DreamingMode": ".types", @@ -494,6 +502,9 @@ "Pagination": ".types", "PaginationParams": ".requests", "PaymentRequiredError": ".errors", + "PostFeedbackRequestType": ".feedback", + "PostFeedbackResponse": ".feedback", + "PostFeedbackResponseParams": ".feedback", "Profile": ".types", "ProfileBuckets": ".types", "ProfileBucketsParams": ".requests", @@ -530,6 +541,7 @@ "SortOrder": ".types", "SupermemoryEnvironment": ".environment", "TaskType": ".types", + "TooManyRequestsError": ".errors", "UnauthorizedError": ".errors", "ValidationErrorResponse": ".types", "ValidationErrorResponseErrorItem": ".types", @@ -541,6 +553,7 @@ "WebCrawlerConfigParams": ".requests", "connectors": ".connectors", "documents": ".documents", + "feedback": ".feedback", "memories": ".memories", "namespaces": ".namespaces", "organization": ".organization", @@ -571,6 +584,7 @@ def __dir__(): __all__ = [ "AsyncSupermemory", + "BadGatewayError", "BadRequestError", "BadRequestErrorBody", "BadRequestErrorBodyParams", @@ -671,12 +685,14 @@ def __dir__(): "DocumentListItem", "DocumentListItemParams", "DocumentListItemSystem", + "DocumentListItemSystemDreamingStatus", "DocumentListItemSystemParams", "DocumentParams", "DocumentRef", "DocumentRefParams", "DocumentRefStatus", "DocumentSystem", + "DocumentSystemDreamingStatus", "DocumentSystemParams", "DocumentSystemStatus", "DreamingMode", @@ -793,6 +809,9 @@ def __dir__(): "Pagination", "PaginationParams", "PaymentRequiredError", + "PostFeedbackRequestType", + "PostFeedbackResponse", + "PostFeedbackResponseParams", "Profile", "ProfileBuckets", "ProfileBucketsParams", @@ -830,6 +849,7 @@ def __dir__(): "Supermemory", "SupermemoryEnvironment", "TaskType", + "TooManyRequestsError", "UnauthorizedError", "ValidationErrorResponse", "ValidationErrorResponseErrorItem", @@ -841,6 +861,7 @@ def __dir__(): "WebCrawlerConfigParams", "connectors", "documents", + "feedback", "memories", "namespaces", "organization", diff --git a/src/supermemory/client.py b/src/supermemory/client.py index 4f1cbac0..b35a10ed 100644 --- a/src/supermemory/client.py +++ b/src/supermemory/client.py @@ -33,6 +33,7 @@ if typing.TYPE_CHECKING: from .connectors.client import AsyncConnectorsClient, ConnectorsClient from .documents.client import AsyncDocumentsClient, DocumentsClient + from .feedback.client import AsyncFeedbackClient, FeedbackClient from .memories.client import AsyncMemoriesClient, MemoriesClient from .namespaces.client import AsyncNamespacesClient, NamespacesClient from .organization.client import AsyncOrganizationClient, OrganizationClient @@ -136,6 +137,7 @@ def __init__( self._connectors: typing.Optional[ConnectorsClient] = None self._namespaces: typing.Optional[NamespacesClient] = None self._organization: typing.Optional[OrganizationClient] = None + self._feedback: typing.Optional[FeedbackClient] = None @property def with_raw_response(self) -> RawSupermemory: @@ -408,7 +410,7 @@ def list( Type-safe metadata conditions applied before pagination include : typing.Optional[ListRequestIncludeParams] - Optional extras, matching search's include + Optional extras request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -493,6 +495,14 @@ def organization(self): self._organization = OrganizationClient(client_wrapper=self._client_wrapper) return self._organization + @property + def feedback(self): + if self._feedback is None: + from .feedback.client import FeedbackClient # noqa: E402 + + self._feedback = FeedbackClient(client_wrapper=self._client_wrapper) + return self._feedback + def _make_default_async_client( timeout: typing.Optional[float], @@ -610,6 +620,7 @@ def __init__( self._connectors: typing.Optional[AsyncConnectorsClient] = None self._namespaces: typing.Optional[AsyncNamespacesClient] = None self._organization: typing.Optional[AsyncOrganizationClient] = None + self._feedback: typing.Optional[AsyncFeedbackClient] = None @property def with_raw_response(self) -> AsyncRawSupermemory: @@ -908,7 +919,7 @@ async def list( Type-safe metadata conditions applied before pagination include : typing.Optional[ListRequestIncludeParams] - Optional extras, matching search's include + Optional extras request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1001,6 +1012,14 @@ def organization(self): self._organization = AsyncOrganizationClient(client_wrapper=self._client_wrapper) return self._organization + @property + def feedback(self): + if self._feedback is None: + from .feedback.client import AsyncFeedbackClient # noqa: E402 + + self._feedback = AsyncFeedbackClient(client_wrapper=self._client_wrapper) + return self._feedback + def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SupermemoryEnvironment) -> str: if base_url is not None: diff --git a/src/supermemory/core/client_wrapper.py b/src/supermemory/core/client_wrapper.py index d2cf02d6..ce88bffa 100644 --- a/src/supermemory/core/client_wrapper.py +++ b/src/supermemory/core/client_wrapper.py @@ -33,7 +33,7 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "supermemory/5.0.0", + "User-Agent": "supermemory/5.0.1", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", diff --git a/src/supermemory/errors/__init__.py b/src/supermemory/errors/__init__.py index 0cf3b941..0245102c 100644 --- a/src/supermemory/errors/__init__.py +++ b/src/supermemory/errors/__init__.py @@ -6,6 +6,7 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .bad_gateway_error import BadGatewayError from .bad_request_error import BadRequestError from .conflict_error import ConflictError from .forbidden_error import ForbiddenError @@ -13,8 +14,10 @@ from .not_found_error import NotFoundError from .payment_required_error import PaymentRequiredError from .service_unavailable_error import ServiceUnavailableError + from .too_many_requests_error import TooManyRequestsError from .unauthorized_error import UnauthorizedError _dynamic_imports: typing.Dict[str, str] = { + "BadGatewayError": ".bad_gateway_error", "BadRequestError": ".bad_request_error", "ConflictError": ".conflict_error", "ForbiddenError": ".forbidden_error", @@ -22,6 +25,7 @@ "NotFoundError": ".not_found_error", "PaymentRequiredError": ".payment_required_error", "ServiceUnavailableError": ".service_unavailable_error", + "TooManyRequestsError": ".too_many_requests_error", "UnauthorizedError": ".unauthorized_error", } @@ -48,6 +52,7 @@ def __dir__(): __all__ = [ + "BadGatewayError", "BadRequestError", "ConflictError", "ForbiddenError", @@ -55,5 +60,6 @@ def __dir__(): "NotFoundError", "PaymentRequiredError", "ServiceUnavailableError", + "TooManyRequestsError", "UnauthorizedError", ] diff --git a/src/supermemory/errors/bad_gateway_error.py b/src/supermemory/errors/bad_gateway_error.py new file mode 100644 index 00000000..ee036fdf --- /dev/null +++ b/src/supermemory/errors/bad_gateway_error.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.api_error import ApiError +from ..types.error_response import ErrorResponse + + +class BadGatewayError(ApiError): + def __init__(self, body: ErrorResponse, headers: typing.Optional[typing.Dict[str, str]] = None): + super().__init__(status_code=502, headers=headers, body=body) diff --git a/src/supermemory/errors/too_many_requests_error.py b/src/supermemory/errors/too_many_requests_error.py new file mode 100644 index 00000000..befc9d63 --- /dev/null +++ b/src/supermemory/errors/too_many_requests_error.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.api_error import ApiError +from ..types.error_response import ErrorResponse + + +class TooManyRequestsError(ApiError): + def __init__(self, body: ErrorResponse, headers: typing.Optional[typing.Dict[str, str]] = None): + super().__init__(status_code=429, headers=headers, body=body) diff --git a/src/supermemory/feedback/__init__.py b/src/supermemory/feedback/__init__.py new file mode 100644 index 00000000..bf67c8d2 --- /dev/null +++ b/src/supermemory/feedback/__init__.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import PostFeedbackRequestType, PostFeedbackResponse + from .requests import PostFeedbackResponseParams +_dynamic_imports: typing.Dict[str, str] = { + "PostFeedbackRequestType": ".types", + "PostFeedbackResponse": ".types", + "PostFeedbackResponseParams": ".requests", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["PostFeedbackRequestType", "PostFeedbackResponse", "PostFeedbackResponseParams"] diff --git a/src/supermemory/feedback/client.py b/src/supermemory/feedback/client.py new file mode 100644 index 00000000..712c10f0 --- /dev/null +++ b/src/supermemory/feedback/client.py @@ -0,0 +1,230 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx + +from supermemory._types import NOT_GIVEN, NotGiven + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from .raw_client import AsyncRawFeedbackClient, RawFeedbackClient +from .types.post_feedback_request_type import PostFeedbackRequestType +from .types.post_feedback_response import PostFeedbackResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class FeedbackClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawFeedbackClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawFeedbackClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawFeedbackClient + """ + return self._raw_client + + def post_feedback( + self, + *, + type: PostFeedbackRequestType, + title: str, + description: str, + endpoint: typing.Optional[str] = OMIT, + request_id: typing.Optional[str] = OMIT, + expected: typing.Optional[str] = OMIT, + actual: typing.Optional[str] = OMIT, + client: typing.Optional[str] = OMIT, + contact_email: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + extra_headers: typing.Optional[typing.Mapping[str, str]] = None, + extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, + extra_body: typing.Optional[typing.Mapping[str, typing.Any]] = None, + timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, + ) -> PostFeedbackResponse: + """ + Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up. + + Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota. + + Parameters + ---------- + type : PostFeedbackRequestType + Kind of feedback + + title : str + One-line summary + + description : str + What happened, with enough detail for an engineer to act on it + + endpoint : typing.Optional[str] + API operation the feedback is about + + request_id : typing.Optional[str] + Request ID of a failing call, if there is one + + expected : typing.Optional[str] + What you expected to happen + + actual : typing.Optional[str] + What actually happened + + client : typing.Optional[str] + Agent, tool or SDK sending the feedback + + contact_email : typing.Optional[str] + Where to reach you about this feedback + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PostFeedbackResponse + Feedback received + + Examples + -------- + from supermemory import Supermemory + + client = Supermemory( + api_key="YOUR_API_KEY", + ) + client.feedback.post_feedback( + type="bug", + title="Search returns no results for documents still in indexing", + description="Documents added less than a minute ago are missing from /v4/search results even though GET /v3/documents/{id} reports status done.", + ) + """ + _response = self._raw_client.post_feedback( + type=type, + title=title, + description=description, + endpoint=endpoint, + request_id=request_id, + expected=expected, + actual=actual, + client=client, + contact_email=contact_email, + request_options=request_options, + ) + return _response.data + + +class AsyncFeedbackClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawFeedbackClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawFeedbackClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawFeedbackClient + """ + return self._raw_client + + async def post_feedback( + self, + *, + type: PostFeedbackRequestType, + title: str, + description: str, + endpoint: typing.Optional[str] = OMIT, + request_id: typing.Optional[str] = OMIT, + expected: typing.Optional[str] = OMIT, + actual: typing.Optional[str] = OMIT, + client: typing.Optional[str] = OMIT, + contact_email: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + extra_headers: typing.Optional[typing.Mapping[str, str]] = None, + extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, + extra_body: typing.Optional[typing.Mapping[str, typing.Any]] = None, + timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, + ) -> PostFeedbackResponse: + """ + Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up. + + Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota. + + Parameters + ---------- + type : PostFeedbackRequestType + Kind of feedback + + title : str + One-line summary + + description : str + What happened, with enough detail for an engineer to act on it + + endpoint : typing.Optional[str] + API operation the feedback is about + + request_id : typing.Optional[str] + Request ID of a failing call, if there is one + + expected : typing.Optional[str] + What you expected to happen + + actual : typing.Optional[str] + What actually happened + + client : typing.Optional[str] + Agent, tool or SDK sending the feedback + + contact_email : typing.Optional[str] + Where to reach you about this feedback + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PostFeedbackResponse + Feedback received + + Examples + -------- + import asyncio + + from supermemory import AsyncSupermemory + + client = AsyncSupermemory( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.feedback.post_feedback( + type="bug", + title="Search returns no results for documents still in indexing", + description="Documents added less than a minute ago are missing from /v4/search results even though GET /v3/documents/{id} reports status done.", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.post_feedback( + type=type, + title=title, + description=description, + endpoint=endpoint, + request_id=request_id, + expected=expected, + actual=actual, + client=client, + contact_email=contact_email, + request_options=request_options, + ) + return _response.data diff --git a/src/supermemory/feedback/raw_client.py b/src/supermemory/feedback/raw_client.py new file mode 100644 index 00000000..a58c9d2b --- /dev/null +++ b/src/supermemory/feedback/raw_client.py @@ -0,0 +1,369 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx + +from supermemory._types import NOT_GIVEN, NotGiven +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.parse_error import ParsingError +from ..core.request_options import RequestOptions +from ..core.unchecked_base_model import construct_type +from ..errors.bad_gateway_error import BadGatewayError +from ..errors.bad_request_error import BadRequestError +from ..errors.forbidden_error import ForbiddenError +from ..errors.service_unavailable_error import ServiceUnavailableError +from ..errors.too_many_requests_error import TooManyRequestsError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.bad_request_error_body import BadRequestErrorBody +from ..types.error_response import ErrorResponse +from .types.post_feedback_request_type import PostFeedbackRequestType +from .types.post_feedback_response import PostFeedbackResponse +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawFeedbackClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def post_feedback( + self, + *, + type: PostFeedbackRequestType, + title: str, + description: str, + endpoint: typing.Optional[str] = OMIT, + request_id: typing.Optional[str] = OMIT, + expected: typing.Optional[str] = OMIT, + actual: typing.Optional[str] = OMIT, + client: typing.Optional[str] = OMIT, + contact_email: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + extra_headers: typing.Optional[typing.Mapping[str, str]] = None, + extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, + extra_body: typing.Optional[typing.Mapping[str, typing.Any]] = None, + timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, + ) -> HttpResponse[PostFeedbackResponse]: + """ + Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up. + + Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota. + + Parameters + ---------- + type : PostFeedbackRequestType + Kind of feedback + + title : str + One-line summary + + description : str + What happened, with enough detail for an engineer to act on it + + endpoint : typing.Optional[str] + API operation the feedback is about + + request_id : typing.Optional[str] + Request ID of a failing call, if there is one + + expected : typing.Optional[str] + What you expected to happen + + actual : typing.Optional[str] + What actually happened + + client : typing.Optional[str] + Agent, tool or SDK sending the feedback + + contact_email : typing.Optional[str] + Where to reach you about this feedback + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PostFeedbackResponse] + Feedback received + """ + _response = self._client_wrapper.httpx_client.request( + "feedback", + method="POST", + json={ + "type": type, + "title": title, + "description": description, + "endpoint": endpoint, + "requestId": request_id, + "expected": expected, + "actual": actual, + "client": client, + "contactEmail": contact_email, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PostFeedbackResponse, + construct_type( + type_=PostFeedbackResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + BadRequestErrorBody, + construct_type( + type_=BadRequestErrorBody, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 502: + raise BadGatewayError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawFeedbackClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def post_feedback( + self, + *, + type: PostFeedbackRequestType, + title: str, + description: str, + endpoint: typing.Optional[str] = OMIT, + request_id: typing.Optional[str] = OMIT, + expected: typing.Optional[str] = OMIT, + actual: typing.Optional[str] = OMIT, + client: typing.Optional[str] = OMIT, + contact_email: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + extra_headers: typing.Optional[typing.Mapping[str, str]] = None, + extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, + extra_body: typing.Optional[typing.Mapping[str, typing.Any]] = None, + timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, + ) -> AsyncHttpResponse[PostFeedbackResponse]: + """ + Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up. + + Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota. + + Parameters + ---------- + type : PostFeedbackRequestType + Kind of feedback + + title : str + One-line summary + + description : str + What happened, with enough detail for an engineer to act on it + + endpoint : typing.Optional[str] + API operation the feedback is about + + request_id : typing.Optional[str] + Request ID of a failing call, if there is one + + expected : typing.Optional[str] + What you expected to happen + + actual : typing.Optional[str] + What actually happened + + client : typing.Optional[str] + Agent, tool or SDK sending the feedback + + contact_email : typing.Optional[str] + Where to reach you about this feedback + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PostFeedbackResponse] + Feedback received + """ + _response = await self._client_wrapper.httpx_client.request( + "feedback", + method="POST", + json={ + "type": type, + "title": title, + "description": description, + "endpoint": endpoint, + "requestId": request_id, + "expected": expected, + "actual": actual, + "client": client, + "contactEmail": contact_email, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PostFeedbackResponse, + construct_type( + type_=PostFeedbackResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + BadRequestErrorBody, + construct_type( + type_=BadRequestErrorBody, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 502: + raise BadGatewayError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/supermemory/feedback/requests/__init__.py b/src/supermemory/feedback/requests/__init__.py new file mode 100644 index 00000000..6e031b16 --- /dev/null +++ b/src/supermemory/feedback/requests/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .post_feedback_response import PostFeedbackResponseParams +_dynamic_imports: typing.Dict[str, str] = {"PostFeedbackResponseParams": ".post_feedback_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["PostFeedbackResponseParams"] diff --git a/src/supermemory/feedback/requests/post_feedback_response.py b/src/supermemory/feedback/requests/post_feedback_response.py new file mode 100644 index 00000000..e36add78 --- /dev/null +++ b/src/supermemory/feedback/requests/post_feedback_response.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + + +class PostFeedbackResponseParams(typing_extensions.TypedDict): + id: str + """ + Feedback reference + """ + + remaining: float + """ + Submissions left for this caller until 00:00 UTC + """ diff --git a/src/supermemory/feedback/types/__init__.py b/src/supermemory/feedback/types/__init__.py new file mode 100644 index 00000000..3d53ea89 --- /dev/null +++ b/src/supermemory/feedback/types/__init__.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .post_feedback_request_type import PostFeedbackRequestType + from .post_feedback_response import PostFeedbackResponse +_dynamic_imports: typing.Dict[str, str] = { + "PostFeedbackRequestType": ".post_feedback_request_type", + "PostFeedbackResponse": ".post_feedback_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["PostFeedbackRequestType", "PostFeedbackResponse"] diff --git a/src/supermemory/feedback/types/post_feedback_request_type.py b/src/supermemory/feedback/types/post_feedback_request_type.py new file mode 100644 index 00000000..7dc39ce4 --- /dev/null +++ b/src/supermemory/feedback/types/post_feedback_request_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PostFeedbackRequestType = typing.Union[typing.Literal["bug", "feature_request", "docs", "other"], typing.Any] diff --git a/src/supermemory/feedback/types/post_feedback_response.py b/src/supermemory/feedback/types/post_feedback_response.py new file mode 100644 index 00000000..d66fb5d4 --- /dev/null +++ b/src/supermemory/feedback/types/post_feedback_response.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel + + +class PostFeedbackResponse(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Feedback reference + """ + + remaining: float = pydantic.Field() + """ + Submissions left for this caller until 00:00 UTC + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/supermemory/memories/client.py b/src/supermemory/memories/client.py index c3eb7591..1c04d59a 100644 --- a/src/supermemory/memories/client.py +++ b/src/supermemory/memories/client.py @@ -143,7 +143,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> MemoryDetails: """ - Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document. + Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document. Parameters ---------- @@ -157,7 +157,7 @@ def get( Comma-separated extras. related: the memory's version history and connected memories. documents: the source document, also attached to each related memory when both are requested. related_limit : typing.Optional[int] - Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many. + Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -327,7 +327,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> MemoryDetails: """ - Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document. + Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document. Parameters ---------- @@ -341,7 +341,7 @@ async def get( Comma-separated extras. related: the memory's version history and connected memories. documents: the source document, also attached to each related memory when both are requested. related_limit : typing.Optional[int] - Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many. + Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links. request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/src/supermemory/memories/raw_client.py b/src/supermemory/memories/raw_client.py index f0c33dbb..41b8d159 100644 --- a/src/supermemory/memories/raw_client.py +++ b/src/supermemory/memories/raw_client.py @@ -263,7 +263,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> HttpResponse[MemoryDetails]: """ - Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document. + Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document. Parameters ---------- @@ -277,7 +277,7 @@ def get( Comma-separated extras. related: the memory's version history and connected memories. documents: the source document, also attached to each related memory when both are requested. related_limit : typing.Optional[int] - Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many. + Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -604,7 +604,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> AsyncHttpResponse[MemoryDetails]: """ - Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document. + Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document. Parameters ---------- @@ -618,7 +618,7 @@ async def get( Comma-separated extras. related: the memory's version history and connected memories. documents: the source document, also attached to each related memory when both are requested. related_limit : typing.Optional[int] - Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many. + Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links. request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/src/supermemory/raw_client.py b/src/supermemory/raw_client.py index 09cca69f..8579fffb 100644 --- a/src/supermemory/raw_client.py +++ b/src/supermemory/raw_client.py @@ -525,7 +525,7 @@ def list( Type-safe metadata conditions applied before pagination include : typing.Optional[ListRequestIncludeParams] - Optional extras, matching search's include + Optional extras request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1103,7 +1103,7 @@ async def list( Type-safe metadata conditions applied before pagination include : typing.Optional[ListRequestIncludeParams] - Optional extras, matching search's include + Optional extras request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/src/supermemory/requests/batch_add_item_result.py b/src/supermemory/requests/batch_add_item_result.py index 15240d47..ebd3cbfb 100644 --- a/src/supermemory/requests/batch_add_item_result.py +++ b/src/supermemory/requests/batch_add_item_result.py @@ -12,7 +12,7 @@ class BatchAddItemResultParams(typing_extensions.TypedDict): status: BatchAddItemResultStatus """ - The document's processing state, as for a single add; error when this item failed + The document's processing state after this request, or error when this item failed """ error: typing_extensions.NotRequired[str] diff --git a/src/supermemory/requests/connector.py b/src/supermemory/requests/connector.py index 3b3025d4..b1eeb6bd 100644 --- a/src/supermemory/requests/connector.py +++ b/src/supermemory/requests/connector.py @@ -44,7 +44,7 @@ class ConnectorParams(typing_extensions.TypedDict): selection: typing.Optional[typing.Dict[str, typing.Optional[typing.Sequence[ConnectorSelectionItemParams]]]] """ - What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything. + What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything. """ document_limit: typing_extensions.Annotated[float, FieldMetadata(alias="documentLimit")] diff --git a/src/supermemory/requests/document_list_item_system.py b/src/supermemory/requests/document_list_item_system.py index c529e004..81bd865a 100644 --- a/src/supermemory/requests/document_list_item_system.py +++ b/src/supermemory/requests/document_list_item_system.py @@ -4,6 +4,7 @@ import typing_extensions from ..core.serialization import FieldMetadata +from ..types.document_list_item_system_dreaming_status import DocumentListItemSystemDreamingStatus class DocumentListItemSystemParams(typing_extensions.TypedDict): @@ -16,6 +17,13 @@ class DocumentListItemSystemParams(typing_extensions.TypedDict): Current extraction and memory-processing status """ + dreaming_status: typing_extensions.Annotated[ + DocumentListItemSystemDreamingStatus, FieldMetadata(alias="dreamingStatus") + ] + """ + Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does. + """ + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] """ ISO 8601 timestamp when the document was created diff --git a/src/supermemory/requests/document_system.py b/src/supermemory/requests/document_system.py index 8926dbbb..214204b3 100644 --- a/src/supermemory/requests/document_system.py +++ b/src/supermemory/requests/document_system.py @@ -4,6 +4,7 @@ import typing_extensions from ..core.serialization import FieldMetadata +from ..types.document_system_dreaming_status import DocumentSystemDreamingStatus from ..types.document_system_status import DocumentSystemStatus @@ -17,6 +18,11 @@ class DocumentSystemParams(typing_extensions.TypedDict): Current extraction and memory-processing status """ + dreaming_status: typing_extensions.Annotated[DocumentSystemDreamingStatus, FieldMetadata(alias="dreamingStatus")] + """ + Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does. + """ + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] """ ISO 8601 timestamp when the document was created diff --git a/src/supermemory/requests/list_request_include.py b/src/supermemory/requests/list_request_include.py index c990ec38..def7c650 100644 --- a/src/supermemory/requests/list_request_include.py +++ b/src/supermemory/requests/list_request_include.py @@ -5,7 +5,7 @@ class ListRequestIncludeParams(typing_extensions.TypedDict): """ - Optional extras, matching search's include + Optional extras """ forgotten: typing_extensions.NotRequired[bool] diff --git a/src/supermemory/requests/memory_included_related.py b/src/supermemory/requests/memory_included_related.py index dfa713a5..00565681 100644 --- a/src/supermemory/requests/memory_included_related.py +++ b/src/supermemory/requests/memory_included_related.py @@ -15,15 +15,15 @@ class MemoryIncludedRelatedParams(typing_extensions.TypedDict): parents: typing.Sequence[MemoryIncludedRelatedParentsItemParams] """ - Earlier versions this memory updates, nearest first + Earlier versions this memory updates """ children: typing.Sequence[MemoryIncludedRelatedChildrenItemParams] """ - Newer versions that update this memory, nearest first + Newer versions that update this memory """ siblings: typing.Sequence[MemoryIncludedRelatedSiblingsItemParams] """ - Memories connected by extends or derives, nearest first + Memories connected by extends or derives """ diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index 397db6f0..fbcd8ce4 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -61,9 +61,11 @@ from .document_input import DocumentInput from .document_list_item import DocumentListItem from .document_list_item_system import DocumentListItemSystem + from .document_list_item_system_dreaming_status import DocumentListItemSystemDreamingStatus from .document_ref import DocumentRef from .document_ref_status import DocumentRefStatus from .document_system import DocumentSystem + from .document_system_dreaming_status import DocumentSystemDreamingStatus from .document_system_status import DocumentSystemStatus from .dreaming_mode import DreamingMode from .error_response import ErrorResponse @@ -201,9 +203,11 @@ "DocumentInput": ".document_input", "DocumentListItem": ".document_list_item", "DocumentListItemSystem": ".document_list_item_system", + "DocumentListItemSystemDreamingStatus": ".document_list_item_system_dreaming_status", "DocumentRef": ".document_ref", "DocumentRefStatus": ".document_ref_status", "DocumentSystem": ".document_system", + "DocumentSystemDreamingStatus": ".document_system_dreaming_status", "DocumentSystemStatus": ".document_system_status", "DreamingMode": ".dreaming_mode", "ErrorResponse": ".error_response", @@ -367,9 +371,11 @@ def __dir__(): "DocumentInput", "DocumentListItem", "DocumentListItemSystem", + "DocumentListItemSystemDreamingStatus", "DocumentRef", "DocumentRefStatus", "DocumentSystem", + "DocumentSystemDreamingStatus", "DocumentSystemStatus", "DreamingMode", "ErrorResponse", diff --git a/src/supermemory/types/batch_add_item_result.py b/src/supermemory/types/batch_add_item_result.py index c22900a5..006f671a 100644 --- a/src/supermemory/types/batch_add_item_result.py +++ b/src/supermemory/types/batch_add_item_result.py @@ -16,7 +16,7 @@ class BatchAddItemResult(UncheckedBaseModel): status: BatchAddItemResultStatus = pydantic.Field() """ - The document's processing state, as for a single add; error when this item failed + The document's processing state after this request, or error when this item failed """ error: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/supermemory/types/connector.py b/src/supermemory/types/connector.py index 09f34072..a6a313b5 100644 --- a/src/supermemory/types/connector.py +++ b/src/supermemory/types/connector.py @@ -49,7 +49,7 @@ class Connector(UncheckedBaseModel): default=None ) """ - What syncs, grouped by kind, in the same shape PATCH takes. Null for connectors that sync everything. + What syncs, grouped by kind (repos, labels, files or folders), each a list of { id, name }. Null for connectors that sync everything. """ document_limit: typing_extensions.Annotated[ diff --git a/src/supermemory/types/document_list_item_system.py b/src/supermemory/types/document_list_item_system.py index 8604708a..22bf80ff 100644 --- a/src/supermemory/types/document_list_item_system.py +++ b/src/supermemory/types/document_list_item_system.py @@ -8,6 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .document_list_item_system_dreaming_status import DocumentListItemSystemDreamingStatus class DocumentListItemSystem(UncheckedBaseModel): @@ -20,6 +21,18 @@ class DocumentListItemSystem(UncheckedBaseModel): Current extraction and memory-processing status """ + dreaming_status: typing_extensions.Annotated[ + DocumentListItemSystemDreamingStatus, + FieldMetadata(alias="dreamingStatus"), + pydantic.Field( + alias="dreamingStatus", + description="Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does.", + ), + ] + """ + Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does. + """ + created_at: typing_extensions.Annotated[ dt.datetime, FieldMetadata(alias="createdAt"), diff --git a/src/supermemory/types/document_list_item_system_dreaming_status.py b/src/supermemory/types/document_list_item_system_dreaming_status.py new file mode 100644 index 00000000..2391b85b --- /dev/null +++ b/src/supermemory/types/document_list_item_system_dreaming_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocumentListItemSystemDreamingStatus = typing.Union[typing.Literal["dreaming", "done"], typing.Any] diff --git a/src/supermemory/types/document_system.py b/src/supermemory/types/document_system.py index db8adfff..72b042d4 100644 --- a/src/supermemory/types/document_system.py +++ b/src/supermemory/types/document_system.py @@ -8,6 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .document_system_dreaming_status import DocumentSystemDreamingStatus from .document_system_status import DocumentSystemStatus @@ -21,6 +22,18 @@ class DocumentSystem(UncheckedBaseModel): Current extraction and memory-processing status """ + dreaming_status: typing_extensions.Annotated[ + DocumentSystemDreamingStatus, + FieldMetadata(alias="dreamingStatus"), + pydantic.Field( + alias="dreamingStatus", + description="Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does.", + ), + ] + """ + Memory generation state, separate from status. dreaming while memories for the latest content are queued, being generated, or waiting for a retry after a failure; done once they are generated or when none are needed. Under dynamic dreaming, status can reach done minutes before dreamingStatus does. + """ + created_at: typing_extensions.Annotated[ dt.datetime, FieldMetadata(alias="createdAt"), diff --git a/src/supermemory/types/document_system_dreaming_status.py b/src/supermemory/types/document_system_dreaming_status.py new file mode 100644 index 00000000..8e24c62e --- /dev/null +++ b/src/supermemory/types/document_system_dreaming_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocumentSystemDreamingStatus = typing.Union[typing.Literal["dreaming", "done"], typing.Any] diff --git a/src/supermemory/types/list_request_include.py b/src/supermemory/types/list_request_include.py index c8e17d6e..b25b9e29 100644 --- a/src/supermemory/types/list_request_include.py +++ b/src/supermemory/types/list_request_include.py @@ -9,7 +9,7 @@ class ListRequestInclude(UncheckedBaseModel): """ - Optional extras, matching search's include + Optional extras """ forgotten: typing.Optional[bool] = pydantic.Field(default=None) diff --git a/src/supermemory/types/memory_included_related.py b/src/supermemory/types/memory_included_related.py index ad9a01cf..a157c28c 100644 --- a/src/supermemory/types/memory_included_related.py +++ b/src/supermemory/types/memory_included_related.py @@ -17,17 +17,17 @@ class MemoryIncludedRelated(UncheckedBaseModel): parents: typing.List[MemoryIncludedRelatedParentsItem] = pydantic.Field() """ - Earlier versions this memory updates, nearest first + Earlier versions this memory updates """ children: typing.List[MemoryIncludedRelatedChildrenItem] = pydantic.Field() """ - Newer versions that update this memory, nearest first + Newer versions that update this memory """ siblings: typing.List[MemoryIncludedRelatedSiblingsItem] = pydantic.Field() """ - Memories connected by extends or derives, nearest first + Memories connected by extends or derives """ if IS_PYDANTIC_V2: diff --git a/uv.lock b/uv.lock index 07b03660..92fb6dd2 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.10" resolution-markers = [ "python_full_version >= '3.15'", @@ -302,7 +302,7 @@ name = "exceptiongroup" version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -1256,7 +1256,7 @@ wheels = [ [[package]] name = "supermemory" -version = "5.0.0" +version = "5.0.1" source = { editable = "." } dependencies = [ { name = "httpx" },