From 2bf7d6b9ada62910c82e4a5f11135047634039f0 Mon Sep 17 00:00:00 2001 From: Mahesh Sanikommu Date: Tue, 6 Oct 2026 00:45:39 -0700 Subject: [PATCH 1/3] chore: regenerate from the live spec after the v5 cleanup stack include replaces attach as a typed list on GETs; search options live in the body; namespaces.list is paginated; delete responses return count/status; new memories.get. --- MIGRATION.md | 2 +- fern/openapi.json | 2914 +++++++++++------ fern/overlay.yaml | 1 + reference.md | 236 +- src/supermemory/__init__.py | 273 +- src/supermemory/client.py | 131 +- src/supermemory/connectors/__init__.py | 30 + src/supermemory/connectors/client.py | 21 +- src/supermemory/connectors/raw_client.py | 21 +- src/supermemory/connectors/types/__init__.py | 34 + .../get_connectors_request_include_item.py | 5 + src/supermemory/documents/__init__.py | 75 + src/supermemory/documents/client.py | 363 +- src/supermemory/documents/raw_client.py | 415 ++- src/supermemory/documents/types/__init__.py | 77 + .../batch_add_documents_request_dreaming.py | 5 + .../batch_add_documents_request_task_type.py | 5 + .../get_documents_request_include_item.py | 5 + ...ce_with_file_documents_request_dreaming.py | 5 + ...e_with_file_documents_request_file_type.py | 7 + ...e_with_file_documents_request_task_type.py | 5 + .../update_documents_request_dreaming.py | 5 + .../update_documents_request_task_type.py | 5 + .../update_file_documents_request_dreaming.py | 5 + ...update_file_documents_request_file_type.py | 5 + ...update_file_documents_request_task_type.py | 5 + .../upload_file_documents_request_dreaming.py | 5 + ...upload_file_documents_request_file_type.py | 5 + ...upload_file_documents_request_task_type.py | 5 + src/supermemory/memories/__init__.py | 140 + src/supermemory/memories/client.py | 124 + src/supermemory/memories/raw_client.py | 249 ++ src/supermemory/memories/requests/__init__.py | 108 + .../requests/get_memories_response.py | 60 + .../get_memories_response_included.py | 21 + ...get_memories_response_included_document.py | 42 + ...ories_response_included_document_system.py | 20 + .../get_memories_response_included_related.py | 29 + ...response_included_related_children_item.py | 49 + ...included_related_children_item_document.py | 44 + ...d_related_children_item_document_system.py | 20 + ...e_included_related_children_item_system.py | 15 + ..._response_included_related_parents_item.py | 49 + ..._included_related_parents_item_document.py | 44 + ...ed_related_parents_item_document_system.py | 20 + ...se_included_related_parents_item_system.py | 15 + ...response_included_related_siblings_item.py | 49 + ...included_related_siblings_item_document.py | 44 + ...d_related_siblings_item_document_system.py | 20 + ...e_included_related_siblings_item_system.py | 15 + src/supermemory/memories/types/__init__.py | 107 + .../get_memories_request_include_item.py | 5 + .../memories/types/get_memories_response.py | 90 + .../types/get_memories_response_included.py | 34 + ...get_memories_response_included_document.py | 53 + ...ories_response_included_document_system.py | 42 + .../get_memories_response_included_related.py | 40 + ...response_included_related_children_item.py | 60 + ...included_related_children_item_document.py | 55 + ...d_related_children_item_document_system.py | 42 + ...e_included_related_children_item_system.py | 33 + ..._response_included_related_parents_item.py | 60 + ..._included_related_parents_item_document.py | 55 + ...ed_related_parents_item_document_system.py | 42 + ...se_included_related_parents_item_system.py | 33 + ...response_included_related_siblings_item.py | 60 + ...included_related_siblings_item_document.py | 55 + ...d_related_siblings_item_document_system.py | 42 + ...e_included_related_siblings_item_system.py | 33 + src/supermemory/namespaces/__init__.py | 53 + src/supermemory/namespaces/client.py | 36 +- src/supermemory/namespaces/raw_client.py | 80 +- .../namespaces/requests/__init__.py | 44 + .../requests/list_namespaces_response.py | 19 + ...st_namespaces_response_namespaces_item.py} | 8 +- ...espaces_response_namespaces_item_system.py | 22 + src/supermemory/namespaces/types/__init__.py | 44 + .../types/list_namespaces_response.py | 30 + ...st_namespaces_response_namespaces_item.py} | 12 +- ...espaces_response_namespaces_item_system.py | 43 + src/supermemory/raw_client.py | 157 +- src/supermemory/requests/__init__.py | 33 +- .../requests/batch_add_item_result.py | 13 +- src/supermemory/requests/batch_add_result.py | 10 +- src/supermemory/requests/chunk.py | 4 +- src/supermemory/requests/chunk_list_item.py | 4 +- src/supermemory/requests/connector.py | 4 +- .../requests/delete_documents_result.py | 3 +- src/supermemory/requests/document.py | 2 +- .../requests/document_list_item.py | 4 +- .../requests/document_list_item_system.py | 27 + src/supermemory/requests/document_ref.py | 7 +- src/supermemory/requests/document_system.py | 3 +- .../requests/file_upload_result.py | 17 - .../requests/list_request_include.py | 14 + .../requests/list_request_limit.py | 5 - src/supermemory/requests/list_request_page.py | 5 - src/supermemory/requests/memory.py | 4 +- src/supermemory/requests/namespace_deleted.py | 2 - .../requests/namespace_deleted_deleted.py | 7 - .../requests/namespace_deleted_queued.py | 7 - src/supermemory/requests/namespace_details.py | 4 +- ..._system.py => namespace_details_system.py} | 4 +- src/supermemory/requests/related_memories.py | 2 +- src/supermemory/requests/related_memory.py | 7 +- ...st_attach.py => search_request_include.py} | 8 +- src/supermemory/requests/search_result.py | 7 +- .../requests/search_result_included.py | 4 +- .../search_result_included_document.py | 21 +- .../search_result_included_document_system.py | 20 + src/supermemory/types/__init__.py | 66 +- src/supermemory/types/add_request_dreaming.py | 5 + .../types/add_request_task_type.py | 5 + .../types/batch_add_item_result.py | 13 +- .../types/batch_add_item_result_status.py | 8 + src/supermemory/types/batch_add_result.py | 10 +- src/supermemory/types/chunk.py | 4 +- src/supermemory/types/chunk_list_item.py | 4 +- src/supermemory/types/connector.py | 4 +- .../types/delete_documents_result.py | 8 +- src/supermemory/types/document.py | 2 +- src/supermemory/types/document_attachment.py | 5 - src/supermemory/types/document_list_item.py | 4 +- .../types/document_list_item_system.py | 48 + src/supermemory/types/document_ref.py | 7 +- src/supermemory/types/document_ref_status.py | 7 + src/supermemory/types/document_system.py | 3 +- .../types/document_system_status.py | 7 + src/supermemory/types/dreaming_mode.py | 5 - src/supermemory/types/file_type.py | 5 - ...load_result.py => list_request_include.py} | 9 +- src/supermemory/types/list_request_limit.py | 5 - src/supermemory/types/list_request_page.py | 5 - src/supermemory/types/memory.py | 4 +- src/supermemory/types/namespace_deleted.py | 2 - .../types/namespace_deleted_deleted.py | 5 - .../types/namespace_deleted_queued.py | 5 - src/supermemory/types/namespace_details.py | 4 +- ..._system.py => namespace_details_system.py} | 6 +- src/supermemory/types/related_memories.py | 2 +- src/supermemory/types/related_memory.py | 7 +- src/supermemory/types/search_mode.py | 5 - ...st_attach.py => search_request_include.py} | 8 +- .../types/search_request_search_mode.py | 5 + src/supermemory/types/search_result.py | 14 +- .../types/search_result_included.py | 4 +- .../types/search_result_included_document.py | 24 +- .../search_result_included_document_system.py | 42 + src/supermemory/types/task_type.py | 5 - tests/test_client.py | 4 +- tests/test_compat.py | 14 +- 151 files changed, 5991 insertions(+), 1996 deletions(-) create mode 100644 src/supermemory/connectors/types/__init__.py create mode 100644 src/supermemory/connectors/types/get_connectors_request_include_item.py create mode 100644 src/supermemory/documents/types/__init__.py create mode 100644 src/supermemory/documents/types/batch_add_documents_request_dreaming.py create mode 100644 src/supermemory/documents/types/batch_add_documents_request_task_type.py create mode 100644 src/supermemory/documents/types/get_documents_request_include_item.py create mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py create mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_file_type.py create mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_task_type.py create mode 100644 src/supermemory/documents/types/update_documents_request_dreaming.py create mode 100644 src/supermemory/documents/types/update_documents_request_task_type.py create mode 100644 src/supermemory/documents/types/update_file_documents_request_dreaming.py create mode 100644 src/supermemory/documents/types/update_file_documents_request_file_type.py create mode 100644 src/supermemory/documents/types/update_file_documents_request_task_type.py create mode 100644 src/supermemory/documents/types/upload_file_documents_request_dreaming.py create mode 100644 src/supermemory/documents/types/upload_file_documents_request_file_type.py create mode 100644 src/supermemory/documents/types/upload_file_documents_request_task_type.py create mode 100644 src/supermemory/memories/requests/__init__.py create mode 100644 src/supermemory/memories/requests/get_memories_response.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_document.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_document_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_children_item.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py create mode 100644 src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py create mode 100644 src/supermemory/memories/types/__init__.py create mode 100644 src/supermemory/memories/types/get_memories_request_include_item.py create mode 100644 src/supermemory/memories/types/get_memories_response.py create mode 100644 src/supermemory/memories/types/get_memories_response_included.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_document.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_document_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_children_item.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_parents_item.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py create mode 100644 src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py create mode 100644 src/supermemory/namespaces/requests/__init__.py create mode 100644 src/supermemory/namespaces/requests/list_namespaces_response.py rename src/supermemory/{requests/namespace.py => namespaces/requests/list_namespaces_response_namespaces_item.py} (71%) create mode 100644 src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py create mode 100644 src/supermemory/namespaces/types/__init__.py create mode 100644 src/supermemory/namespaces/types/list_namespaces_response.py rename src/supermemory/{types/namespace.py => namespaces/types/list_namespaces_response_namespaces_item.py} (77%) create mode 100644 src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py create mode 100644 src/supermemory/requests/document_list_item_system.py delete mode 100644 src/supermemory/requests/file_upload_result.py create mode 100644 src/supermemory/requests/list_request_include.py delete mode 100644 src/supermemory/requests/list_request_limit.py delete mode 100644 src/supermemory/requests/list_request_page.py rename src/supermemory/requests/{namespace_system.py => namespace_details_system.py} (80%) rename src/supermemory/requests/{search_request_attach.py => search_request_include.py} (57%) create mode 100644 src/supermemory/requests/search_result_included_document_system.py create mode 100644 src/supermemory/types/add_request_dreaming.py create mode 100644 src/supermemory/types/add_request_task_type.py create mode 100644 src/supermemory/types/batch_add_item_result_status.py delete mode 100644 src/supermemory/types/document_attachment.py create mode 100644 src/supermemory/types/document_list_item_system.py create mode 100644 src/supermemory/types/document_ref_status.py create mode 100644 src/supermemory/types/document_system_status.py delete mode 100644 src/supermemory/types/dreaming_mode.py delete mode 100644 src/supermemory/types/file_type.py rename src/supermemory/types/{file_upload_result.py => list_request_include.py} (67%) delete mode 100644 src/supermemory/types/list_request_limit.py delete mode 100644 src/supermemory/types/list_request_page.py rename src/supermemory/types/{namespace_system.py => namespace_details_system.py} (88%) delete mode 100644 src/supermemory/types/search_mode.py rename src/supermemory/types/{search_request_attach.py => search_request_include.py} (76%) create mode 100644 src/supermemory/types/search_request_search_mode.py create mode 100644 src/supermemory/types/search_result_included_document_system.py delete mode 100644 src/supermemory/types/task_type.py diff --git a/MIGRATION.md b/MIGRATION.md index ca5b620..ec291f3 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -56,7 +56,7 @@ Only the API methods change. Everything around them works as before: | `custom_id` | `id` | | `q` | `query` | | `filters` | `filter` (typed filter expression) | -| `include` | `attach` | +| `include` | `include` (a list on GETs, a dict on search) | | search `timing` / `total` | `search_time` | ## Profile no longer searches diff --git a/fern/openapi.json b/fern/openapi.json index 09927f6..56fcb2e 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -359,11 +359,22 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier of the document" + "minLength": 1, + "description": "Document identifier to poll or retrieve" }, "status": { "type": "string", - "description": "Status of the document" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], + "description": "The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document." } }, "required": [ @@ -460,30 +471,6 @@ }, "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." - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." } ], "requestBody": { @@ -570,6 +557,22 @@ "description": "When the source content is from, in ISO 8601 format", "example": "2026-01-15", "type": "string" + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] } }, "required": [ @@ -584,7 +587,7 @@ { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document?dreaming=instant\" \\\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 }'" + "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 }'" } ] }, @@ -598,7 +601,7 @@ "schema": { "type": "object", "properties": { - "deletedCount": { + "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, @@ -632,7 +635,7 @@ } }, "required": [ - "deletedCount", + "count", "errors" ], "additionalProperties": false @@ -759,22 +762,33 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier of the document (empty string for failed items)" + "description": "Document identifier" }, "status": { "type": "string", - "description": "Status of the document (e.g. 'done', 'queued', 'error')" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed", + "error" + ], + "description": "The document's processing state, as for a single add; error when this item failed" }, "error": { - "description": "Error message when status is 'error'", + "description": "Failure reason", "type": "string" }, "details": { - "description": "Additional error details when status is 'error'", + "description": "Human-readable explanation of the failure", "type": "string" }, "url": { - "description": "URL of the failed item, when it had one. Only present on failed items, where it may be the only way to tell which input the error belongs to (the id falls back to 'unknown' when the input had neither an id nor a customId).", + "description": "URL of the failed item, when it had one", "type": "string" } }, @@ -784,21 +798,25 @@ ], "additionalProperties": false }, - "description": "Array of results for each document in the batch" + "description": "One result per submitted document: accepted documents first, in request order, then failed ones. Match results by id, or by url for a failed item with no id." }, - "failed": { - "type": "number", - "description": "Count of documents that failed to add" + "count": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of documents accepted" }, - "success": { - "type": "number", - "description": "Count of documents successfully added" + "failed": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of documents that failed" } }, "required": [ "results", - "failed", - "success" + "count", + "failed" ], "additionalProperties": false } @@ -880,30 +898,6 @@ }, "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." - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." } ], "requestBody": { @@ -1005,6 +999,22 @@ "additionalProperties": false }, "description": "Documents to ingest or append in one request" + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] } }, "required": [ @@ -1019,7 +1029,7 @@ { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document/batch?dreaming=instant\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"documents\": [\n { \"content\": \"Q3 roadmap notes\", \"id\": \"doc_roadmap\" },\n { \"content\": \"Gift policy for VP promotions\", \"id\": \"doc_gifts\" }\n ]\n }'" + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/document/batch\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\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 }'" } ] } @@ -1027,7 +1037,7 @@ "/ns/{namespace}/document/{id}": { "get": { "operationId": "getNsByNamespaceDocumentById", - "description": "Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response.", + "description": "Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response.", "responses": { "200": { "content": { @@ -1096,6 +1106,16 @@ "properties": { "status": { "type": "string", + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], "description": "Current extraction and memory-processing status" }, "createdAt": { @@ -1143,19 +1163,12 @@ "description": "Chunk content type" }, "metadata": { - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ], - "description": "Chunk metadata, when available" + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Chunk metadata; empty object when none" }, "system": { "type": "object", @@ -1199,19 +1212,12 @@ "description": "Learned fact or context extracted from the document" }, "metadata": { - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ], - "description": "Memory metadata, including temporal context when available" + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Memory metadata, including temporal context; empty object when none" }, "isStatic": { "type": "boolean", @@ -1282,7 +1288,7 @@ "metadata", "system" ], - "description": "Namespace-scoped document. Attachment keys are omitted unless requested and are empty arrays when requested without results." + "description": "Namespace-scoped document. Included keys are omitted unless requested and are empty arrays when requested without results." } } }, @@ -1377,7 +1383,7 @@ }, { "in": "query", - "name": "attach", + "name": "include", "schema": { "type": "array", "items": { @@ -1386,16 +1392,18 @@ "chunks", "memories" ] - } + }, + "style": "form", + "explode": false }, - "description": "Child resources to include. Repeat the parameter to attach chunks, memories, or both." + "description": "Comma-separated child resources to include: chunks, memories, or both." } ], "x-codeSamples": [ { "lang": "bash", "label": "cURL", - "source": "curl \"https://api.supermemory.ai/ns/project_123/document/doc_abc123?attach=chunks&attach=memories\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" + "source": "curl \"https://api.supermemory.ai/ns/project_123/document/doc_abc123?include=chunks,memories\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\"" } ] }, @@ -1411,11 +1419,22 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier of the document" + "minLength": 1, + "description": "Document identifier to poll or retrieve" }, "status": { "type": "string", - "description": "Status of the document" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], + "description": "The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document." } }, "required": [ @@ -1534,30 +1553,6 @@ }, "required": true, "description": "The public document ID" - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." } ], "requestBody": { @@ -1637,6 +1632,22 @@ "description": "When the source content is from, in ISO 8601 format", "example": "2026-01-15", "type": "string" + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] } }, "additionalProperties": false @@ -1671,8 +1682,17 @@ }, "status": { "type": "string", - "const": "processing", - "description": "Confirms the file was accepted for asynchronous processing" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], + "description": "The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document." } }, "required": [ @@ -1769,54 +1789,6 @@ }, "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." - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." - }, - { - "in": "query", - "name": "fileType", - "schema": { - "type": "string", - "enum": [ - "text", - "pdf", - "image", - "video", - "audio" - ] - }, - "description": "Explicit source type used when automatic inference is insufficient" - }, - { - "in": "query", - "name": "mimeType", - "schema": { - "type": "string", - "pattern": "^[^\\s/]+\\/[^\\s/]+$" - }, - "description": "Explicit MIME type used when upload metadata is insufficient" } ], "requestBody": { @@ -1849,6 +1821,38 @@ "description": "When the source content is from, in ISO 8601 format", "example": "2026-01-15", "type": "string" + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] + }, + "fileType": { + "description": "Explicit source type used when automatic inference is insufficient", + "type": "string", + "enum": [ + "text", + "pdf", + "image", + "video", + "audio" + ] + }, + "mimeType": { + "description": "Explicit MIME type used when upload metadata is insufficient", + "type": "string", + "pattern": "^[^\\s/]+\\/[^\\s/]+$" } }, "required": [ @@ -1879,8 +1883,17 @@ }, "status": { "type": "string", - "const": "processing", - "description": "Confirms the file was accepted for asynchronous processing" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], + "description": "The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document." } }, "required": [ @@ -1999,54 +2012,6 @@ }, "required": true, "description": "The public document ID" - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." - }, - { - "in": "query", - "name": "fileType", - "schema": { - "type": "string", - "enum": [ - "text", - "pdf", - "image", - "video", - "audio" - ] - }, - "description": "Explicit source type used when automatic inference is insufficient" - }, - { - "in": "query", - "name": "mimeType", - "schema": { - "type": "string", - "pattern": "^[^\\s/]+\\/[^\\s/]+$" - }, - "description": "Explicit MIME type used when upload metadata is insufficient" } ], "requestBody": { @@ -2079,6 +2044,38 @@ "description": "When the source content is from, in ISO 8601 format", "example": "2026-01-15", "type": "string" + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] + }, + "fileType": { + "description": "Explicit source type used when automatic inference is insufficient", + "type": "string", + "enum": [ + "text", + "pdf", + "image", + "video", + "audio" + ] + }, + "mimeType": { + "description": "Explicit MIME type used when upload metadata is insufficient", + "type": "string", + "pattern": "^[^\\s/]+\\/[^\\s/]+$" } }, "required": [ @@ -2107,8 +2104,17 @@ }, "status": { "type": "string", - "const": "processing", - "description": "Confirms the file was accepted for asynchronous processing" + "enum": [ + "unknown", + "queued", + "extracting", + "chunking", + "embedding", + "indexing", + "done", + "failed" + ], + "description": "The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document." } }, "required": [ @@ -2227,54 +2233,6 @@ }, "required": true, "description": "The public document ID" - }, - { - "in": "query", - "name": "taskType", - "schema": { - "type": "string", - "enum": [ - "memory", - "superrag" - ] - }, - "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories." - }, - { - "in": "query", - "name": "dreaming", - "schema": { - "type": "string", - "enum": [ - "dynamic", - "instant" - ] - }, - "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document." - }, - { - "in": "query", - "name": "fileType", - "schema": { - "type": "string", - "enum": [ - "text", - "pdf", - "image", - "video", - "audio" - ] - }, - "description": "Explicit source type used when automatic inference is insufficient" - }, - { - "in": "query", - "name": "mimeType", - "schema": { - "type": "string", - "pattern": "^[^\\s/]+\\/[^\\s/]+$" - }, - "description": "Explicit MIME type used when upload metadata is insufficient" } ], "requestBody": { @@ -2307,8 +2265,40 @@ "description": "When the source content is from, in ISO 8601 format", "example": "2026-01-15", "type": "string" - } - }, + }, + "taskType": { + "description": "Processing pipeline. \"memory\" builds durable learned context; \"superrag\" optimizes the document for retrieval without generating memories.", + "type": "string", + "enum": [ + "memory", + "superrag" + ] + }, + "dreaming": { + "description": "Processing mode. \"dynamic\" (default) groups related documents so memories form from coherent context. \"instant\" processes each document independently right away and bills one extra operation per document.", + "type": "string", + "enum": [ + "dynamic", + "instant" + ] + }, + "fileType": { + "description": "Explicit source type used when automatic inference is insufficient", + "type": "string", + "enum": [ + "text", + "pdf", + "image", + "video", + "audio" + ] + }, + "mimeType": { + "description": "Explicit MIME type used when upload metadata is insufficient", + "type": "string", + "pattern": "^[^\\s/]+\\/[^\\s/]+$" + } + }, "additionalProperties": false } } @@ -2348,18 +2338,11 @@ "type": "string" }, "metadata": { - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ], + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, "description": "Public metadata attached to the result", "example": { "source": "conversation", @@ -2375,6 +2358,10 @@ "type": "boolean", "description": "Whether the memory is its latest version; false for recalled forgotten memories" }, + "isInference": { + "type": "boolean", + "description": "Whether the memory was inferred rather than stated directly; false for chunks" + }, "system": { "type": "object", "properties": { @@ -2397,7 +2384,7 @@ "type": "object", "properties": { "related": { - "description": "Memory relationships attached when requested", + "description": "Memory relationships included when requested", "type": "object", "properties": { "parents": { @@ -2405,6 +2392,10 @@ "items": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, "relation": { "type": "string", "enum": [ @@ -2430,19 +2421,12 @@ "description": "Related learned fact or context" }, "metadata": { - "description": "Public metadata associated with the related memory", - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ] + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" }, "system": { "type": "object", @@ -2459,8 +2443,10 @@ } }, "required": [ + "id", "relation", "memory", + "metadata", "system" ] }, @@ -2471,6 +2457,10 @@ "items": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, "relation": { "type": "string", "enum": [ @@ -2496,19 +2486,12 @@ "description": "Related learned fact or context" }, "metadata": { - "description": "Public metadata associated with the related memory", - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ] + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" }, "system": { "type": "object", @@ -2525,8 +2508,10 @@ } }, "required": [ + "id", "relation", "memory", + "metadata", "system" ] }, @@ -2537,6 +2522,10 @@ "items": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, "relation": { "type": "string", "enum": [ @@ -2562,19 +2551,12 @@ "description": "Related learned fact or context" }, "metadata": { - "description": "Public metadata associated with the related memory", - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ] + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" }, "system": { "type": "object", @@ -2591,8 +2573,10 @@ } }, "required": [ + "id", "relation", "memory", + "metadata", "system" ] }, @@ -2606,7 +2590,7 @@ ] }, "document": { - "description": "Source document attached when requested and available", + "description": "Source document included when requested and available", "type": "object", "properties": { "id": { @@ -2614,7 +2598,6 @@ "description": "Source document identifier" }, "title": { - "description": "Source document title", "anyOf": [ { "type": "string" @@ -2622,10 +2605,10 @@ { "type": "null" } - ] + ], + "description": "Source document title" }, "type": { - "description": "Detected source or content type", "anyOf": [ { "type": "string" @@ -2633,25 +2616,18 @@ { "type": "null" } - ] + ], + "description": "Detected source or content type" }, "metadata": { - "description": "Public metadata attached to the source document", - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ] + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata attached to the source document" }, "summary": { - "description": "Generated summary of the source document", "anyOf": [ { "type": "string" @@ -2659,21 +2635,35 @@ { "type": "null" } - ] - }, - "createdAt": { - "type": "string", - "description": "ISO 8601 timestamp when the source document was created" + ], + "description": "Generated summary of the source document" }, - "updatedAt": { - "type": "string", - "description": "ISO 8601 timestamp of the source document's latest update" + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp when the source document was created" + }, + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the source document's latest update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" } }, "required": [ "id", - "createdAt", - "updatedAt" + "title", + "type", + "metadata", + "summary", + "system" ] } } @@ -2684,6 +2674,7 @@ "metadata", "similarity", "isLatest", + "isInference", "system" ] }, @@ -2777,33 +2768,6 @@ }, "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." - }, - { - "in": "query", - "name": "limit", - "schema": { - "default": 10, - "example": 10, - "type": "integer", - "minimum": 1, - "maximum": 100 - }, - "description": "Maximum number of results to return" - }, - { - "in": "query", - "name": "searchMode", - "schema": { - "default": "hybrid", - "example": "hybrid", - "type": "string", - "enum": [ - "hybrid", - "memories", - "chunks" - ] - }, - "description": "Search surface. \"hybrid\" combines learned memories with source chunks, \"memories\" returns learned context, and \"chunks\" returns source passages." } ], "requestBody": { @@ -2828,28 +2792,50 @@ }, "$ref": "#/components/schemas/FilterExpression" }, - "attach": { + "searchMode": { + "default": "hybrid", + "description": "Search surface. \"hybrid\" combines learned memories with source chunks, \"memories\" returns learned context, and \"chunks\" returns source passages.", + "example": "hybrid", + "type": "string", + "enum": [ + "hybrid", + "memories", + "chunks" + ] + }, + "limit": { + "default": 10, + "description": "Maximum number of results to return", + "example": 10, + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "include": { "default": { "documents": false, "related": false, "forgotten": false }, "description": "Optional context to include alongside each matching result", + "example": { + "related": true + }, "type": "object", "properties": { "documents": { "default": false, - "description": "Attach the source document for each result when one is available", + "description": "Include the source document for each result when one is available", "type": "boolean" }, "related": { "default": false, - "description": "Attach parent, child, and sibling memories that explain how each memory evolved", + "description": "Include parent, child, and sibling memories that explain how each memory evolved", "type": "boolean" }, "forgotten": { "default": false, - "description": "Allow forgotten memories to participate in recall", + "description": "Let forgotten and expired memories appear in results", "type": "boolean" } }, @@ -2893,7 +2879,7 @@ { "lang": "bash", "label": "cURL", - "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/search?searchMode=hybrid&limit=5\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"query\": \"gift ideas for a VP promotion after a Tokyo offsite\",\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 \"attach\": { \"related\": true }\n }'" + "source": "curl -X POST \"https://api.supermemory.ai/ns/user_123/search\" \\\n -H \"Authorization: Bearer $SUPERMEMORY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\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 }'" } ] } @@ -3900,15 +3886,10 @@ "name": "page", "schema": { "example": 1, - "anyOf": [ - { - "type": "string", - "pattern": "^\\d+$" - }, - { - "type": "number" - } - ] + "default": 1, + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 }, "description": "One-based page number" }, @@ -3917,15 +3898,10 @@ "name": "limit", "schema": { "example": 10, - "anyOf": [ - { - "type": "string", - "pattern": "^\\d+$" - }, - { - "type": "number" - } - ] + "default": 10, + "type": "integer", + "minimum": 1, + "maximum": 100 }, "description": "Maximum resources to return per page" }, @@ -3933,6 +3909,7 @@ "in": "query", "name": "sort", "schema": { + "default": "createdAt", "example": "createdAt", "type": "string", "enum": [ @@ -3968,6 +3945,24 @@ "filter": { "description": "Type-safe metadata conditions applied before pagination", "$ref": "#/components/schemas/FilterExpression" + }, + "include": { + "default": { + "forgotten": false + }, + "description": "Optional extras, matching search's include", + "example": { + "forgotten": true + }, + "type": "object", + "properties": { + "forgotten": { + "default": false, + "description": "List forgotten and expired memories too, with isForgotten: true. Applies to type memories only.", + "type": "boolean" + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -4102,19 +4097,12 @@ "description": "Chunk content type" }, "metadata": { - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ], - "description": "Chunk metadata, when available" + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Chunk metadata; empty object when none" }, "system": { "type": "object", @@ -4162,19 +4150,12 @@ "description": "Learned fact or context extracted from the document" }, "metadata": { - "anyOf": [ - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} - }, - { - "type": "null" - } - ], - "description": "Memory metadata, including temporal context when available" + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Memory metadata, including temporal context; empty object when none" }, "isStatic": { "type": "boolean", @@ -4629,7 +4610,7 @@ "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))$" }, "syncs": { - "description": "Present when attach=syncs", + "description": "Present when include=syncs", "type": "array", "items": { "type": "object", @@ -4758,7 +4739,7 @@ } }, "picker": { - "description": "Present when attach=picker. Null for connectors that sync everything.", + "description": "Present when include=picker. Null for connectors that sync everything.", "anyOf": [ { "type": "object", @@ -5625,7 +5606,7 @@ "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))$" }, "syncs": { - "description": "Present when attach=syncs", + "description": "Present when include=syncs", "type": "array", "items": { "type": "object", @@ -5754,7 +5735,7 @@ } }, "picker": { - "description": "Present when attach=picker. Null for connectors that sync everything.", + "description": "Present when include=picker. Null for connectors that sync everything.", "anyOf": [ { "type": "object", @@ -5923,10 +5904,18 @@ }, { "in": "query", - "name": "attach", + "name": "include", "schema": { - "type": "string", - "pattern": "^(syncs|picker)(,(syncs|picker))*$" + "type": "array", + "items": { + "type": "string", + "enum": [ + "syncs", + "picker" + ] + }, + "style": "form", + "explode": false }, "description": "Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL." }, @@ -5940,7 +5929,7 @@ "description": "Where the hosted picker sends the user when they finish" } ], - "description": "Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs.", + "description": "Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs.", "responses": { "200": { "content": { @@ -6187,7 +6176,7 @@ "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))$" }, "syncs": { - "description": "Present when attach=syncs", + "description": "Present when include=syncs", "type": "array", "items": { "type": "object", @@ -6316,7 +6305,7 @@ } }, "picker": { - "description": "Present when attach=picker. Null for connectors that sync everything.", + "description": "Present when include=picker. Null for connectors that sync everything.", "anyOf": [ { "type": "object", @@ -6763,7 +6752,7 @@ "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))$" }, "syncs": { - "description": "Present when attach=syncs", + "description": "Present when include=syncs", "type": "array", "items": { "type": "object", @@ -6892,7 +6881,7 @@ } }, "picker": { - "description": "Present when attach=picker. Null for connectors that sync everything.", + "description": "Present when include=picker. Null for connectors that sync everything.", "anyOf": [ { "type": "object", @@ -7288,285 +7277,116 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Internal identifier for the namespace" - }, - "namespace": { - "type": "string", - "description": "Namespace identifier used in API paths" - }, - "documentCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of active source documents in the namespace" - }, - "memoryCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of current, recallable memories in the namespace" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable purpose or scope of the namespace" - }, - "system": { + "type": "object", + "properties": { + "namespaces": { + "type": "array", + "items": { "type": "object", "properties": { - "createdAt": { + "id": { "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp when the namespace was created" + "description": "Internal identifier for the namespace" }, - "updatedAt": { + "namespace": { "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp of the latest namespace update" - } - }, - "required": [ - "createdAt", - "updatedAt" - ], - "description": "Namespace lifecycle timestamps" - } - }, - "required": [ - "id", - "namespace", - "documentCount", - "memoryCount", - "description", - "system" - ] - } - } - } - }, - "description": "Namespaces available to the caller" - }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "description": "The API key cannot access this endpoint or namespace", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Internal server error" - } - }, - "summary": "List namespaces", - "tags": [ - "Namespaces" - ] - } - }, - "/ns": { - "get": { - "operationId": "getNs", - "description": "Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Internal identifier for the namespace" - }, - "namespace": { - "type": "string", - "description": "Namespace identifier used in API paths" - }, - "documentCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of active source documents in the namespace" - }, - "memoryCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of current, recallable memories in the namespace" - }, - "description": { - "anyOf": [ - { - "type": "string" + "description": "Namespace identifier used in API paths" }, - { - "type": "null" - } - ], - "description": "Human-readable purpose or scope of the namespace" - }, - "system": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp when the namespace was created" + "documentCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of active source documents in the namespace" }, - "updatedAt": { - "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp of the latest namespace update" + "memoryCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of current, recallable memories in the namespace" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable purpose or scope of the namespace" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the namespace was created" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp of the latest namespace update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Namespace lifecycle timestamps" } }, "required": [ - "createdAt", - "updatedAt" - ], - "description": "Namespace lifecycle timestamps" - } - }, - "required": [ - "id", - "namespace", - "documentCount", - "memoryCount", - "description", - "system" - ] - } - } - } - }, - "description": "Namespaces available to the caller" - }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "description": "The API key cannot access this endpoint or namespace", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Internal server error" - } - }, - "summary": "List namespaces", - "tags": [ - "Namespaces" - ] - } - }, - "/ns/{namespace}": { - "get": { - "operationId": "getNsByNamespace", - "description": "Read the supporting context that helps Supermemory understand content and form better memories inside this namespace.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "namespace": { - "type": "string", - "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" + "id", + "namespace", + "documentCount", + "memoryCount", + "description", + "system" + ] + }, + "description": "Namespaces on this page, newest first" }, - "system": { + "pagination": { "type": "object", "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp when the namespace was created" + "currentPage": { + "type": "number" }, - "updatedAt": { - "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp of the latest settings update" + "limit": { + "default": 10, + "type": "number", + "maximum": 1100 + }, + "totalItems": { + "type": "number" + }, + "totalPages": { + "type": "number" } }, "required": [ - "createdAt", - "updatedAt" + "currentPage", + "totalItems", + "totalPages" ], - "description": "Namespace lifecycle timestamps" + "description": "Pagination metadata", + "example": { + "currentPage": 1, + "limit": 10, + "totalItems": 100, + "totalPages": 10 + } } }, "required": [ - "namespace", - "supportingContext", - "system" + "namespaces", + "pagination" ] } } }, - "description": "Namespace settings" + "description": "Namespaces available to the caller" }, "400": { "description": "Invalid request", @@ -7596,24 +7416,14 @@ "description": "Unauthorized" }, "403": { + "description": "The API key cannot access this endpoint or namespace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - }, - "description": "Namespace access denied" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Namespace not found" + } }, "500": { "content": { @@ -7626,68 +7436,238 @@ "description": "Internal server error" } }, - "summary": "Get namespace settings", + "summary": "List namespaces", "tags": [ "Namespaces" ], "parameters": [ { - "in": "path", - "name": "namespace", + "in": "query", + "name": "page", "schema": { - "type": "string", - "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" + "default": 1, + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 }, - "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." - } - ] - }, - "patch": { - "operationId": "patchNsByNamespace", - "parameters": [ + "description": "One-based page number" + }, { - "in": "path", - "name": "namespace", + "in": "query", + "name": "limit", "schema": { - "type": "string", - "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$", - "example": "user_alex" - }, - "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." + "default": 10, + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "description": "Maximum namespaces to return per page" } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "supportingContext": { - "description": "Background that guides how Supermemory interprets documents and forms memories. Max 1500 characters. Set null to clear it.", - "example": "This namespace holds Acme Corp support tickets.", - "anyOf": [ - { - "type": "string", - "maxLength": 1500 + ] + } + }, + "/ns": { + "get": { + "operationId": "getNs", + "description": "Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "namespaces": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Internal identifier for the namespace" + }, + "namespace": { + "type": "string", + "description": "Namespace identifier used in API paths" + }, + "documentCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of active source documents in the namespace" + }, + "memoryCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of current, recallable memories in the namespace" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable purpose or scope of the namespace" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the namespace was created" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp of the latest namespace update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Namespace lifecycle timestamps" + } + }, + "required": [ + "id", + "namespace", + "documentCount", + "memoryCount", + "description", + "system" + ] }, - { - "type": "null" + "description": "Namespaces on this page, newest first" + }, + "pagination": { + "type": "object", + "properties": { + "currentPage": { + "type": "number" + }, + "limit": { + "default": 10, + "type": "number", + "maximum": 1100 + }, + "totalItems": { + "type": "number" + }, + "totalPages": { + "type": "number" + } + }, + "required": [ + "currentPage", + "totalItems", + "totalPages" + ], + "description": "Pagination metadata", + "example": { + "currentPage": 1, + "limit": 10, + "totalItems": 100, + "totalPages": 10 } - ] - } - }, - "additionalProperties": false + } + }, + "required": [ + "namespaces", + "pagination" + ] + } + } + }, + "description": "Namespaces available to the caller" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse" + }, + { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + ] + } + } + } + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "description": "The API key cannot access this endpoint or namespace", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } } } + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal server error" } }, - "description": "Shape how Supermemory understands an existing namespace by updating the background context used during ingestion and memory formation.", + "summary": "List namespaces", + "tags": [ + "Namespaces" + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "description": "One-based page number" + }, + { + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "description": "Maximum namespaces to return per page" + } + ] + } + }, + "/ns/{namespace}": { + "get": { + "operationId": "getNsByNamespace", + "description": "Read the supporting context that helps Supermemory understand content and form better memories inside this namespace.", "responses": { "200": { "content": { @@ -7739,10 +7719,10 @@ } } }, - "description": "Updated namespace settings" + "description": "Namespace settings" }, "400": { - "description": "Invalid namespace settings", + "description": "Invalid request", "content": { "application/json": { "schema": { @@ -7776,7 +7756,7 @@ } } }, - "description": "Write access required" + "description": "Namespace access denied" }, "404": { "content": { @@ -7799,40 +7779,208 @@ "description": "Internal server error" } }, - "summary": "Update namespace settings", + "summary": "Get namespace settings", "tags": [ "Namespaces" + ], + "parameters": [ + { + "in": "path", + "name": "namespace", + "schema": { + "type": "string", + "maxLength": 100, + "pattern": "^[a-zA-Z0-9_:-]+$", + "example": "user_alex" + }, + "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." + } ] }, - "delete": { - "operationId": "deleteNsByNamespace", - "description": "Retire a namespace by permanently deleting its content, or preserve that knowledge by moving everything into another namespace first. Moves are queued and complete asynchronously.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "const": true, - "description": "Confirms the namespace was deleted" - }, - "status": { - "type": "string", - "const": "deleted", - "description": "The namespace and its content are gone" - }, - "namespace": { - "type": "string", - "description": "Deleted namespace identifier" - }, - "deletedDocumentsCount": { - "type": "integer", - "minimum": 0, + "patch": { + "operationId": "patchNsByNamespace", + "parameters": [ + { + "in": "path", + "name": "namespace", + "schema": { + "type": "string", + "maxLength": 100, + "pattern": "^[a-zA-Z0-9_:-]+$", + "example": "user_alex" + }, + "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." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "supportingContext": { + "description": "Background that guides how Supermemory interprets documents and forms memories. Max 1500 characters. Set null to clear it.", + "example": "This namespace holds Acme Corp support tickets.", + "anyOf": [ + { + "type": "string", + "maxLength": 1500 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } + } + }, + "description": "Shape how Supermemory understands an existing namespace by updating the background context used during ingestion and memory formation.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "namespace": { + "type": "string", + "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" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the namespace was created" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp of the latest settings update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Namespace lifecycle timestamps" + } + }, + "required": [ + "namespace", + "supportingContext", + "system" + ] + } + } + }, + "description": "Updated namespace settings" + }, + "400": { + "description": "Invalid namespace settings", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse" + }, + { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + ] + } + } + } + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Write access required" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Namespace not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal server error" + } + }, + "summary": "Update namespace settings", + "tags": [ + "Namespaces" + ] + }, + "delete": { + "operationId": "deleteNsByNamespace", + "description": "Retire a namespace by permanently deleting its content, or preserve that knowledge by moving everything into another namespace first. Moves are queued and complete asynchronously.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "const": "deleted", + "description": "The namespace and its content are gone" + }, + "namespace": { + "type": "string", + "description": "Deleted namespace identifier" + }, + "deletedDocumentsCount": { + "type": "integer", + "minimum": 0, "maximum": 9007199254740991, "description": "Number of documents permanently removed" }, @@ -7844,7 +7992,6 @@ } }, "required": [ - "success", "status", "namespace", "deletedDocumentsCount", @@ -7854,11 +8001,6 @@ { "type": "object", "properties": { - "success": { - "type": "boolean", - "const": true, - "description": "Confirms the namespace move was accepted" - }, "status": { "type": "string", "const": "queued", @@ -7878,7 +8020,6 @@ } }, "required": [ - "success", "status", "operationId", "namespace", @@ -7897,11 +8038,6 @@ "schema": { "type": "object", "properties": { - "success": { - "type": "boolean", - "const": true, - "description": "Confirms the namespace move was accepted" - }, "status": { "type": "string", "const": "queued", @@ -7921,7 +8057,6 @@ } }, "required": [ - "success", "status", "operationId", "namespace", @@ -7930,10 +8065,911 @@ } } }, - "description": "Namespace move queued" + "description": "Namespace move queued" + }, + "400": { + "description": "Invalid move destination", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse" + }, + { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + ] + } + } + } + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Write access required" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Namespace not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Namespace is busy" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal server error" + } + }, + "summary": "Delete namespace", + "tags": [ + "Namespaces" + ], + "parameters": [ + { + "in": "path", + "name": "namespace", + "schema": { + "type": "string", + "maxLength": 100, + "pattern": "^[a-zA-Z0-9_:-]+$", + "example": "user_alex" + }, + "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." + }, + { + "in": "query", + "name": "moveTo", + "schema": { + "example": "project_archive", + "type": "string", + "maxLength": 100, + "pattern": "^[a-zA-Z0-9_:-]+$" + }, + "description": "Destination namespace that should receive this namespace's content before deletion. Omit to permanently delete the content." + } + ] + } + }, + "/organization": { + "get": { + "operationId": "getOrganization", + "description": "Read the shared background that guides memory formation across the organization, together with the number of active namespaces.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "organizationalContext": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Shared background that helps Supermemory interpret content consistently across every namespace" + }, + "namespaceCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of namespaces in the organization" + } + }, + "required": [ + "organizationalContext", + "namespaceCount" + ] + } + } + }, + "description": "Organization settings retrieved successfully" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "description": "The API key cannot access this endpoint or namespace", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal server error" + } + }, + "summary": "Get organization settings", + "tags": [ + "Organization" + ] + }, + "patch": { + "operationId": "patchOrganization", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "organizationalContext": { + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "null" + } + ], + "description": "Shared background that guides memory formation across every namespace. Set null to clear it.", + "example": "Acme Corp builds developer tools for startups." + } + }, + "required": [ + "organizationalContext" + ], + "additionalProperties": false + } + } + } + }, + "description": "Give Supermemory organization-wide background that improves how content is interpreted across every namespace. Send null to remove the existing context.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "organizationalContext": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Shared background that helps Supermemory interpret content consistently across every namespace" + }, + "namespaceCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of namespaces in the organization" + } + }, + "required": [ + "organizationalContext", + "namespaceCount" + ] + } + } + }, + "description": "Organization settings updated successfully" + }, + "400": { + "description": "Invalid organization settings", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse" + }, + { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + ] + } + } + } + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Admin access required" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal server error" + } + }, + "summary": "Update organization settings", + "tags": [ + "Organization" + ] + } + }, + "/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.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable memory identifier" + }, + "memory": { + "type": "string", + "description": "Learned fact or context extracted from the document" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Memory metadata, including temporal context; empty object when none" + }, + "isStatic": { + "type": "boolean", + "description": "Whether the memory belongs to the stable profile section" + }, + "isInference": { + "type": "boolean", + "description": "Whether the memory was inferred rather than explicitly stated" + }, + "isLatest": { + "type": "boolean", + "description": "Whether this is the newest version in its memory chain" + }, + "isForgotten": { + "type": "boolean", + "description": "Whether this memory has been excluded from normal recall" + }, + "version": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Version number within the memory chain" + }, + "system": { + "type": "object", + "properties": { + "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))$", + "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))$", + "description": "ISO 8601 timestamp of the latest update to this version" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" + }, + "included": { + "description": "Requested extras", + "type": "object", + "properties": { + "related": { + "description": "Present when include has related", + "type": "object", + "properties": { + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, + "relation": { + "type": "string", + "enum": [ + "updates", + "extends", + "derives" + ], + "description": "How this memory is connected to the matched memory" + }, + "version": { + "description": "Version number within the related memory's history", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "memory": { + "type": "string", + "description": "Related learned fact or context" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" + }, + "system": { + "type": "object", + "properties": { + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the related memory's latest update" + } + }, + "required": [ + "updatedAt" + ], + "description": "Lifecycle details for the related memory" + }, + "document": { + "description": "Source document; present when include has both related and documents", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Source document identifier" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Source document title" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Detected source or content type" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata attached to the source document" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Generated summary of the source document" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp when the source document was created" + }, + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the source document's latest update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" + } + }, + "required": [ + "id", + "title", + "type", + "metadata", + "summary", + "system" + ] + } + }, + "required": [ + "id", + "relation", + "memory", + "metadata", + "system" + ] + }, + "description": "Earlier versions this memory updates, nearest first" + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, + "relation": { + "type": "string", + "enum": [ + "updates", + "extends", + "derives" + ], + "description": "How this memory is connected to the matched memory" + }, + "version": { + "description": "Version number within the related memory's history", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "memory": { + "type": "string", + "description": "Related learned fact or context" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" + }, + "system": { + "type": "object", + "properties": { + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the related memory's latest update" + } + }, + "required": [ + "updatedAt" + ], + "description": "Lifecycle details for the related memory" + }, + "document": { + "description": "Source document; present when include has both related and documents", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Source document identifier" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Source document title" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Detected source or content type" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata attached to the source document" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Generated summary of the source document" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp when the source document was created" + }, + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the source document's latest update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" + } + }, + "required": [ + "id", + "title", + "type", + "metadata", + "summary", + "system" + ] + } + }, + "required": [ + "id", + "relation", + "memory", + "metadata", + "system" + ] + }, + "description": "Newer versions that update this memory, nearest first" + }, + "siblings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Related memory ID" + }, + "relation": { + "type": "string", + "enum": [ + "updates", + "extends", + "derives" + ], + "description": "How this memory is connected to the matched memory" + }, + "version": { + "description": "Version number within the related memory's history", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "memory": { + "type": "string", + "description": "Related learned fact or context" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata associated with the related memory" + }, + "system": { + "type": "object", + "properties": { + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the related memory's latest update" + } + }, + "required": [ + "updatedAt" + ], + "description": "Lifecycle details for the related memory" + }, + "document": { + "description": "Source document; present when include has both related and documents", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Source document identifier" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Source document title" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Detected source or content type" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata attached to the source document" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Generated summary of the source document" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp when the source document was created" + }, + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the source document's latest update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" + } + }, + "required": [ + "id", + "title", + "type", + "metadata", + "summary", + "system" + ] + } + }, + "required": [ + "id", + "relation", + "memory", + "metadata", + "system" + ] + }, + "description": "Memories connected by extends or derives, nearest first" + } + }, + "required": [ + "parents", + "children", + "siblings" + ] + }, + "document": { + "description": "Source document; present when include has documents and one exists", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Source document identifier" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Source document title" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Detected source or content type" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Public metadata attached to the source document" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Generated summary of the source document" + }, + "system": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp when the source document was created" + }, + "updatedAt": { + "type": "string", + "description": "ISO 8601 timestamp of the source document's latest update" + } + }, + "required": [ + "createdAt", + "updatedAt" + ], + "description": "Lifecycle timestamps maintained by Supermemory" + } + }, + "required": [ + "id", + "title", + "type", + "metadata", + "summary", + "system" + ] + } + } + } + }, + "required": [ + "id", + "memory", + "metadata", + "isStatic", + "isInference", + "isLatest", + "isForgotten", + "version", + "system" + ] + } + } + }, + "description": "Memory retrieved" }, "400": { - "description": "Invalid move destination", + "description": "Invalid request", "content": { "application/json": { "schema": { @@ -7967,7 +9003,7 @@ } } }, - "description": "Write access required" + "description": "Namespace access denied" }, "404": { "content": { @@ -7977,17 +9013,7 @@ } } }, - "description": "Namespace not found" - }, - "409": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Namespace is busy" + "description": "Memory not found" }, "500": { "content": { @@ -7997,12 +9023,12 @@ } } }, - "description": "Internal server error" + "description": "Server error" } }, - "summary": "Delete namespace", + "summary": "Get memory", "tags": [ - "Namespaces" + "Content Management" ], "parameters": [ { @@ -8015,223 +9041,47 @@ "example": "user_alex" }, "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." - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "default": {}, - "type": "object", - "properties": { - "moveTo": { - "description": "Destination namespace that should receive this namespace's content before deletion. Omit to permanently delete the content.", - "example": "project_archive", - "type": "string", - "maxLength": 100, - "pattern": "^[a-zA-Z0-9_:-]+$" - } - }, - "additionalProperties": false - } - } - } - } - } - }, - "/organization": { - "get": { - "operationId": "getOrganization", - "description": "Read the shared background that guides memory formation across the organization, together with the number of active namespaces.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "organizationalContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Shared background that helps Supermemory interpret content consistently across every namespace" - }, - "namespaceCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of namespaces in the organization" - } - }, - "required": [ - "organizationalContext", - "namespaceCount" - ] - } - } - }, - "description": "Organization settings retrieved successfully" - }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "description": "The API key cannot access this endpoint or namespace", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - }, - "description": "Internal server error" - } - }, - "summary": "Get organization settings", - "tags": [ - "Organization" - ] - }, - "patch": { - "operationId": "patchOrganization", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "organizationalContext": { - "anyOf": [ - { - "type": "string", - "minLength": 1 - }, - { - "type": "null" - } - ], - "description": "Shared background that guides memory formation across every namespace. Set null to clear it.", - "example": "Acme Corp builds developer tools for startups." - } - }, - "required": [ - "organizationalContext" - ], - "additionalProperties": false - } - } - } - }, - "description": "Give Supermemory organization-wide background that improves how content is interpreted across every namespace. Send null to remove the existing context.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "organizationalContext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Shared background that helps Supermemory interpret content consistently across every namespace" - }, - "namespaceCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of namespaces in the organization" - } - }, - "required": [ - "organizationalContext", - "namespaceCount" - ] - } - } - }, - "description": "Organization settings updated successfully" - }, - "400": { - "description": "Invalid organization settings", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ErrorResponse" - }, - { - "$ref": "#/components/schemas/ValidationErrorResponse" - } - ] - } - } - } + "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." }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "example": "mem_abc123" }, - "description": "Unauthorized" + "required": true, + "description": "Memory identifier" }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + { + "in": "query", + "name": "include", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "related", + "documents" + ] + }, + "style": "form", + "explode": false }, - "description": "Admin access required" + "description": "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." }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + { + "in": "query", + "name": "relatedLimit", + "schema": { + "default": 10, + "type": "integer", + "minimum": 1, + "maximum": 100 }, - "description": "Internal server error" + "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." } - }, - "summary": "Update organization settings", - "tags": [ - "Organization" ] } } diff --git a/fern/overlay.yaml b/fern/overlay.yaml index 3148c24..6370f3c 100644 --- a/fern/overlay.yaml +++ b/fern/overlay.yaml @@ -21,6 +21,7 @@ actions: # memories - { target: '$.paths["/ns/{namespace}/memories"].delete', update: { x-fern-sdk-group-name: memories, x-fern-sdk-method-name: forget } } - { target: '$.paths["/ns/{namespace}/memories/semantic"].delete', update: { x-fern-sdk-group-name: memories, x-fern-sdk-method-name: forget_matching } } + - { target: '$.paths["/ns/{namespace}/memories/{id}"].get', update: { x-fern-sdk-group-name: memories, x-fern-sdk-method-name: get } } # profiles - { target: '$.paths["/ns/{namespace}/profile/buckets"].get', update: { x-fern-sdk-group-name: profiles, x-fern-sdk-method-name: get_buckets } } - { target: '$.paths["/ns/{namespace}/profile/buckets"].put', update: { x-fern-sdk-group-name: profiles, x-fern-sdk-method-name: set_buckets } } diff --git a/reference.md b/reference.md index 68b18ce..2c13811 100644 --- a/reference.md +++ b/reference.md @@ -69,7 +69,7 @@ client.add(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**id:** `typing.Optional[str]` — An optional caller-defined document ID
@@ -77,7 +77,7 @@ client.add(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters.
@@ -85,7 +85,7 @@ client.add(
-**id:** `typing.Optional[str]` — An optional caller-defined document ID +**metadata:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Arbitrary metadata attached to the document and derived data
@@ -93,7 +93,7 @@ client.add(
-**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters. +**group:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Metadata values that isolate related context within the namespace
@@ -101,7 +101,7 @@ client.add(
-**metadata:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Arbitrary metadata attached to the document and derived data +**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format
@@ -109,7 +109,7 @@ client.add(
-**group:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Metadata values that isolate related context within the namespace +**task_type:** `typing.Optional[AddRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -117,7 +117,7 @@ client.add(
-**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format +**dreaming:** `typing.Optional[AddRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -174,7 +174,6 @@ client = Supermemory( client.search( namespace="user_alex", - limit=10, query="what are the API rate limits", ) @@ -208,7 +207,7 @@ client.search(
-**limit:** `typing.Optional[int]` — Maximum number of results to return +**filter:** `typing.Optional[FilterExpression]` — Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type.
@@ -216,7 +215,7 @@ client.search(
-**search_mode:** `typing.Optional[SearchMode]` — Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. +**search_mode:** `typing.Optional[SearchRequestSearchMode]` — Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages.
@@ -224,7 +223,7 @@ client.search(
-**filter:** `typing.Optional[FilterExpression]` — Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. +**limit:** `typing.Optional[int]` — Maximum number of results to return
@@ -232,7 +231,7 @@ client.search(
-**attach:** `typing.Optional[SearchRequestAttach]` — Optional context to include alongside each matching result +**include:** `typing.Optional[SearchRequestInclude]` — Optional context to include alongside each matching result
@@ -403,6 +402,8 @@ client = Supermemory( client.list( namespace="user_alex", type="documents", + page=1, + limit=10, ) ``` @@ -435,7 +436,7 @@ client.list(
-**page:** `typing.Optional[ListRequestPage]` — One-based page number +**page:** `typing.Optional[int]` — One-based page number
@@ -443,7 +444,7 @@ client.list(
-**limit:** `typing.Optional[ListRequestLimit]` — Maximum resources to return per page +**limit:** `typing.Optional[int]` — Maximum resources to return per page
@@ -475,6 +476,14 @@ client.list(
+**include:** `typing.Optional[ListRequestInclude]` — Optional extras, matching search's include + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -646,7 +655,7 @@ client.documents.batch_add(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[BatchAddDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -654,7 +663,7 @@ client.documents.batch_add(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[BatchAddDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -686,7 +695,7 @@ client.documents.batch_add(
-Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response. +Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response.
@@ -744,7 +753,7 @@ client.documents.get(
-**attach:** `typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]]` — Child resources to include. Repeat the parameter to attach chunks, memories, or both. +**include:** `typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]]` — Comma-separated child resources to include: chunks, memories, or both.
@@ -834,7 +843,7 @@ client.documents.update(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**content:** `typing.Optional[str]` — The content to process. This may be plaintext or a URL to supported rich content.
@@ -842,7 +851,7 @@ client.documents.update(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters.
@@ -850,7 +859,7 @@ client.documents.update(
-**content:** `typing.Optional[str]` — The content to process. This may be plaintext or a URL to supported rich content. +**metadata:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Arbitrary metadata attached to the document and derived data
@@ -858,7 +867,7 @@ client.documents.update(
-**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters. +**group:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Metadata values that isolate related context within the namespace
@@ -866,7 +875,7 @@ client.documents.update(
-**metadata:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Arbitrary metadata attached to the document and derived data +**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format
@@ -874,7 +883,7 @@ client.documents.update(
-**group:** `typing.Optional[typing.Dict[str, MetadataValue]]` — Metadata values that isolate related context within the namespace +**task_type:** `typing.Optional[UpdateDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -882,7 +891,7 @@ client.documents.update(
-**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format +**dreaming:** `typing.Optional[UpdateDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -902,7 +911,7 @@ client.documents.update(
-
client.documents.upload_file(...) -> FileUploadResult +
client.documents.upload_file(...) -> DocumentRef
@@ -972,7 +981,7 @@ client.documents.upload_file(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters.
@@ -980,7 +989,7 @@ client.documents.upload_file(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories
@@ -988,7 +997,7 @@ client.documents.upload_file(
-**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient +**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall
@@ -996,7 +1005,7 @@ client.documents.upload_file(
-**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient +**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format
@@ -1004,7 +1013,7 @@ client.documents.upload_file(
-**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters. +**task_type:** `typing.Optional[UploadFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1012,7 +1021,7 @@ client.documents.upload_file(
-**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories +**dreaming:** `typing.Optional[UploadFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1020,7 +1029,7 @@ client.documents.upload_file(
-**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall +**file_type:** `typing.Optional[UploadFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient
@@ -1028,7 +1037,7 @@ client.documents.upload_file(
-**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format +**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient
@@ -1048,7 +1057,7 @@ client.documents.upload_file(
-
client.documents.replace_with_file(...) -> FileUploadResult +
client.documents.replace_with_file(...) -> DocumentRef
@@ -1127,7 +1136,7 @@ client.documents.replace_with_file(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters.
@@ -1135,7 +1144,7 @@ client.documents.replace_with_file(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories
@@ -1143,7 +1152,7 @@ client.documents.replace_with_file(
-**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient +**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall
@@ -1151,7 +1160,7 @@ client.documents.replace_with_file(
-**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient +**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format
@@ -1159,7 +1168,7 @@ client.documents.replace_with_file(
-**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters. +**task_type:** `typing.Optional[ReplaceWithFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1167,7 +1176,7 @@ client.documents.replace_with_file(
-**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories +**dreaming:** `typing.Optional[ReplaceWithFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1175,7 +1184,7 @@ client.documents.replace_with_file(
-**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall +**file_type:** `typing.Optional[ReplaceWithFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient
@@ -1183,7 +1192,7 @@ client.documents.replace_with_file(
-**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format +**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient
@@ -1203,7 +1212,7 @@ client.documents.replace_with_file(
-
client.documents.update_file(...) -> FileUploadResult +
client.documents.update_file(...) -> DocumentRef
@@ -1274,7 +1283,7 @@ client.documents.update_file(
-**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**file:** `typing.Optional[core.File]` — File contents to upload
@@ -1282,7 +1291,7 @@ client.documents.update_file(
-**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters.
@@ -1290,7 +1299,7 @@ client.documents.update_file(
-**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient +**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories
@@ -1298,7 +1307,7 @@ client.documents.update_file(
-**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient +**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall
@@ -1306,7 +1315,7 @@ client.documents.update_file(
-**file:** `typing.Optional[core.File]` — File contents to upload +**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format
@@ -1314,7 +1323,7 @@ client.documents.update_file(
-**supporting_context:** `typing.Optional[str]` — Context used to guide memory extraction within this namespace. Max 1500 characters. +**task_type:** `typing.Optional[UpdateFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1322,7 +1331,7 @@ client.documents.update_file(
-**metadata:** `typing.Optional[str]` — JSON-encoded metadata to attach to the document and its derived memories +**dreaming:** `typing.Optional[UpdateFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1330,7 +1339,7 @@ client.documents.update_file(
-**group:** `typing.Optional[str]` — JSON-encoded metadata used to keep related context isolated during processing and recall +**file_type:** `typing.Optional[UpdateFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient
@@ -1338,7 +1347,7 @@ client.documents.update_file(
-**date:** `typing.Optional[str]` — When the source content is from, in ISO 8601 format +**mime_type:** `typing.Optional[str]` — Explicit MIME type used when upload metadata is insufficient
@@ -1772,6 +1781,104 @@ client.memories.forget_matching(
+ + +
+ +
client.memories.get(...) -> GetMemoriesResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from supermemory import Supermemory +from supermemory.environment import SupermemoryEnvironment + +client = Supermemory( + api_key="", + environment=SupermemoryEnvironment.DEFAULT, +) + +client.memories.get( + namespace="user_alex", + id="mem_abc123", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**namespace:** `str` — 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. + +
+
+ +
+
+ +**id:** `str` — Memory identifier + +
+
+ +
+
+ +**include:** `typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]]` — 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. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -2057,7 +2164,7 @@ client.connectors.create(
-Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs. +Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs.
@@ -2115,7 +2222,7 @@ client.connectors.get(
-**attach:** `typing.Optional[str]` — Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. +**include:** `typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]]` — Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL.
@@ -2414,7 +2521,7 @@ client.connectors.sync(
## Namespaces -
client.namespaces.list() -> typing.List[Namespace] +
client.namespaces.list(...) -> ListNamespacesResponse
@@ -2465,6 +2572,22 @@ client.namespaces.list()
+**page:** `typing.Optional[int]` — One-based page number + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Maximum namespaces to return per page + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2587,6 +2710,7 @@ client = Supermemory( client.namespaces.delete( namespace="user_alex", + move_to="project_archive", ) ``` diff --git a/src/supermemory/__init__.py b/src/supermemory/__init__.py index df6ca31..4b52757 100644 --- a/src/supermemory/__init__.py +++ b/src/supermemory/__init__.py @@ -7,8 +7,11 @@ if typing.TYPE_CHECKING: from .types import ( + AddRequestDreaming, + AddRequestTaskType, BadRequestErrorBody, BatchAddItemResult, + BatchAddItemResultStatus, BatchAddResult, Chunk, ChunkListItem, @@ -51,15 +54,14 @@ DeleteDocumentError, DeleteDocumentsResult, Document, - DocumentAttachment, DocumentInput, DocumentListItem, + DocumentListItemSystem, DocumentRef, + DocumentRefStatus, DocumentSystem, - DreamingMode, + DocumentSystemStatus, ErrorResponse, - FileType, - FileUploadResult, FilterAnd, FilterArrayContains, FilterArrayContainsOperator, @@ -81,8 +83,7 @@ GoogleDriveConfig, GoogleDriveConfigSyncScope, GranolaConfig, - ListRequestLimit, - ListRequestPage, + ListRequestInclude, ListResponse, ListSort, ListType, @@ -90,14 +91,13 @@ MemoryRelation, MemorySystem, MetadataValue, - Namespace, NamespaceDeleted, NamespaceDeletedDeleted, NamespaceDeletedQueued, NamespaceDeleted_Deleted, NamespaceDeleted_Queued, NamespaceDetails, - NamespaceSystem, + NamespaceDetailsSystem, Organization, Pagination, Profile, @@ -108,16 +108,16 @@ RelatedMemory, RelatedMemorySystem, S3Config, - SearchMode, - SearchRequestAttach, + SearchRequestInclude, SearchRequestRerank, + SearchRequestSearchMode, SearchResponse, SearchResult, SearchResultIncluded, SearchResultIncludedDocument, + SearchResultIncludedDocumentSystem, SearchResultSystem, SortOrder, - TaskType, ValidationErrorResponse, ValidationErrorResponseErrorItem, ValidationErrorResponseErrorItemPathItem, @@ -131,7 +131,69 @@ ) from . import connectors, documents, memories, namespaces, organization, profiles from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient + from .connectors import GetConnectorsRequestIncludeItem + from .documents import ( + BatchAddDocumentsRequestDreaming, + BatchAddDocumentsRequestTaskType, + GetDocumentsRequestIncludeItem, + ReplaceWithFileDocumentsRequestDreaming, + ReplaceWithFileDocumentsRequestFileType, + ReplaceWithFileDocumentsRequestTaskType, + UpdateDocumentsRequestDreaming, + UpdateDocumentsRequestTaskType, + UpdateFileDocumentsRequestDreaming, + UpdateFileDocumentsRequestFileType, + UpdateFileDocumentsRequestTaskType, + UploadFileDocumentsRequestDreaming, + UploadFileDocumentsRequestFileType, + UploadFileDocumentsRequestTaskType, + ) from .environment import SupermemoryEnvironment + from .memories import ( + GetMemoriesRequestIncludeItem, + GetMemoriesResponse, + GetMemoriesResponseIncluded, + GetMemoriesResponseIncludedDocument, + GetMemoriesResponseIncludedDocumentParams, + GetMemoriesResponseIncludedDocumentSystem, + GetMemoriesResponseIncludedDocumentSystemParams, + GetMemoriesResponseIncludedParams, + GetMemoriesResponseIncludedRelated, + GetMemoriesResponseIncludedRelatedChildrenItem, + GetMemoriesResponseIncludedRelatedChildrenItemDocument, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedChildrenItemParams, + GetMemoriesResponseIncludedRelatedChildrenItemSystem, + GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, + GetMemoriesResponseIncludedRelatedParams, + GetMemoriesResponseIncludedRelatedParentsItem, + GetMemoriesResponseIncludedRelatedParentsItemDocument, + GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedParentsItemParams, + GetMemoriesResponseIncludedRelatedParentsItemSystem, + GetMemoriesResponseIncludedRelatedParentsItemSystemParams, + GetMemoriesResponseIncludedRelatedSiblingsItem, + GetMemoriesResponseIncludedRelatedSiblingsItemDocument, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedSiblingsItemParams, + GetMemoriesResponseIncludedRelatedSiblingsItemSystem, + GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, + GetMemoriesResponseParams, + ) + from .namespaces import ( + ListNamespacesResponse, + ListNamespacesResponseNamespacesItem, + ListNamespacesResponseNamespacesItemParams, + ListNamespacesResponseNamespacesItemSystem, + ListNamespacesResponseNamespacesItemSystemParams, + ListNamespacesResponseParams, + ) from .requests import ( BadRequestErrorBodyParams, BatchAddItemResultParams, @@ -173,11 +235,11 @@ DeleteDocumentsResultParams, DocumentInputParams, DocumentListItemParams, + DocumentListItemSystemParams, DocumentParams, DocumentRefParams, DocumentSystemParams, ErrorResponseParams, - FileUploadResultParams, FilterAndParams, FilterArrayContainsParams, FilterExpressionParams, @@ -193,8 +255,7 @@ ForgetResultParams, GoogleDriveConfigParams, GranolaConfigParams, - ListRequestLimitParams, - ListRequestPageParams, + ListRequestIncludeParams, ListResponseParams, MemoryParams, MemorySystemParams, @@ -205,8 +266,7 @@ NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams, NamespaceDetailsParams, - NamespaceParams, - NamespaceSystemParams, + NamespaceDetailsSystemParams, OrganizationParams, PaginationParams, ProfileBucketsParams, @@ -217,9 +277,10 @@ RelatedMemoryParams, RelatedMemorySystemParams, S3ConfigParams, - SearchRequestAttachParams, + SearchRequestIncludeParams, SearchResponseParams, SearchResultIncludedDocumentParams, + SearchResultIncludedDocumentSystemParams, SearchResultIncludedParams, SearchResultParams, SearchResultSystemParams, @@ -229,10 +290,15 @@ WebCrawlerConfigParams, ) _dynamic_imports: typing.Dict[str, str] = { + "AddRequestDreaming": ".types", + "AddRequestTaskType": ".types", "BadRequestErrorBody": ".types", "BadRequestErrorBodyParams": ".requests", + "BatchAddDocumentsRequestDreaming": ".documents", + "BatchAddDocumentsRequestTaskType": ".documents", "BatchAddItemResult": ".types", "BatchAddItemResultParams": ".requests", + "BatchAddItemResultStatus": ".types", "BatchAddResult": ".types", "BatchAddResultParams": ".requests", "Chunk": ".types", @@ -313,22 +379,21 @@ "DeleteDocumentsResult": ".types", "DeleteDocumentsResultParams": ".requests", "Document": ".types", - "DocumentAttachment": ".types", "DocumentInput": ".types", "DocumentInputParams": ".requests", "DocumentListItem": ".types", "DocumentListItemParams": ".requests", + "DocumentListItemSystem": ".types", + "DocumentListItemSystemParams": ".requests", "DocumentParams": ".requests", "DocumentRef": ".types", "DocumentRefParams": ".requests", + "DocumentRefStatus": ".types", "DocumentSystem": ".types", "DocumentSystemParams": ".requests", - "DreamingMode": ".types", + "DocumentSystemStatus": ".types", "ErrorResponse": ".types", "ErrorResponseParams": ".requests", - "FileType": ".types", - "FileUploadResult": ".types", - "FileUploadResultParams": ".requests", "FilterAnd": ".types", "FilterAndParams": ".requests", "FilterArrayContains": ".types", @@ -361,15 +426,56 @@ "ForgetMatchParams": ".requests", "ForgetResult": ".types", "ForgetResultParams": ".requests", + "GetConnectorsRequestIncludeItem": ".connectors", + "GetDocumentsRequestIncludeItem": ".documents", + "GetMemoriesRequestIncludeItem": ".memories", + "GetMemoriesResponse": ".memories", + "GetMemoriesResponseIncluded": ".memories", + "GetMemoriesResponseIncludedDocument": ".memories", + "GetMemoriesResponseIncludedDocumentParams": ".memories", + "GetMemoriesResponseIncludedDocumentSystem": ".memories", + "GetMemoriesResponseIncludedDocumentSystemParams": ".memories", + "GetMemoriesResponseIncludedParams": ".memories", + "GetMemoriesResponseIncludedRelated": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItem": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".memories", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".memories", + "GetMemoriesResponseIncludedRelatedParams": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItem": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemParams": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".memories", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItem": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".memories", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".memories", + "GetMemoriesResponseParams": ".memories", "GoogleDriveConfig": ".types", "GoogleDriveConfigParams": ".requests", "GoogleDriveConfigSyncScope": ".types", "GranolaConfig": ".types", "GranolaConfigParams": ".requests", - "ListRequestLimit": ".types", - "ListRequestLimitParams": ".requests", - "ListRequestPage": ".types", - "ListRequestPageParams": ".requests", + "ListNamespacesResponse": ".namespaces", + "ListNamespacesResponseNamespacesItem": ".namespaces", + "ListNamespacesResponseNamespacesItemParams": ".namespaces", + "ListNamespacesResponseNamespacesItemSystem": ".namespaces", + "ListNamespacesResponseNamespacesItemSystemParams": ".namespaces", + "ListNamespacesResponseParams": ".namespaces", + "ListRequestInclude": ".types", + "ListRequestIncludeParams": ".requests", "ListResponse": ".types", "ListResponseParams": ".requests", "ListSort": ".types", @@ -381,7 +487,6 @@ "MemorySystemParams": ".requests", "MetadataValue": ".types", "MetadataValueParams": ".requests", - "Namespace": ".types", "NamespaceDeleted": ".types", "NamespaceDeletedDeleted": ".types", "NamespaceDeletedDeletedParams": ".requests", @@ -394,9 +499,8 @@ "NamespaceDeleted_QueuedParams": ".requests", "NamespaceDetails": ".types", "NamespaceDetailsParams": ".requests", - "NamespaceParams": ".requests", - "NamespaceSystem": ".types", - "NamespaceSystemParams": ".requests", + "NamespaceDetailsSystem": ".types", + "NamespaceDetailsSystemParams": ".requests", "Organization": ".types", "OrganizationParams": ".requests", "Pagination": ".types", @@ -416,18 +520,23 @@ "RelatedMemoryParams": ".requests", "RelatedMemorySystem": ".types", "RelatedMemorySystemParams": ".requests", + "ReplaceWithFileDocumentsRequestDreaming": ".documents", + "ReplaceWithFileDocumentsRequestFileType": ".documents", + "ReplaceWithFileDocumentsRequestTaskType": ".documents", "S3Config": ".types", "S3ConfigParams": ".requests", - "SearchMode": ".types", - "SearchRequestAttach": ".types", - "SearchRequestAttachParams": ".requests", + "SearchRequestInclude": ".types", + "SearchRequestIncludeParams": ".requests", "SearchRequestRerank": ".types", + "SearchRequestSearchMode": ".types", "SearchResponse": ".types", "SearchResponseParams": ".requests", "SearchResult": ".types", "SearchResultIncluded": ".types", "SearchResultIncludedDocument": ".types", "SearchResultIncludedDocumentParams": ".requests", + "SearchResultIncludedDocumentSystem": ".types", + "SearchResultIncludedDocumentSystemParams": ".requests", "SearchResultIncludedParams": ".requests", "SearchResultParams": ".requests", "SearchResultSystem": ".types", @@ -435,8 +544,15 @@ "ServiceUnavailableError": ".errors", "SortOrder": ".types", "SupermemoryEnvironment": ".environment", - "TaskType": ".types", "UnauthorizedError": ".errors", + "UpdateDocumentsRequestDreaming": ".documents", + "UpdateDocumentsRequestTaskType": ".documents", + "UpdateFileDocumentsRequestDreaming": ".documents", + "UpdateFileDocumentsRequestFileType": ".documents", + "UpdateFileDocumentsRequestTaskType": ".documents", + "UploadFileDocumentsRequestDreaming": ".documents", + "UploadFileDocumentsRequestFileType": ".documents", + "UploadFileDocumentsRequestTaskType": ".documents", "ValidationErrorResponse": ".types", "ValidationErrorResponseErrorItem": ".types", "ValidationErrorResponseErrorItemParams": ".requests", @@ -476,12 +592,17 @@ def __dir__(): __all__ = [ + "AddRequestDreaming", + "AddRequestTaskType", "AsyncSupermemory", "BadRequestError", "BadRequestErrorBody", "BadRequestErrorBodyParams", + "BatchAddDocumentsRequestDreaming", + "BatchAddDocumentsRequestTaskType", "BatchAddItemResult", "BatchAddItemResultParams", + "BatchAddItemResultStatus", "BatchAddResult", "BatchAddResultParams", "Chunk", @@ -563,22 +684,21 @@ def __dir__(): "DeleteDocumentsResult", "DeleteDocumentsResultParams", "Document", - "DocumentAttachment", "DocumentInput", "DocumentInputParams", "DocumentListItem", "DocumentListItemParams", + "DocumentListItemSystem", + "DocumentListItemSystemParams", "DocumentParams", "DocumentRef", "DocumentRefParams", + "DocumentRefStatus", "DocumentSystem", "DocumentSystemParams", - "DreamingMode", + "DocumentSystemStatus", "ErrorResponse", "ErrorResponseParams", - "FileType", - "FileUploadResult", - "FileUploadResultParams", "FilterAnd", "FilterAndParams", "FilterArrayContains", @@ -611,16 +731,57 @@ def __dir__(): "ForgetMatchParams", "ForgetResult", "ForgetResultParams", + "GetConnectorsRequestIncludeItem", + "GetDocumentsRequestIncludeItem", + "GetMemoriesRequestIncludeItem", + "GetMemoriesResponse", + "GetMemoriesResponseIncluded", + "GetMemoriesResponseIncludedDocument", + "GetMemoriesResponseIncludedDocumentParams", + "GetMemoriesResponseIncludedDocumentSystem", + "GetMemoriesResponseIncludedDocumentSystemParams", + "GetMemoriesResponseIncludedParams", + "GetMemoriesResponseIncludedRelated", + "GetMemoriesResponseIncludedRelatedChildrenItem", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", + "GetMemoriesResponseIncludedRelatedParams", + "GetMemoriesResponseIncludedRelatedParentsItem", + "GetMemoriesResponseIncludedRelatedParentsItemDocument", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedParentsItemParams", + "GetMemoriesResponseIncludedRelatedParentsItemSystem", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItem", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", + "GetMemoriesResponseParams", "GoogleDriveConfig", "GoogleDriveConfigParams", "GoogleDriveConfigSyncScope", "GranolaConfig", "GranolaConfigParams", "InternalServerError", - "ListRequestLimit", - "ListRequestLimitParams", - "ListRequestPage", - "ListRequestPageParams", + "ListNamespacesResponse", + "ListNamespacesResponseNamespacesItem", + "ListNamespacesResponseNamespacesItemParams", + "ListNamespacesResponseNamespacesItemSystem", + "ListNamespacesResponseNamespacesItemSystemParams", + "ListNamespacesResponseParams", + "ListRequestInclude", + "ListRequestIncludeParams", "ListResponse", "ListResponseParams", "ListSort", @@ -632,7 +793,6 @@ def __dir__(): "MemorySystemParams", "MetadataValue", "MetadataValueParams", - "Namespace", "NamespaceDeleted", "NamespaceDeletedDeleted", "NamespaceDeletedDeletedParams", @@ -645,9 +805,8 @@ def __dir__(): "NamespaceDeleted_QueuedParams", "NamespaceDetails", "NamespaceDetailsParams", - "NamespaceParams", - "NamespaceSystem", - "NamespaceSystemParams", + "NamespaceDetailsSystem", + "NamespaceDetailsSystemParams", "NotFoundError", "Organization", "OrganizationParams", @@ -668,18 +827,23 @@ def __dir__(): "RelatedMemoryParams", "RelatedMemorySystem", "RelatedMemorySystemParams", + "ReplaceWithFileDocumentsRequestDreaming", + "ReplaceWithFileDocumentsRequestFileType", + "ReplaceWithFileDocumentsRequestTaskType", "S3Config", "S3ConfigParams", - "SearchMode", - "SearchRequestAttach", - "SearchRequestAttachParams", + "SearchRequestInclude", + "SearchRequestIncludeParams", "SearchRequestRerank", + "SearchRequestSearchMode", "SearchResponse", "SearchResponseParams", "SearchResult", "SearchResultIncluded", "SearchResultIncludedDocument", "SearchResultIncludedDocumentParams", + "SearchResultIncludedDocumentSystem", + "SearchResultIncludedDocumentSystemParams", "SearchResultIncludedParams", "SearchResultParams", "SearchResultSystem", @@ -688,8 +852,15 @@ def __dir__(): "SortOrder", "Supermemory", "SupermemoryEnvironment", - "TaskType", "UnauthorizedError", + "UpdateDocumentsRequestDreaming", + "UpdateDocumentsRequestTaskType", + "UpdateFileDocumentsRequestDreaming", + "UpdateFileDocumentsRequestFileType", + "UpdateFileDocumentsRequestTaskType", + "UploadFileDocumentsRequestDreaming", + "UploadFileDocumentsRequestFileType", + "UploadFileDocumentsRequestTaskType", "ValidationErrorResponse", "ValidationErrorResponseErrorItem", "ValidationErrorResponseErrorItemParams", diff --git a/src/supermemory/client.py b/src/supermemory/client.py index 7999535..2e4c47d 100644 --- a/src/supermemory/client.py +++ b/src/supermemory/client.py @@ -15,21 +15,20 @@ from .environment import SupermemoryEnvironment from .raw_client import AsyncRawSupermemory, RawSupermemory from .requests.filter_expression import FilterExpressionParams -from .requests.list_request_limit import ListRequestLimitParams -from .requests.list_request_page import ListRequestPageParams +from .requests.list_request_include import ListRequestIncludeParams from .requests.metadata_value import MetadataValueParams -from .requests.search_request_attach import SearchRequestAttachParams +from .requests.search_request_include import SearchRequestIncludeParams +from .types.add_request_dreaming import AddRequestDreaming +from .types.add_request_task_type import AddRequestTaskType from .types.document_ref import DocumentRef -from .types.dreaming_mode import DreamingMode from .types.list_response import ListResponse from .types.list_sort import ListSort from .types.list_type import ListType from .types.profile_response import ProfileResponse -from .types.search_mode import SearchMode from .types.search_request_rerank import SearchRequestRerank +from .types.search_request_search_mode import SearchRequestSearchMode from .types.search_response import SearchResponse from .types.sort_order import SortOrder -from .types.task_type import TaskType if typing.TYPE_CHECKING: from .connectors.client import AsyncConnectorsClient, ConnectorsClient @@ -154,13 +153,13 @@ def add( namespace: str, *, content: str, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, id: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[AddRequestTaskType] = OMIT, + dreaming: typing.Optional[AddRequestDreaming] = 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, @@ -178,12 +177,6 @@ def add( content : str The content to process. This may be plaintext or a URL to supported rich content. - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - id : typing.Optional[str] An optional caller-defined document ID @@ -199,6 +192,12 @@ def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[AddRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[AddRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -222,13 +221,13 @@ def add( _response = self._raw_client.add( namespace, content=content, - task_type=task_type, - dreaming=dreaming, id=id, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, request_options=request_options, ) return _response.data @@ -238,10 +237,10 @@ def search( namespace: str, *, query: str, - limit: typing.Optional[int] = None, - search_mode: typing.Optional[SearchMode] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, - attach: typing.Optional[SearchRequestAttachParams] = OMIT, + search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + limit: typing.Optional[int] = OMIT, + include: typing.Optional[SearchRequestIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -262,16 +261,16 @@ def search( query : str Natural-language question, topic, or phrase to retrieve relevant context for. Replaces the v4 `q` field. - limit : typing.Optional[int] - Maximum number of results to return + filter : typing.Optional[FilterExpressionParams] + Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchMode] + search_mode : typing.Optional[SearchRequestSearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. - filter : typing.Optional[FilterExpressionParams] - Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. + limit : typing.Optional[int] + Maximum number of results to return - attach : typing.Optional[SearchRequestAttachParams] + include : typing.Optional[SearchRequestIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -300,17 +299,16 @@ def search( ) client.search( namespace="user_alex", - limit=10, query="what are the API rate limits", ) """ _response = self._raw_client.search( namespace, query=query, - limit=limit, - search_mode=search_mode, filter=filter, - attach=attach, + search_mode=search_mode, + limit=limit, + include=include, threshold=threshold, rerank=rerank, rewrite_query=rewrite_query, @@ -371,11 +369,12 @@ def list( namespace: str, type: ListType, *, - page: typing.Optional[ListRequestPageParams] = None, - limit: typing.Optional[ListRequestLimitParams] = None, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, order: typing.Optional[SortOrder] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, + include: typing.Optional[ListRequestIncludeParams] = 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, @@ -393,10 +392,10 @@ def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories - page : typing.Optional[ListRequestPageParams] + page : typing.Optional[int] One-based page number - limit : typing.Optional[ListRequestLimitParams] + limit : typing.Optional[int] Maximum resources to return per page sort : typing.Optional[ListSort] @@ -408,6 +407,9 @@ def list( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before pagination + include : typing.Optional[ListRequestIncludeParams] + Optional extras, matching search's include + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -426,6 +428,8 @@ def list( client.list( namespace="user_alex", type="documents", + page=1, + limit=10, ) """ _response = self._raw_client.list( @@ -436,6 +440,7 @@ def list( sort=sort, order=order, filter=filter, + include=include, request_options=request_options, ) return _response.data @@ -622,13 +627,13 @@ async def add( namespace: str, *, content: str, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, id: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[AddRequestTaskType] = OMIT, + dreaming: typing.Optional[AddRequestDreaming] = 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, @@ -646,12 +651,6 @@ async def add( content : str The content to process. This may be plaintext or a URL to supported rich content. - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - id : typing.Optional[str] An optional caller-defined document ID @@ -667,6 +666,12 @@ async def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[AddRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[AddRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -698,13 +703,13 @@ async def main() -> None: _response = await self._raw_client.add( namespace, content=content, - task_type=task_type, - dreaming=dreaming, id=id, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, request_options=request_options, ) return _response.data @@ -714,10 +719,10 @@ async def search( namespace: str, *, query: str, - limit: typing.Optional[int] = None, - search_mode: typing.Optional[SearchMode] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, - attach: typing.Optional[SearchRequestAttachParams] = OMIT, + search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + limit: typing.Optional[int] = OMIT, + include: typing.Optional[SearchRequestIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -738,16 +743,16 @@ async def search( query : str Natural-language question, topic, or phrase to retrieve relevant context for. Replaces the v4 `q` field. - limit : typing.Optional[int] - Maximum number of results to return + filter : typing.Optional[FilterExpressionParams] + Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchMode] + search_mode : typing.Optional[SearchRequestSearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. - filter : typing.Optional[FilterExpressionParams] - Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. + limit : typing.Optional[int] + Maximum number of results to return - attach : typing.Optional[SearchRequestAttachParams] + include : typing.Optional[SearchRequestIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -781,7 +786,6 @@ async def search( async def main() -> None: await client.search( namespace="user_alex", - limit=10, query="what are the API rate limits", ) @@ -791,10 +795,10 @@ async def main() -> None: _response = await self._raw_client.search( namespace, query=query, - limit=limit, - search_mode=search_mode, filter=filter, - attach=attach, + search_mode=search_mode, + limit=limit, + include=include, threshold=threshold, rerank=rerank, rewrite_query=rewrite_query, @@ -865,11 +869,12 @@ async def list( namespace: str, type: ListType, *, - page: typing.Optional[ListRequestPageParams] = None, - limit: typing.Optional[ListRequestLimitParams] = None, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, order: typing.Optional[SortOrder] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, + include: typing.Optional[ListRequestIncludeParams] = 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, @@ -887,10 +892,10 @@ async def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories - page : typing.Optional[ListRequestPageParams] + page : typing.Optional[int] One-based page number - limit : typing.Optional[ListRequestLimitParams] + limit : typing.Optional[int] Maximum resources to return per page sort : typing.Optional[ListSort] @@ -902,6 +907,9 @@ async def list( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before pagination + include : typing.Optional[ListRequestIncludeParams] + Optional extras, matching search's include + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -925,6 +933,8 @@ async def main() -> None: await client.list( namespace="user_alex", type="documents", + page=1, + limit=10, ) @@ -938,6 +948,7 @@ async def main() -> None: sort=sort, order=order, filter=filter, + include=include, request_options=request_options, ) return _response.data diff --git a/src/supermemory/connectors/__init__.py b/src/supermemory/connectors/__init__.py index 5cde020..819ca17 100644 --- a/src/supermemory/connectors/__init__.py +++ b/src/supermemory/connectors/__init__.py @@ -2,3 +2,33 @@ # isort: skip_file +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import GetConnectorsRequestIncludeItem +_dynamic_imports: typing.Dict[str, str] = {"GetConnectorsRequestIncludeItem": ".types"} + + +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__ = ["GetConnectorsRequestIncludeItem"] diff --git a/src/supermemory/connectors/client.py b/src/supermemory/connectors/client.py index 7593d64..e56861b 100644 --- a/src/supermemory/connectors/client.py +++ b/src/supermemory/connectors/client.py @@ -17,6 +17,7 @@ from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from .raw_client import AsyncRawConnectorsClient, RawConnectorsClient +from .types.get_connectors_request_include_item import GetConnectorsRequestIncludeItem # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -188,7 +189,9 @@ def get( namespace: str, id: str, *, - attach: typing.Optional[str] = None, + include: typing.Optional[ + typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] + ] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -197,7 +200,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> Connector: """ - Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs. + Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs. Parameters ---------- @@ -207,7 +210,7 @@ def get( id : str Connector identifier returned when the connector was created - attach : typing.Optional[str] + include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -234,7 +237,7 @@ def get( ) """ _response = self._raw_client.get( - namespace, id, attach=attach, return_url=return_url, request_options=request_options + namespace, id, include=include, return_url=return_url, request_options=request_options ) return _response.data @@ -580,7 +583,9 @@ async def get( namespace: str, id: str, *, - attach: typing.Optional[str] = None, + include: typing.Optional[ + typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] + ] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -589,7 +594,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> Connector: """ - Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs. + Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs. Parameters ---------- @@ -599,7 +604,7 @@ async def get( id : str Connector identifier returned when the connector was created - attach : typing.Optional[str] + include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -634,7 +639,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.get( - namespace, id, attach=attach, return_url=return_url, request_options=request_options + namespace, id, include=include, return_url=return_url, request_options=request_options ) return _response.data diff --git a/src/supermemory/connectors/raw_client.py b/src/supermemory/connectors/raw_client.py index 3a1f081..a11d63c 100644 --- a/src/supermemory/connectors/raw_client.py +++ b/src/supermemory/connectors/raw_client.py @@ -33,6 +33,7 @@ from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from ..types.error_response import ErrorResponse +from .types.get_connectors_request_include_item import GetConnectorsRequestIncludeItem from pydantic import ValidationError # this is used as the default value for optional parameters @@ -392,7 +393,9 @@ def get( namespace: str, id: str, *, - attach: typing.Optional[str] = None, + include: typing.Optional[ + typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] + ] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -401,7 +404,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> HttpResponse[Connector]: """ - Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs. + Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs. Parameters ---------- @@ -411,7 +414,7 @@ def get( id : str Connector identifier returned when the connector was created - attach : typing.Optional[str] + include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -429,7 +432,7 @@ def get( f"ns/{encode_path_param(namespace)}/connectors/{encode_path_param(id)}", method="GET", params={ - "attach": attach, + "include": include, "returnUrl": return_url, }, request_options=request_options, @@ -1247,7 +1250,9 @@ async def get( namespace: str, id: str, *, - attach: typing.Optional[str] = None, + include: typing.Optional[ + typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] + ] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -1256,7 +1261,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> AsyncHttpResponse[Connector]: """ - Read one connector. Add attach=syncs to include its recent sync runs and the items that failed. attach=picker needs an admin with write access, since the link changes what syncs. + Read one connector. Add include=syncs to include its recent sync runs and the items that failed. include=picker needs an admin with write access, since the link changes what syncs. Parameters ---------- @@ -1266,7 +1271,7 @@ async def get( id : str Connector identifier returned when the connector was created - attach : typing.Optional[str] + include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -1284,7 +1289,7 @@ async def get( f"ns/{encode_path_param(namespace)}/connectors/{encode_path_param(id)}", method="GET", params={ - "attach": attach, + "include": include, "returnUrl": return_url, }, request_options=request_options, diff --git a/src/supermemory/connectors/types/__init__.py b/src/supermemory/connectors/types/__init__.py new file mode 100644 index 0000000..763517c --- /dev/null +++ b/src/supermemory/connectors/types/__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 .get_connectors_request_include_item import GetConnectorsRequestIncludeItem +_dynamic_imports: typing.Dict[str, str] = {"GetConnectorsRequestIncludeItem": ".get_connectors_request_include_item"} + + +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__ = ["GetConnectorsRequestIncludeItem"] diff --git a/src/supermemory/connectors/types/get_connectors_request_include_item.py b/src/supermemory/connectors/types/get_connectors_request_include_item.py new file mode 100644 index 0000000..146ee19 --- /dev/null +++ b/src/supermemory/connectors/types/get_connectors_request_include_item.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetConnectorsRequestIncludeItem = typing.Union[typing.Literal["syncs", "picker"], typing.Any] diff --git a/src/supermemory/documents/__init__.py b/src/supermemory/documents/__init__.py index 5cde020..483d1c3 100644 --- a/src/supermemory/documents/__init__.py +++ b/src/supermemory/documents/__init__.py @@ -2,3 +2,78 @@ # isort: skip_file +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + BatchAddDocumentsRequestDreaming, + BatchAddDocumentsRequestTaskType, + GetDocumentsRequestIncludeItem, + ReplaceWithFileDocumentsRequestDreaming, + ReplaceWithFileDocumentsRequestFileType, + ReplaceWithFileDocumentsRequestTaskType, + UpdateDocumentsRequestDreaming, + UpdateDocumentsRequestTaskType, + UpdateFileDocumentsRequestDreaming, + UpdateFileDocumentsRequestFileType, + UpdateFileDocumentsRequestTaskType, + UploadFileDocumentsRequestDreaming, + UploadFileDocumentsRequestFileType, + UploadFileDocumentsRequestTaskType, + ) +_dynamic_imports: typing.Dict[str, str] = { + "BatchAddDocumentsRequestDreaming": ".types", + "BatchAddDocumentsRequestTaskType": ".types", + "GetDocumentsRequestIncludeItem": ".types", + "ReplaceWithFileDocumentsRequestDreaming": ".types", + "ReplaceWithFileDocumentsRequestFileType": ".types", + "ReplaceWithFileDocumentsRequestTaskType": ".types", + "UpdateDocumentsRequestDreaming": ".types", + "UpdateDocumentsRequestTaskType": ".types", + "UpdateFileDocumentsRequestDreaming": ".types", + "UpdateFileDocumentsRequestFileType": ".types", + "UpdateFileDocumentsRequestTaskType": ".types", + "UploadFileDocumentsRequestDreaming": ".types", + "UploadFileDocumentsRequestFileType": ".types", + "UploadFileDocumentsRequestTaskType": ".types", +} + + +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__ = [ + "BatchAddDocumentsRequestDreaming", + "BatchAddDocumentsRequestTaskType", + "GetDocumentsRequestIncludeItem", + "ReplaceWithFileDocumentsRequestDreaming", + "ReplaceWithFileDocumentsRequestFileType", + "ReplaceWithFileDocumentsRequestTaskType", + "UpdateDocumentsRequestDreaming", + "UpdateDocumentsRequestTaskType", + "UpdateFileDocumentsRequestDreaming", + "UpdateFileDocumentsRequestFileType", + "UpdateFileDocumentsRequestTaskType", + "UploadFileDocumentsRequestDreaming", + "UploadFileDocumentsRequestFileType", + "UploadFileDocumentsRequestTaskType", +] diff --git a/src/supermemory/documents/client.py b/src/supermemory/documents/client.py index e5c8534..0757042 100644 --- a/src/supermemory/documents/client.py +++ b/src/supermemory/documents/client.py @@ -14,13 +14,22 @@ from ..types.batch_add_result import BatchAddResult from ..types.delete_documents_result import DeleteDocumentsResult from ..types.document import Document -from ..types.document_attachment import DocumentAttachment from ..types.document_ref import DocumentRef -from ..types.dreaming_mode import DreamingMode -from ..types.file_type import FileType -from ..types.file_upload_result import FileUploadResult -from ..types.task_type import TaskType from .raw_client import AsyncRawDocumentsClient, RawDocumentsClient +from .types.batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming +from .types.batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType +from .types.get_documents_request_include_item import GetDocumentsRequestIncludeItem +from .types.replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming +from .types.replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType +from .types.replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType +from .types.update_documents_request_dreaming import UpdateDocumentsRequestDreaming +from .types.update_documents_request_task_type import UpdateDocumentsRequestTaskType +from .types.update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming +from .types.update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType +from .types.update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType +from .types.upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming +from .types.upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType +from .types.upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -91,8 +100,8 @@ def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, + task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = 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, @@ -110,10 +119,10 @@ def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[TaskType] + task_type : typing.Optional[BatchAddDocumentsRequestTaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[DreamingMode] + dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -150,7 +159,9 @@ def get( namespace: str, id: str, *, - attach: typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] = None, + include: typing.Optional[ + typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] + ] = None, 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, @@ -158,7 +169,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> Document: """ - Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response. + Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response. Parameters ---------- @@ -168,8 +179,8 @@ def get( id : str The public document ID - attach : typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] - Child resources to include. Repeat the parameter to attach chunks, memories, or both. + include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -191,7 +202,7 @@ def get( id="my-doc-123", ) """ - _response = self._raw_client.get(namespace, id, attach=attach, request_options=request_options) + _response = self._raw_client.get(namespace, id, include=include, request_options=request_options) return _response.data def update( @@ -199,13 +210,13 @@ def update( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, content: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = 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, @@ -223,12 +234,6 @@ def update( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - content : typing.Optional[str] The content to process. This may be plaintext or a URL to supported rich content. @@ -244,6 +249,12 @@ def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -267,13 +278,13 @@ def update( _response = self._raw_client.update( namespace, id, - task_type=task_type, - dreaming=dreaming, content=content, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, request_options=request_options, ) return _response.data @@ -283,20 +294,20 @@ def upload_file( namespace: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Transform an uploaded file into searchable knowledge and learned memory. The response returns as soon as ingestion is safely queued while extraction and memory formation continue asynchronously. @@ -308,18 +319,6 @@ def upload_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -332,12 +331,24 @@ def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UploadFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef File accepted for processing Examples @@ -354,14 +365,14 @@ def upload_file( _response = self._raw_client.upload_file( namespace, file=file, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data @@ -372,20 +383,20 @@ def replace_with_file( id: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Replace an existing document with a new file while keeping its stable document ID. Content and caller metadata are overwritten, then the document is reprocessed asynchronously. @@ -400,18 +411,6 @@ def replace_with_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -424,12 +423,24 @@ def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef Replacement accepted for processing Examples @@ -448,14 +459,14 @@ def replace_with_file( namespace, id, file=file, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data @@ -465,21 +476,21 @@ def update_file( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, file: typing.Optional[core.File] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Refresh only the file-backed fields you provide. Supplying a file replaces the canonical content; omitted metadata and processing context remain unchanged. @@ -491,18 +502,6 @@ def update_file( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - file : typing.Optional[core.File] See core.File for more documentation @@ -518,12 +517,24 @@ def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef Update accepted for processing Examples @@ -541,15 +552,15 @@ def update_file( _response = self._raw_client.update_file( namespace, id, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, file=file, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data @@ -628,8 +639,8 @@ async def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, + task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = 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, @@ -647,10 +658,10 @@ async def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[TaskType] + task_type : typing.Optional[BatchAddDocumentsRequestTaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[DreamingMode] + dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -695,7 +706,9 @@ async def get( namespace: str, id: str, *, - attach: typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] = None, + include: typing.Optional[ + typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] + ] = None, 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, @@ -703,7 +716,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> Document: """ - Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response. + Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response. Parameters ---------- @@ -713,8 +726,8 @@ async def get( id : str The public document ID - attach : typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] - Child resources to include. Repeat the parameter to attach chunks, memories, or both. + include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -744,7 +757,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(namespace, id, attach=attach, request_options=request_options) + _response = await self._raw_client.get(namespace, id, include=include, request_options=request_options) return _response.data async def update( @@ -752,13 +765,13 @@ async def update( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, content: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = 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, @@ -776,12 +789,6 @@ async def update( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - content : typing.Optional[str] The content to process. This may be plaintext or a URL to supported rich content. @@ -797,6 +804,12 @@ async def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -828,13 +841,13 @@ async def main() -> None: _response = await self._raw_client.update( namespace, id, - task_type=task_type, - dreaming=dreaming, content=content, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, request_options=request_options, ) return _response.data @@ -844,20 +857,20 @@ async def upload_file( namespace: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Transform an uploaded file into searchable knowledge and learned memory. The response returns as soon as ingestion is safely queued while extraction and memory formation continue asynchronously. @@ -869,18 +882,6 @@ async def upload_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -893,12 +894,24 @@ async def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UploadFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef File accepted for processing Examples @@ -923,14 +936,14 @@ async def main() -> None: _response = await self._raw_client.upload_file( namespace, file=file, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data @@ -941,20 +954,20 @@ async def replace_with_file( id: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Replace an existing document with a new file while keeping its stable document ID. Content and caller metadata are overwritten, then the document is reprocessed asynchronously. @@ -969,18 +982,6 @@ async def replace_with_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -993,12 +994,24 @@ async def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef Replacement accepted for processing Examples @@ -1025,14 +1038,14 @@ async def main() -> None: namespace, id, file=file, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data @@ -1042,21 +1055,21 @@ async def update_file( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, file: typing.Optional[core.File] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + mime_type: 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, - ) -> FileUploadResult: + ) -> DocumentRef: """ Refresh only the file-backed fields you provide. Supplying a file replaces the canonical content; omitted metadata and processing context remain unchanged. @@ -1068,18 +1081,6 @@ async def update_file( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - file : typing.Optional[core.File] See core.File for more documentation @@ -1095,12 +1096,24 @@ async def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - FileUploadResult + DocumentRef Update accepted for processing Examples @@ -1126,15 +1139,15 @@ async def main() -> None: _response = await self._raw_client.update_file( namespace, id, - task_type=task_type, - dreaming=dreaming, - file_type=file_type, - mime_type=mime_type, file=file, supporting_context=supporting_context, metadata=metadata, group=group, date=date, + task_type=task_type, + dreaming=dreaming, + file_type=file_type, + mime_type=mime_type, request_options=request_options, ) return _response.data diff --git a/src/supermemory/documents/raw_client.py b/src/supermemory/documents/raw_client.py index 1a47265..eca6e77 100644 --- a/src/supermemory/documents/raw_client.py +++ b/src/supermemory/documents/raw_client.py @@ -29,13 +29,22 @@ from ..types.batch_add_result import BatchAddResult from ..types.delete_documents_result import DeleteDocumentsResult from ..types.document import Document -from ..types.document_attachment import DocumentAttachment from ..types.document_ref import DocumentRef -from ..types.dreaming_mode import DreamingMode from ..types.error_response import ErrorResponse -from ..types.file_type import FileType -from ..types.file_upload_result import FileUploadResult -from ..types.task_type import TaskType +from .types.batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming +from .types.batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType +from .types.get_documents_request_include_item import GetDocumentsRequestIncludeItem +from .types.replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming +from .types.replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType +from .types.replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType +from .types.update_documents_request_dreaming import UpdateDocumentsRequestDreaming +from .types.update_documents_request_task_type import UpdateDocumentsRequestTaskType +from .types.update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming +from .types.update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType +from .types.update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType +from .types.upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming +from .types.upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType +from .types.upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType from pydantic import ValidationError # this is used as the default value for optional parameters @@ -156,8 +165,8 @@ def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, + task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = 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, @@ -175,10 +184,10 @@ def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[TaskType] + task_type : typing.Optional[BatchAddDocumentsRequestTaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[DreamingMode] + dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -192,14 +201,12 @@ def batch_add( _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/batch", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "documents": convert_and_respect_annotation_metadata( object_=documents, annotation=typing.Sequence[DocumentInputParams], direction="write" ), + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -286,7 +293,9 @@ def get( namespace: str, id: str, *, - attach: typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] = None, + include: typing.Optional[ + typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] + ] = None, 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, @@ -294,7 +303,7 @@ def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> HttpResponse[Document]: """ - Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response. + Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response. Parameters ---------- @@ -304,8 +313,8 @@ def get( id : str The public document ID - attach : typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] - Child resources to include. Repeat the parameter to attach chunks, memories, or both. + include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -319,7 +328,7 @@ def get( f"ns/{encode_path_param(namespace)}/document/{encode_path_param(id)}", method="GET", params={ - "attach": attach, + "include": include, }, request_options=request_options, ) @@ -402,13 +411,13 @@ def update( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, content: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = 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, @@ -426,12 +435,6 @@ def update( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - content : typing.Optional[str] The content to process. This may be plaintext or a URL to supported rich content. @@ -447,6 +450,12 @@ def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -458,10 +467,6 @@ def update( _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/{encode_path_param(id)}", method="PATCH", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "content": content, "supportingContext": supporting_context, @@ -472,6 +477,8 @@ def update( object_=group, annotation=typing.Dict[str, MetadataValueParams], direction="write" ), "date": date, + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -580,20 +587,20 @@ def upload_file( namespace: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> HttpResponse[DocumentRef]: """ Transform an uploaded file into searchable knowledge and learned memory. The response returns as soon as ingestion is safely queued while extraction and memory formation continue asynchronously. @@ -605,18 +612,6 @@ def upload_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -629,28 +624,38 @@ def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UploadFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[FileUploadResult] + HttpResponse[DocumentRef] File accepted for processing """ _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ "file": file, @@ -662,9 +667,9 @@ def upload_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) @@ -750,20 +755,20 @@ def replace_with_file( id: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> HttpResponse[DocumentRef]: """ Replace an existing document with a new file while keeping its stable document ID. Content and caller metadata are overwritten, then the document is reprocessed asynchronously. @@ -778,18 +783,6 @@ def replace_with_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -802,28 +795,38 @@ def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[FileUploadResult] + HttpResponse[DocumentRef] Replacement accepted for processing """ _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file/{encode_path_param(id)}", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ "file": file, @@ -835,9 +838,9 @@ def replace_with_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) @@ -933,21 +936,21 @@ def update_file( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, file: typing.Optional[core.File] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> HttpResponse[DocumentRef]: """ Refresh only the file-backed fields you provide. Supplying a file replaces the canonical content; omitted metadata and processing context remain unchanged. @@ -959,18 +962,6 @@ def update_file( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - file : typing.Optional[core.File] See core.File for more documentation @@ -986,28 +977,38 @@ def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[FileUploadResult] + HttpResponse[DocumentRef] Update accepted for processing """ _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file/{encode_path_param(id)}", method="PATCH", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ **({"file": file} if file is not None else {}), @@ -1019,9 +1020,9 @@ def update_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) @@ -1227,8 +1228,8 @@ async def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, + task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = 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, @@ -1246,10 +1247,10 @@ async def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[TaskType] + task_type : typing.Optional[BatchAddDocumentsRequestTaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[DreamingMode] + dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -1263,14 +1264,12 @@ async def batch_add( _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/batch", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "documents": convert_and_respect_annotation_metadata( object_=documents, annotation=typing.Sequence[DocumentInputParams], direction="write" ), + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -1357,7 +1356,9 @@ async def get( namespace: str, id: str, *, - attach: typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] = None, + include: typing.Optional[ + typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] + ] = None, 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, @@ -1365,7 +1366,7 @@ async def get( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> AsyncHttpResponse[Document]: """ - Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally attach its source chunks, derived memories, or both in the same response. + Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response. Parameters ---------- @@ -1375,8 +1376,8 @@ async def get( id : str The public document ID - attach : typing.Optional[typing.Union[DocumentAttachment, typing.Sequence[DocumentAttachment]]] - Child resources to include. Repeat the parameter to attach chunks, memories, or both. + include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1390,7 +1391,7 @@ async def get( f"ns/{encode_path_param(namespace)}/document/{encode_path_param(id)}", method="GET", params={ - "attach": attach, + "include": include, }, request_options=request_options, ) @@ -1473,13 +1474,13 @@ async def update( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, content: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = 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, @@ -1497,12 +1498,6 @@ async def update( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - content : typing.Optional[str] The content to process. This may be plaintext or a URL to supported rich content. @@ -1518,6 +1513,12 @@ async def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1529,10 +1530,6 @@ async def update( _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/{encode_path_param(id)}", method="PATCH", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "content": content, "supportingContext": supporting_context, @@ -1543,6 +1540,8 @@ async def update( object_=group, annotation=typing.Dict[str, MetadataValueParams], direction="write" ), "date": date, + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -1651,20 +1650,20 @@ async def upload_file( namespace: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> AsyncHttpResponse[DocumentRef]: """ Transform an uploaded file into searchable knowledge and learned memory. The response returns as soon as ingestion is safely queued while extraction and memory formation continue asynchronously. @@ -1676,18 +1675,6 @@ async def upload_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -1700,28 +1687,38 @@ async def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UploadFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[FileUploadResult] + AsyncHttpResponse[DocumentRef] File accepted for processing """ _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ "file": file, @@ -1733,9 +1730,9 @@ async def upload_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) @@ -1821,20 +1818,20 @@ async def replace_with_file( id: str, *, file: core.File, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> AsyncHttpResponse[DocumentRef]: """ Replace an existing document with a new file while keeping its stable document ID. Content and caller metadata are overwritten, then the document is reprocessed asynchronously. @@ -1849,18 +1846,6 @@ async def replace_with_file( file : core.File See core.File for more documentation - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - supporting_context : typing.Optional[str] Context used to guide memory extraction within this namespace. Max 1500 characters. @@ -1873,28 +1858,38 @@ async def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[FileUploadResult] + AsyncHttpResponse[DocumentRef] Replacement accepted for processing """ _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file/{encode_path_param(id)}", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ "file": file, @@ -1906,9 +1901,9 @@ async def replace_with_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) @@ -2004,21 +1999,21 @@ async def update_file( namespace: str, id: str, *, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, - file_type: typing.Optional[FileType] = None, - mime_type: typing.Optional[str] = None, file: typing.Optional[core.File] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, + dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, + file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + mime_type: 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[FileUploadResult]: + ) -> AsyncHttpResponse[DocumentRef]: """ Refresh only the file-backed fields you provide. Supplying a file replaces the canonical content; omitted metadata and processing context remain unchanged. @@ -2030,18 +2025,6 @@ async def update_file( id : str The public document ID - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - - file_type : typing.Optional[FileType] - Explicit source type used when automatic inference is insufficient - - mime_type : typing.Optional[str] - Explicit MIME type used when upload metadata is insufficient - file : typing.Optional[core.File] See core.File for more documentation @@ -2057,28 +2040,38 @@ async def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + + file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + Explicit source type used when automatic inference is insufficient + + mime_type : typing.Optional[str] + Explicit MIME type used when upload metadata is insufficient + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[FileUploadResult] + AsyncHttpResponse[DocumentRef] Update accepted for processing """ _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document/file/{encode_path_param(id)}", method="PATCH", - params={ - "taskType": task_type, - "dreaming": dreaming, - "fileType": file_type, - "mimeType": mime_type, - }, data={ "supportingContext": supporting_context, "metadata": metadata, "group": group, "date": date, + "taskType": task_type, + "dreaming": dreaming, + "fileType": file_type, + "mimeType": mime_type, }, files={ **({"file": file} if file is not None else {}), @@ -2090,9 +2083,9 @@ async def update_file( try: if 200 <= _response.status_code < 300: _data = typing.cast( - FileUploadResult, + DocumentRef, construct_type( - type_=FileUploadResult, # type: ignore + type_=DocumentRef, # type: ignore object_=_response.json(), ), ) diff --git a/src/supermemory/documents/types/__init__.py b/src/supermemory/documents/types/__init__.py new file mode 100644 index 0000000..a896da6 --- /dev/null +++ b/src/supermemory/documents/types/__init__.py @@ -0,0 +1,77 @@ +# 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 .batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming + from .batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType + from .get_documents_request_include_item import GetDocumentsRequestIncludeItem + from .replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming + from .replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType + from .replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType + from .update_documents_request_dreaming import UpdateDocumentsRequestDreaming + from .update_documents_request_task_type import UpdateDocumentsRequestTaskType + from .update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming + from .update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType + from .update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType + from .upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming + from .upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType + from .upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType +_dynamic_imports: typing.Dict[str, str] = { + "BatchAddDocumentsRequestDreaming": ".batch_add_documents_request_dreaming", + "BatchAddDocumentsRequestTaskType": ".batch_add_documents_request_task_type", + "GetDocumentsRequestIncludeItem": ".get_documents_request_include_item", + "ReplaceWithFileDocumentsRequestDreaming": ".replace_with_file_documents_request_dreaming", + "ReplaceWithFileDocumentsRequestFileType": ".replace_with_file_documents_request_file_type", + "ReplaceWithFileDocumentsRequestTaskType": ".replace_with_file_documents_request_task_type", + "UpdateDocumentsRequestDreaming": ".update_documents_request_dreaming", + "UpdateDocumentsRequestTaskType": ".update_documents_request_task_type", + "UpdateFileDocumentsRequestDreaming": ".update_file_documents_request_dreaming", + "UpdateFileDocumentsRequestFileType": ".update_file_documents_request_file_type", + "UpdateFileDocumentsRequestTaskType": ".update_file_documents_request_task_type", + "UploadFileDocumentsRequestDreaming": ".upload_file_documents_request_dreaming", + "UploadFileDocumentsRequestFileType": ".upload_file_documents_request_file_type", + "UploadFileDocumentsRequestTaskType": ".upload_file_documents_request_task_type", +} + + +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__ = [ + "BatchAddDocumentsRequestDreaming", + "BatchAddDocumentsRequestTaskType", + "GetDocumentsRequestIncludeItem", + "ReplaceWithFileDocumentsRequestDreaming", + "ReplaceWithFileDocumentsRequestFileType", + "ReplaceWithFileDocumentsRequestTaskType", + "UpdateDocumentsRequestDreaming", + "UpdateDocumentsRequestTaskType", + "UpdateFileDocumentsRequestDreaming", + "UpdateFileDocumentsRequestFileType", + "UpdateFileDocumentsRequestTaskType", + "UploadFileDocumentsRequestDreaming", + "UploadFileDocumentsRequestFileType", + "UploadFileDocumentsRequestTaskType", +] diff --git a/src/supermemory/documents/types/batch_add_documents_request_dreaming.py b/src/supermemory/documents/types/batch_add_documents_request_dreaming.py new file mode 100644 index 0000000..b214f15 --- /dev/null +++ b/src/supermemory/documents/types/batch_add_documents_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchAddDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/batch_add_documents_request_task_type.py b/src/supermemory/documents/types/batch_add_documents_request_task_type.py new file mode 100644 index 0000000..aeb6144 --- /dev/null +++ b/src/supermemory/documents/types/batch_add_documents_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchAddDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/get_documents_request_include_item.py b/src/supermemory/documents/types/get_documents_request_include_item.py new file mode 100644 index 0000000..e9428aa --- /dev/null +++ b/src/supermemory/documents/types/get_documents_request_include_item.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetDocumentsRequestIncludeItem = typing.Union[typing.Literal["chunks", "memories"], typing.Any] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py b/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py new file mode 100644 index 0000000..0fcaf7f --- /dev/null +++ b/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ReplaceWithFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py b/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py new file mode 100644 index 0000000..8602ce0 --- /dev/null +++ b/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ReplaceWithFileDocumentsRequestFileType = typing.Union[ + typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any +] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py b/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py new file mode 100644 index 0000000..1bfd317 --- /dev/null +++ b/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ReplaceWithFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/update_documents_request_dreaming.py b/src/supermemory/documents/types/update_documents_request_dreaming.py new file mode 100644 index 0000000..556a40c --- /dev/null +++ b/src/supermemory/documents/types/update_documents_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/update_documents_request_task_type.py b/src/supermemory/documents/types/update_documents_request_task_type.py new file mode 100644 index 0000000..8d3eb00 --- /dev/null +++ b/src/supermemory/documents/types/update_documents_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_dreaming.py b/src/supermemory/documents/types/update_file_documents_request_dreaming.py new file mode 100644 index 0000000..13eaa57 --- /dev/null +++ b/src/supermemory/documents/types/update_file_documents_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_file_type.py b/src/supermemory/documents/types/update_file_documents_request_file_type.py new file mode 100644 index 0000000..1444c6e --- /dev/null +++ b/src/supermemory/documents/types/update_file_documents_request_file_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateFileDocumentsRequestFileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_task_type.py b/src/supermemory/documents/types/update_file_documents_request_task_type.py new file mode 100644 index 0000000..9614065 --- /dev/null +++ b/src/supermemory/documents/types/update_file_documents_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_dreaming.py b/src/supermemory/documents/types/upload_file_documents_request_dreaming.py new file mode 100644 index 0000000..3312084 --- /dev/null +++ b/src/supermemory/documents/types/upload_file_documents_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UploadFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_file_type.py b/src/supermemory/documents/types/upload_file_documents_request_file_type.py new file mode 100644 index 0000000..8a13dff --- /dev/null +++ b/src/supermemory/documents/types/upload_file_documents_request_file_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UploadFileDocumentsRequestFileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_task_type.py b/src/supermemory/documents/types/upload_file_documents_request_task_type.py new file mode 100644 index 0000000..889acaf --- /dev/null +++ b/src/supermemory/documents/types/upload_file_documents_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UploadFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/memories/__init__.py b/src/supermemory/memories/__init__.py index 5cde020..331de67 100644 --- a/src/supermemory/memories/__init__.py +++ b/src/supermemory/memories/__init__.py @@ -2,3 +2,143 @@ # isort: skip_file +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + GetMemoriesRequestIncludeItem, + GetMemoriesResponse, + GetMemoriesResponseIncluded, + GetMemoriesResponseIncludedDocument, + GetMemoriesResponseIncludedDocumentSystem, + GetMemoriesResponseIncludedRelated, + GetMemoriesResponseIncludedRelatedChildrenItem, + GetMemoriesResponseIncludedRelatedChildrenItemDocument, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, + GetMemoriesResponseIncludedRelatedChildrenItemSystem, + GetMemoriesResponseIncludedRelatedParentsItem, + GetMemoriesResponseIncludedRelatedParentsItemDocument, + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, + GetMemoriesResponseIncludedRelatedParentsItemSystem, + GetMemoriesResponseIncludedRelatedSiblingsItem, + GetMemoriesResponseIncludedRelatedSiblingsItemDocument, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, + GetMemoriesResponseIncludedRelatedSiblingsItemSystem, + ) + from .requests import ( + GetMemoriesResponseIncludedDocumentParams, + GetMemoriesResponseIncludedDocumentSystemParams, + GetMemoriesResponseIncludedParams, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedChildrenItemParams, + GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, + GetMemoriesResponseIncludedRelatedParams, + GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedParentsItemParams, + GetMemoriesResponseIncludedRelatedParentsItemSystemParams, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, + GetMemoriesResponseIncludedRelatedSiblingsItemParams, + GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, + GetMemoriesResponseParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "GetMemoriesRequestIncludeItem": ".types", + "GetMemoriesResponse": ".types", + "GetMemoriesResponseIncluded": ".types", + "GetMemoriesResponseIncludedDocument": ".types", + "GetMemoriesResponseIncludedDocumentParams": ".requests", + "GetMemoriesResponseIncludedDocumentSystem": ".types", + "GetMemoriesResponseIncludedDocumentSystemParams": ".requests", + "GetMemoriesResponseIncludedParams": ".requests", + "GetMemoriesResponseIncludedRelated": ".types", + "GetMemoriesResponseIncludedRelatedChildrenItem": ".types", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".types", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".requests", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".types", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".requests", + "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".requests", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".types", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".requests", + "GetMemoriesResponseIncludedRelatedParams": ".requests", + "GetMemoriesResponseIncludedRelatedParentsItem": ".types", + "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".types", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".requests", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".types", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".requests", + "GetMemoriesResponseIncludedRelatedParentsItemParams": ".requests", + "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".types", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".requests", + "GetMemoriesResponseIncludedRelatedSiblingsItem": ".types", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".types", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".requests", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".types", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".requests", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".requests", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".types", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".requests", + "GetMemoriesResponseParams": ".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__ = [ + "GetMemoriesRequestIncludeItem", + "GetMemoriesResponse", + "GetMemoriesResponseIncluded", + "GetMemoriesResponseIncludedDocument", + "GetMemoriesResponseIncludedDocumentParams", + "GetMemoriesResponseIncludedDocumentSystem", + "GetMemoriesResponseIncludedDocumentSystemParams", + "GetMemoriesResponseIncludedParams", + "GetMemoriesResponseIncludedRelated", + "GetMemoriesResponseIncludedRelatedChildrenItem", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", + "GetMemoriesResponseIncludedRelatedParams", + "GetMemoriesResponseIncludedRelatedParentsItem", + "GetMemoriesResponseIncludedRelatedParentsItemDocument", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedParentsItemParams", + "GetMemoriesResponseIncludedRelatedParentsItemSystem", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItem", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", + "GetMemoriesResponseParams", +] diff --git a/src/supermemory/memories/client.py b/src/supermemory/memories/client.py index 875f453..f2b4e0e 100644 --- a/src/supermemory/memories/client.py +++ b/src/supermemory/memories/client.py @@ -10,6 +10,8 @@ from ..core.request_options import RequestOptions from ..types.forget_result import ForgetResult from .raw_client import AsyncRawMemoriesClient, RawMemoriesClient +from .types.get_memories_request_include_item import GetMemoriesRequestIncludeItem +from .types.get_memories_response import GetMemoriesResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -127,6 +129,63 @@ def forget_matching( ) return _response.data + def get( + self, + namespace: str, + id: str, + *, + include: typing.Optional[ + typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] + ] = None, + related_limit: typing.Optional[int] = None, + 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, + ) -> GetMemoriesResponse: + """ + 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. + + Parameters + ---------- + namespace : str + 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. + + id : str + Memory identifier + + include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + 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. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetMemoriesResponse + Memory retrieved + + Examples + -------- + from supermemory import Supermemory + + client = Supermemory( + api_key="YOUR_API_KEY", + ) + client.memories.get( + namespace="user_alex", + id="mem_abc123", + ) + """ + _response = self._raw_client.get( + namespace, id, include=include, related_limit=related_limit, request_options=request_options + ) + return _response.data + class AsyncMemoriesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -255,3 +314,68 @@ async def main() -> None: namespace, query=query, dry_run=dry_run, request_options=request_options ) return _response.data + + async def get( + self, + namespace: str, + id: str, + *, + include: typing.Optional[ + typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] + ] = None, + related_limit: typing.Optional[int] = None, + 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, + ) -> GetMemoriesResponse: + """ + 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. + + Parameters + ---------- + namespace : str + 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. + + id : str + Memory identifier + + include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + 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. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetMemoriesResponse + Memory retrieved + + Examples + -------- + import asyncio + + from supermemory import AsyncSupermemory + + client = AsyncSupermemory( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.memories.get( + namespace="user_alex", + id="mem_abc123", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get( + namespace, id, include=include, related_limit=related_limit, request_options=request_options + ) + return _response.data diff --git a/src/supermemory/memories/raw_client.py b/src/supermemory/memories/raw_client.py index 7c8fa3a..68e5179 100644 --- a/src/supermemory/memories/raw_client.py +++ b/src/supermemory/memories/raw_client.py @@ -17,10 +17,13 @@ from ..errors.bad_request_error import BadRequestError from ..errors.forbidden_error import ForbiddenError from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError from ..errors.unauthorized_error import UnauthorizedError from ..types.bad_request_error_body import BadRequestErrorBody from ..types.error_response import ErrorResponse from ..types.forget_result import ForgetResult +from .types.get_memories_request_include_item import GetMemoriesRequestIncludeItem +from .types.get_memories_response import GetMemoriesResponse from pydantic import ValidationError # this is used as the default value for optional parameters @@ -246,6 +249,129 @@ def forget_matching( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def get( + self, + namespace: str, + id: str, + *, + include: typing.Optional[ + typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] + ] = None, + related_limit: typing.Optional[int] = None, + 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[GetMemoriesResponse]: + """ + 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. + + Parameters + ---------- + namespace : str + 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. + + id : str + Memory identifier + + include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + 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. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetMemoriesResponse] + Memory retrieved + """ + _response = self._client_wrapper.httpx_client.request( + f"ns/{encode_path_param(namespace)}/memories/{encode_path_param(id)}", + method="GET", + params={ + "include": include, + "relatedLimit": related_limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetMemoriesResponse, + construct_type( + type_=GetMemoriesResponse, # 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 == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + 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 AsyncRawMemoriesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -465,3 +591,126 @@ async def forget_matching( 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) + + async def get( + self, + namespace: str, + id: str, + *, + include: typing.Optional[ + typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] + ] = None, + related_limit: typing.Optional[int] = None, + 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[GetMemoriesResponse]: + """ + 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. + + Parameters + ---------- + namespace : str + 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. + + id : str + Memory identifier + + include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + 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. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetMemoriesResponse] + Memory retrieved + """ + _response = await self._client_wrapper.httpx_client.request( + f"ns/{encode_path_param(namespace)}/memories/{encode_path_param(id)}", + method="GET", + params={ + "include": include, + "relatedLimit": related_limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetMemoriesResponse, + construct_type( + type_=GetMemoriesResponse, # 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 == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + ErrorResponse, + construct_type( + type_=ErrorResponse, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + 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/memories/requests/__init__.py b/src/supermemory/memories/requests/__init__.py new file mode 100644 index 0000000..da467a7 --- /dev/null +++ b/src/supermemory/memories/requests/__init__.py @@ -0,0 +1,108 @@ +# 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 .get_memories_response import GetMemoriesResponseParams + from .get_memories_response_included import GetMemoriesResponseIncludedParams + from .get_memories_response_included_document import GetMemoriesResponseIncludedDocumentParams + from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystemParams + from .get_memories_response_included_related import GetMemoriesResponseIncludedRelatedParams + from .get_memories_response_included_related_children_item import ( + GetMemoriesResponseIncludedRelatedChildrenItemParams, + ) + from .get_memories_response_included_related_children_item_document import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, + ) + from .get_memories_response_included_related_children_item_document_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, + ) + from .get_memories_response_included_related_children_item_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, + ) + from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItemParams + from .get_memories_response_included_related_parents_item_document import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, + ) + from .get_memories_response_included_related_parents_item_document_system import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, + ) + from .get_memories_response_included_related_parents_item_system import ( + GetMemoriesResponseIncludedRelatedParentsItemSystemParams, + ) + from .get_memories_response_included_related_siblings_item import ( + GetMemoriesResponseIncludedRelatedSiblingsItemParams, + ) + from .get_memories_response_included_related_siblings_item_document import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, + ) + from .get_memories_response_included_related_siblings_item_document_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, + ) + from .get_memories_response_included_related_siblings_item_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "GetMemoriesResponseIncludedDocumentParams": ".get_memories_response_included_document", + "GetMemoriesResponseIncludedDocumentSystemParams": ".get_memories_response_included_document_system", + "GetMemoriesResponseIncludedParams": ".get_memories_response_included", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".get_memories_response_included_related_children_item_document", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".get_memories_response_included_related_children_item_document_system", + "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".get_memories_response_included_related_children_item", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".get_memories_response_included_related_children_item_system", + "GetMemoriesResponseIncludedRelatedParams": ".get_memories_response_included_related", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".get_memories_response_included_related_parents_item_document", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".get_memories_response_included_related_parents_item_document_system", + "GetMemoriesResponseIncludedRelatedParentsItemParams": ".get_memories_response_included_related_parents_item", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".get_memories_response_included_related_parents_item_system", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".get_memories_response_included_related_siblings_item_document", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".get_memories_response_included_related_siblings_item_document_system", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".get_memories_response_included_related_siblings_item", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".get_memories_response_included_related_siblings_item_system", + "GetMemoriesResponseParams": ".get_memories_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__ = [ + "GetMemoriesResponseIncludedDocumentParams", + "GetMemoriesResponseIncludedDocumentSystemParams", + "GetMemoriesResponseIncludedParams", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemParams", + "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", + "GetMemoriesResponseIncludedRelatedParams", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedParentsItemParams", + "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemParams", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", + "GetMemoriesResponseParams", +] diff --git a/src/supermemory/memories/requests/get_memories_response.py b/src/supermemory/memories/requests/get_memories_response.py new file mode 100644 index 0000000..279d812 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ...core.serialization import FieldMetadata +from ...requests.memory_system import MemorySystemParams +from .get_memories_response_included import GetMemoriesResponseIncludedParams + + +class GetMemoriesResponseParams(typing_extensions.TypedDict): + id: str + """ + Stable memory identifier + """ + + memory: str + """ + Learned fact or context extracted from the document + """ + + metadata: typing.Dict[str, typing.Any] + """ + Memory metadata, including temporal context; empty object when none + """ + + is_static: typing_extensions.Annotated[bool, FieldMetadata(alias="isStatic")] + """ + Whether the memory belongs to the stable profile section + """ + + is_inference: typing_extensions.Annotated[bool, FieldMetadata(alias="isInference")] + """ + Whether the memory was inferred rather than explicitly stated + """ + + is_latest: typing_extensions.Annotated[bool, FieldMetadata(alias="isLatest")] + """ + Whether this is the newest version in its memory chain + """ + + is_forgotten: typing_extensions.Annotated[bool, FieldMetadata(alias="isForgotten")] + """ + Whether this memory has been excluded from normal recall + """ + + version: int + """ + Version number within the memory chain + """ + + system: MemorySystemParams + """ + Lifecycle timestamps maintained by Supermemory + """ + + included: typing_extensions.NotRequired[GetMemoriesResponseIncludedParams] + """ + Requested extras + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included.py b/src/supermemory/memories/requests/get_memories_response_included.py new file mode 100644 index 0000000..83dc2c9 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from .get_memories_response_included_document import GetMemoriesResponseIncludedDocumentParams +from .get_memories_response_included_related import GetMemoriesResponseIncludedRelatedParams + + +class GetMemoriesResponseIncludedParams(typing_extensions.TypedDict): + """ + Requested extras + """ + + related: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedParams] + """ + Present when include has related + """ + + document: typing_extensions.NotRequired[GetMemoriesResponseIncludedDocumentParams] + """ + Source document; present when include has documents and one exists + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_document.py b/src/supermemory/memories/requests/get_memories_response_included_document.py new file mode 100644 index 0000000..492142a --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_document.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystemParams + + +class GetMemoriesResponseIncludedDocumentParams(typing_extensions.TypedDict): + """ + Source document; present when include has documents and one exists + """ + + id: str + """ + Source document identifier + """ + + title: typing.Optional[str] + """ + Source document title + """ + + type: typing.Optional[str] + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedDocumentSystemParams + """ + Lifecycle timestamps maintained by Supermemory + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_document_system.py b/src/supermemory/memories/requests/get_memories_response_included_document_system.py new file mode 100644 index 0000000..e5d7bab --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_document_system.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedDocumentSystemParams(typing_extensions.TypedDict): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the source document's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related.py b/src/supermemory/memories/requests/get_memories_response_included_related.py new file mode 100644 index 0000000..50f0104 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItemParams +from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItemParams +from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItemParams + + +class GetMemoriesResponseIncludedRelatedParams(typing_extensions.TypedDict): + """ + Present when include has related + """ + + parents: typing.Sequence[GetMemoriesResponseIncludedRelatedParentsItemParams] + """ + Earlier versions this memory updates, nearest first + """ + + children: typing.Sequence[GetMemoriesResponseIncludedRelatedChildrenItemParams] + """ + Newer versions that update this memory, nearest first + """ + + siblings: typing.Sequence[GetMemoriesResponseIncludedRelatedSiblingsItemParams] + """ + Memories connected by extends or derives, nearest first + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item.py b/src/supermemory/memories/requests/get_memories_response_included_related_children_item.py new file mode 100644 index 0000000..253cdd3 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_children_item.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_children_item_document import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, +) +from .get_memories_response_included_related_children_item_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedChildrenItemParams(typing_extensions.TypedDict): + id: str + """ + Related memory ID + """ + + relation: MemoryRelation + """ + How this memory is connected to the matched memory + """ + + version: typing_extensions.NotRequired[typing.Optional[float]] + """ + Version number within the related memory's history + """ + + memory: str + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedChildrenItemSystemParams + """ + Lifecycle details for the related memory + """ + + document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams] + """ + Source document; present when include has both related and documents + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py new file mode 100644 index 0000000..6d7d92e --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .get_memories_response_included_related_children_item_document_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams(typing_extensions.TypedDict): + """ + Source document; present when include has both related and documents + """ + + id: str + """ + Source document identifier + """ + + title: typing.Optional[str] + """ + Source document title + """ + + type: typing.Optional[str] + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams + """ + Lifecycle timestamps maintained by Supermemory + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py new file mode 100644 index 0000000..5e4a10c --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams(typing_extensions.TypedDict): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the source document's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py new file mode 100644 index 0000000..0e46cec --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedChildrenItemSystemParams(typing_extensions.TypedDict): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the related memory's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py new file mode 100644 index 0000000..5f7e5a2 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_parents_item_document import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, +) +from .get_memories_response_included_related_parents_item_system import ( + GetMemoriesResponseIncludedRelatedParentsItemSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedParentsItemParams(typing_extensions.TypedDict): + id: str + """ + Related memory ID + """ + + relation: MemoryRelation + """ + How this memory is connected to the matched memory + """ + + version: typing_extensions.NotRequired[typing.Optional[float]] + """ + Version number within the related memory's history + """ + + memory: str + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedParentsItemSystemParams + """ + Lifecycle details for the related memory + """ + + document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedParentsItemDocumentParams] + """ + Source document; present when include has both related and documents + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py new file mode 100644 index 0000000..70131d3 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .get_memories_response_included_related_parents_item_document_system import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedParentsItemDocumentParams(typing_extensions.TypedDict): + """ + Source document; present when include has both related and documents + """ + + id: str + """ + Source document identifier + """ + + title: typing.Optional[str] + """ + Source document title + """ + + type: typing.Optional[str] + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams + """ + Lifecycle timestamps maintained by Supermemory + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py new file mode 100644 index 0000000..bf9b62e --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams(typing_extensions.TypedDict): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the source document's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py new file mode 100644 index 0000000..002582a --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedParentsItemSystemParams(typing_extensions.TypedDict): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the related memory's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py new file mode 100644 index 0000000..c64b9a5 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_siblings_item_document import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, +) +from .get_memories_response_included_related_siblings_item_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedSiblingsItemParams(typing_extensions.TypedDict): + id: str + """ + Related memory ID + """ + + relation: MemoryRelation + """ + How this memory is connected to the matched memory + """ + + version: typing_extensions.NotRequired[typing.Optional[float]] + """ + Version number within the related memory's history + """ + + memory: str + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams + """ + Lifecycle details for the related memory + """ + + document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams] + """ + Source document; present when include has both related and documents + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py new file mode 100644 index 0000000..0afa1c9 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .get_memories_response_included_related_siblings_item_document_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, +) + + +class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams(typing_extensions.TypedDict): + """ + Source document; present when include has both related and documents + """ + + id: str + """ + Source document identifier + """ + + title: typing.Optional[str] + """ + Source document title + """ + + type: typing.Optional[str] + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams + """ + Lifecycle timestamps maintained by Supermemory + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py new file mode 100644 index 0000000..bccb1da --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams(typing_extensions.TypedDict): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the source document's latest update + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py new file mode 100644 index 0000000..45c1b21 --- /dev/null +++ b/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams(typing_extensions.TypedDict): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the related memory's latest update + """ diff --git a/src/supermemory/memories/types/__init__.py b/src/supermemory/memories/types/__init__.py new file mode 100644 index 0000000..c73b1c6 --- /dev/null +++ b/src/supermemory/memories/types/__init__.py @@ -0,0 +1,107 @@ +# 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 .get_memories_request_include_item import GetMemoriesRequestIncludeItem + from .get_memories_response import GetMemoriesResponse + from .get_memories_response_included import GetMemoriesResponseIncluded + from .get_memories_response_included_document import GetMemoriesResponseIncludedDocument + from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystem + from .get_memories_response_included_related import GetMemoriesResponseIncludedRelated + from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItem + from .get_memories_response_included_related_children_item_document import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocument, + ) + from .get_memories_response_included_related_children_item_document_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, + ) + from .get_memories_response_included_related_children_item_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemSystem, + ) + from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItem + from .get_memories_response_included_related_parents_item_document import ( + GetMemoriesResponseIncludedRelatedParentsItemDocument, + ) + from .get_memories_response_included_related_parents_item_document_system import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, + ) + from .get_memories_response_included_related_parents_item_system import ( + GetMemoriesResponseIncludedRelatedParentsItemSystem, + ) + from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItem + from .get_memories_response_included_related_siblings_item_document import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocument, + ) + from .get_memories_response_included_related_siblings_item_document_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, + ) + from .get_memories_response_included_related_siblings_item_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemSystem, + ) +_dynamic_imports: typing.Dict[str, str] = { + "GetMemoriesRequestIncludeItem": ".get_memories_request_include_item", + "GetMemoriesResponse": ".get_memories_response", + "GetMemoriesResponseIncluded": ".get_memories_response_included", + "GetMemoriesResponseIncludedDocument": ".get_memories_response_included_document", + "GetMemoriesResponseIncludedDocumentSystem": ".get_memories_response_included_document_system", + "GetMemoriesResponseIncludedRelated": ".get_memories_response_included_related", + "GetMemoriesResponseIncludedRelatedChildrenItem": ".get_memories_response_included_related_children_item", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".get_memories_response_included_related_children_item_document", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".get_memories_response_included_related_children_item_document_system", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".get_memories_response_included_related_children_item_system", + "GetMemoriesResponseIncludedRelatedParentsItem": ".get_memories_response_included_related_parents_item", + "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".get_memories_response_included_related_parents_item_document", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".get_memories_response_included_related_parents_item_document_system", + "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".get_memories_response_included_related_parents_item_system", + "GetMemoriesResponseIncludedRelatedSiblingsItem": ".get_memories_response_included_related_siblings_item", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".get_memories_response_included_related_siblings_item_document", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".get_memories_response_included_related_siblings_item_document_system", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".get_memories_response_included_related_siblings_item_system", +} + + +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__ = [ + "GetMemoriesRequestIncludeItem", + "GetMemoriesResponse", + "GetMemoriesResponseIncluded", + "GetMemoriesResponseIncludedDocument", + "GetMemoriesResponseIncludedDocumentSystem", + "GetMemoriesResponseIncludedRelated", + "GetMemoriesResponseIncludedRelatedChildrenItem", + "GetMemoriesResponseIncludedRelatedChildrenItemDocument", + "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedChildrenItemSystem", + "GetMemoriesResponseIncludedRelatedParentsItem", + "GetMemoriesResponseIncludedRelatedParentsItemDocument", + "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedParentsItemSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItem", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", + "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", + "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", +] diff --git a/src/supermemory/memories/types/get_memories_request_include_item.py b/src/supermemory/memories/types/get_memories_request_include_item.py new file mode 100644 index 0000000..be2ea50 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_request_include_item.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetMemoriesRequestIncludeItem = typing.Union[typing.Literal["related", "documents"], typing.Any] diff --git a/src/supermemory/memories/types/get_memories_response.py b/src/supermemory/memories/types/get_memories_response.py new file mode 100644 index 0000000..de7341e --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel +from ...types.memory_system import MemorySystem +from .get_memories_response_included import GetMemoriesResponseIncluded + + +class GetMemoriesResponse(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Stable memory identifier + """ + + memory: str = pydantic.Field() + """ + Learned fact or context extracted from the document + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Memory metadata, including temporal context; empty object when none + """ + + is_static: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="isStatic"), + pydantic.Field(alias="isStatic", description="Whether the memory belongs to the stable profile section"), + ] + """ + Whether the memory belongs to the stable profile section + """ + + is_inference: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="isInference"), + pydantic.Field( + alias="isInference", description="Whether the memory was inferred rather than explicitly stated" + ), + ] + """ + Whether the memory was inferred rather than explicitly stated + """ + + is_latest: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="isLatest"), + pydantic.Field(alias="isLatest", description="Whether this is the newest version in its memory chain"), + ] + """ + Whether this is the newest version in its memory chain + """ + + is_forgotten: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="isForgotten"), + pydantic.Field(alias="isForgotten", description="Whether this memory has been excluded from normal recall"), + ] + """ + Whether this memory has been excluded from normal recall + """ + + version: int = pydantic.Field() + """ + Version number within the memory chain + """ + + system: MemorySystem = pydantic.Field() + """ + Lifecycle timestamps maintained by Supermemory + """ + + included: typing.Optional[GetMemoriesResponseIncluded] = pydantic.Field(default=None) + """ + Requested extras + """ + + 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/types/get_memories_response_included.py b/src/supermemory/memories/types/get_memories_response_included.py new file mode 100644 index 0000000..2d96d61 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included.py @@ -0,0 +1,34 @@ +# 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 +from .get_memories_response_included_document import GetMemoriesResponseIncludedDocument +from .get_memories_response_included_related import GetMemoriesResponseIncludedRelated + + +class GetMemoriesResponseIncluded(UncheckedBaseModel): + """ + Requested extras + """ + + related: typing.Optional[GetMemoriesResponseIncludedRelated] = pydantic.Field(default=None) + """ + Present when include has related + """ + + document: typing.Optional[GetMemoriesResponseIncludedDocument] = pydantic.Field(default=None) + """ + Source document; present when include has documents and one exists + """ + + 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/types/get_memories_response_included_document.py b/src/supermemory/memories/types/get_memories_response_included_document.py new file mode 100644 index 0000000..5164273 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_document.py @@ -0,0 +1,53 @@ +# 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 +from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystem + + +class GetMemoriesResponseIncludedDocument(UncheckedBaseModel): + """ + Source document; present when include has documents and one exists + """ + + id: str = pydantic.Field() + """ + Source document identifier + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + Source document title + """ + + type: typing.Optional[str] = pydantic.Field(default=None) + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] = pydantic.Field(default=None) + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedDocumentSystem = pydantic.Field() + """ + Lifecycle timestamps maintained by Supermemory + """ + + 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/types/get_memories_response_included_document_system.py b/src/supermemory/memories/types/get_memories_response_included_document_system.py new file mode 100644 index 0000000..c3a1c04 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_document_system.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedDocumentSystem(UncheckedBaseModel): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), + ] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), + ] + """ + ISO 8601 timestamp of the source document's latest update + """ + + 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/types/get_memories_response_included_related.py b/src/supermemory/memories/types/get_memories_response_included_related.py new file mode 100644 index 0000000..1ef7b40 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related.py @@ -0,0 +1,40 @@ +# 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 +from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItem +from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItem +from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItem + + +class GetMemoriesResponseIncludedRelated(UncheckedBaseModel): + """ + Present when include has related + """ + + parents: typing.List[GetMemoriesResponseIncludedRelatedParentsItem] = pydantic.Field() + """ + Earlier versions this memory updates, nearest first + """ + + children: typing.List[GetMemoriesResponseIncludedRelatedChildrenItem] = pydantic.Field() + """ + Newer versions that update this memory, nearest first + """ + + siblings: typing.List[GetMemoriesResponseIncludedRelatedSiblingsItem] = pydantic.Field() + """ + Memories connected by extends or derives, nearest first + """ + + 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/types/get_memories_response_included_related_children_item.py b/src/supermemory/memories/types/get_memories_response_included_related_children_item.py new file mode 100644 index 0000000..22af6fd --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_children_item.py @@ -0,0 +1,60 @@ +# 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 +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_children_item_document import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocument, +) +from .get_memories_response_included_related_children_item_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemSystem, +) + + +class GetMemoriesResponseIncludedRelatedChildrenItem(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Related memory ID + """ + + relation: MemoryRelation = pydantic.Field() + """ + How this memory is connected to the matched memory + """ + + version: typing.Optional[float] = pydantic.Field(default=None) + """ + Version number within the related memory's history + """ + + memory: str = pydantic.Field() + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedChildrenItemSystem = pydantic.Field() + """ + Lifecycle details for the related memory + """ + + document: typing.Optional[GetMemoriesResponseIncludedRelatedChildrenItemDocument] = pydantic.Field(default=None) + """ + Source document; present when include has both related and documents + """ + + 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/types/get_memories_response_included_related_children_item_document.py b/src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py new file mode 100644 index 0000000..068de0b --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py @@ -0,0 +1,55 @@ +# 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 +from .get_memories_response_included_related_children_item_document_system import ( + GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, +) + + +class GetMemoriesResponseIncludedRelatedChildrenItemDocument(UncheckedBaseModel): + """ + Source document; present when include has both related and documents + """ + + id: str = pydantic.Field() + """ + Source document identifier + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + Source document title + """ + + type: typing.Optional[str] = pydantic.Field(default=None) + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] = pydantic.Field(default=None) + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem = pydantic.Field() + """ + Lifecycle timestamps maintained by Supermemory + """ + + 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/types/get_memories_response_included_related_children_item_document_system.py b/src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py new file mode 100644 index 0000000..f784385 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem(UncheckedBaseModel): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), + ] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), + ] + """ + ISO 8601 timestamp of the source document's latest update + """ + + 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/types/get_memories_response_included_related_children_item_system.py b/src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py new file mode 100644 index 0000000..18ecda1 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedChildrenItemSystem(UncheckedBaseModel): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the related memory's latest update"), + ] + """ + ISO 8601 timestamp of the related memory's latest update + """ + + 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/types/get_memories_response_included_related_parents_item.py b/src/supermemory/memories/types/get_memories_response_included_related_parents_item.py new file mode 100644 index 0000000..2a5d62c --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_parents_item.py @@ -0,0 +1,60 @@ +# 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 +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_parents_item_document import ( + GetMemoriesResponseIncludedRelatedParentsItemDocument, +) +from .get_memories_response_included_related_parents_item_system import ( + GetMemoriesResponseIncludedRelatedParentsItemSystem, +) + + +class GetMemoriesResponseIncludedRelatedParentsItem(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Related memory ID + """ + + relation: MemoryRelation = pydantic.Field() + """ + How this memory is connected to the matched memory + """ + + version: typing.Optional[float] = pydantic.Field(default=None) + """ + Version number within the related memory's history + """ + + memory: str = pydantic.Field() + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedParentsItemSystem = pydantic.Field() + """ + Lifecycle details for the related memory + """ + + document: typing.Optional[GetMemoriesResponseIncludedRelatedParentsItemDocument] = pydantic.Field(default=None) + """ + Source document; present when include has both related and documents + """ + + 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/types/get_memories_response_included_related_parents_item_document.py b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py new file mode 100644 index 0000000..c85f362 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py @@ -0,0 +1,55 @@ +# 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 +from .get_memories_response_included_related_parents_item_document_system import ( + GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, +) + + +class GetMemoriesResponseIncludedRelatedParentsItemDocument(UncheckedBaseModel): + """ + Source document; present when include has both related and documents + """ + + id: str = pydantic.Field() + """ + Source document identifier + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + Source document title + """ + + type: typing.Optional[str] = pydantic.Field(default=None) + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] = pydantic.Field(default=None) + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem = pydantic.Field() + """ + Lifecycle timestamps maintained by Supermemory + """ + + 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/types/get_memories_response_included_related_parents_item_document_system.py b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py new file mode 100644 index 0000000..5574bb9 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem(UncheckedBaseModel): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), + ] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), + ] + """ + ISO 8601 timestamp of the source document's latest update + """ + + 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/types/get_memories_response_included_related_parents_item_system.py b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py new file mode 100644 index 0000000..3ec820b --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedParentsItemSystem(UncheckedBaseModel): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the related memory's latest update"), + ] + """ + ISO 8601 timestamp of the related memory's latest update + """ + + 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/types/get_memories_response_included_related_siblings_item.py b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py new file mode 100644 index 0000000..1e27021 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py @@ -0,0 +1,60 @@ +# 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 +from ...types.memory_relation import MemoryRelation +from .get_memories_response_included_related_siblings_item_document import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocument, +) +from .get_memories_response_included_related_siblings_item_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemSystem, +) + + +class GetMemoriesResponseIncludedRelatedSiblingsItem(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Related memory ID + """ + + relation: MemoryRelation = pydantic.Field() + """ + How this memory is connected to the matched memory + """ + + version: typing.Optional[float] = pydantic.Field(default=None) + """ + Version number within the related memory's history + """ + + memory: str = pydantic.Field() + """ + Related learned fact or context + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata associated with the related memory + """ + + system: GetMemoriesResponseIncludedRelatedSiblingsItemSystem = pydantic.Field() + """ + Lifecycle details for the related memory + """ + + document: typing.Optional[GetMemoriesResponseIncludedRelatedSiblingsItemDocument] = pydantic.Field(default=None) + """ + Source document; present when include has both related and documents + """ + + 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/types/get_memories_response_included_related_siblings_item_document.py b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py new file mode 100644 index 0000000..78d43f5 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py @@ -0,0 +1,55 @@ +# 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 +from .get_memories_response_included_related_siblings_item_document_system import ( + GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, +) + + +class GetMemoriesResponseIncludedRelatedSiblingsItemDocument(UncheckedBaseModel): + """ + Source document; present when include has both related and documents + """ + + id: str = pydantic.Field() + """ + Source document identifier + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + Source document title + """ + + type: typing.Optional[str] = pydantic.Field(default=None) + """ + Detected source or content type + """ + + metadata: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Public metadata attached to the source document + """ + + summary: typing.Optional[str] = pydantic.Field(default=None) + """ + Generated summary of the source document + """ + + system: GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem = pydantic.Field() + """ + Lifecycle timestamps maintained by Supermemory + """ + + 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/types/get_memories_response_included_related_siblings_item_document_system.py b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py new file mode 100644 index 0000000..1650e37 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem(UncheckedBaseModel): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), + ] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), + ] + """ + ISO 8601 timestamp of the source document's latest update + """ + + 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/types/get_memories_response_included_related_siblings_item_system.py b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py new file mode 100644 index 0000000..7eabdf6 --- /dev/null +++ b/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetMemoriesResponseIncludedRelatedSiblingsItemSystem(UncheckedBaseModel): + """ + Lifecycle details for the related memory + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the related memory's latest update"), + ] + """ + ISO 8601 timestamp of the related memory's latest update + """ + + 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/namespaces/__init__.py b/src/supermemory/namespaces/__init__.py index 5cde020..3c9eaff 100644 --- a/src/supermemory/namespaces/__init__.py +++ b/src/supermemory/namespaces/__init__.py @@ -2,3 +2,56 @@ # isort: skip_file +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ListNamespacesResponse, + ListNamespacesResponseNamespacesItem, + ListNamespacesResponseNamespacesItemSystem, + ) + from .requests import ( + ListNamespacesResponseNamespacesItemParams, + ListNamespacesResponseNamespacesItemSystemParams, + ListNamespacesResponseParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ListNamespacesResponse": ".types", + "ListNamespacesResponseNamespacesItem": ".types", + "ListNamespacesResponseNamespacesItemParams": ".requests", + "ListNamespacesResponseNamespacesItemSystem": ".types", + "ListNamespacesResponseNamespacesItemSystemParams": ".requests", + "ListNamespacesResponseParams": ".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__ = [ + "ListNamespacesResponse", + "ListNamespacesResponseNamespacesItem", + "ListNamespacesResponseNamespacesItemParams", + "ListNamespacesResponseNamespacesItemSystem", + "ListNamespacesResponseNamespacesItemSystemParams", + "ListNamespacesResponseParams", +] diff --git a/src/supermemory/namespaces/client.py b/src/supermemory/namespaces/client.py index 070bd37..8eac474 100644 --- a/src/supermemory/namespaces/client.py +++ b/src/supermemory/namespaces/client.py @@ -8,10 +8,10 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.namespace import Namespace from ..types.namespace_deleted import NamespaceDeleted from ..types.namespace_details import NamespaceDetails from .raw_client import AsyncRawNamespacesClient, RawNamespacesClient +from .types.list_namespaces_response import ListNamespacesResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -35,23 +35,31 @@ def with_raw_response(self) -> RawNamespacesClient: def list( self, *, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, 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, - ) -> typing.List[Namespace]: + ) -> ListNamespacesResponse: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. Parameters ---------- + page : typing.Optional[int] + One-based page number + + limit : typing.Optional[int] + Maximum namespaces to return per page + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[Namespace] + ListNamespacesResponse Namespaces available to the caller Examples @@ -63,7 +71,7 @@ def list( ) client.namespaces.list() """ - _response = self._raw_client.list(request_options=request_options) + _response = self._raw_client.list(page=page, limit=limit, request_options=request_options) return _response.data def get( @@ -110,7 +118,7 @@ def delete( self, namespace: str, *, - move_to: typing.Optional[str] = OMIT, + move_to: typing.Optional[str] = None, 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, @@ -145,6 +153,7 @@ def delete( ) client.namespaces.delete( namespace="user_alex", + move_to="project_archive", ) """ _response = self._raw_client.delete(namespace, move_to=move_to, request_options=request_options) @@ -215,23 +224,31 @@ def with_raw_response(self) -> AsyncRawNamespacesClient: async def list( self, *, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, 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, - ) -> typing.List[Namespace]: + ) -> ListNamespacesResponse: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. Parameters ---------- + page : typing.Optional[int] + One-based page number + + limit : typing.Optional[int] + Maximum namespaces to return per page + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[Namespace] + ListNamespacesResponse Namespaces available to the caller Examples @@ -251,7 +268,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(request_options=request_options) + _response = await self._raw_client.list(page=page, limit=limit, request_options=request_options) return _response.data async def get( @@ -306,7 +323,7 @@ async def delete( self, namespace: str, *, - move_to: typing.Optional[str] = OMIT, + move_to: typing.Optional[str] = None, 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, @@ -346,6 +363,7 @@ async def delete( async def main() -> None: await client.namespaces.delete( namespace="user_alex", + move_to="project_archive", ) diff --git a/src/supermemory/namespaces/raw_client.py b/src/supermemory/namespaces/raw_client.py index 5d90c23..aa8f373 100644 --- a/src/supermemory/namespaces/raw_client.py +++ b/src/supermemory/namespaces/raw_client.py @@ -22,9 +22,9 @@ from ..errors.unauthorized_error import UnauthorizedError from ..types.bad_request_error_body import BadRequestErrorBody from ..types.error_response import ErrorResponse -from ..types.namespace import Namespace from ..types.namespace_deleted import NamespaceDeleted from ..types.namespace_details import NamespaceDetails +from .types.list_namespaces_response import ListNamespacesResponse from pydantic import ValidationError # this is used as the default value for optional parameters @@ -38,40 +38,63 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, 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[typing.List[Namespace]]: + ) -> HttpResponse[ListNamespacesResponse]: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. Parameters ---------- + page : typing.Optional[int] + One-based page number + + limit : typing.Optional[int] + Maximum namespaces to return per page + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[typing.List[Namespace]] + HttpResponse[ListNamespacesResponse] Namespaces available to the caller """ _response = self._client_wrapper.httpx_client.request( "ns", method="GET", + params={ + "page": page, + "limit": limit, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - typing.List[Namespace], + ListNamespacesResponse, construct_type( - type_=typing.List[Namespace], # type: ignore + type_=ListNamespacesResponse, # 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), @@ -223,7 +246,7 @@ def delete( self, namespace: str, *, - move_to: typing.Optional[str] = OMIT, + move_to: typing.Optional[str] = None, 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, @@ -252,14 +275,10 @@ def delete( _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}", method="DELETE", - json={ + params={ "moveTo": move_to, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: @@ -470,40 +489,63 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, 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[typing.List[Namespace]]: + ) -> AsyncHttpResponse[ListNamespacesResponse]: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. Parameters ---------- + page : typing.Optional[int] + One-based page number + + limit : typing.Optional[int] + Maximum namespaces to return per page + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[typing.List[Namespace]] + AsyncHttpResponse[ListNamespacesResponse] Namespaces available to the caller """ _response = await self._client_wrapper.httpx_client.request( "ns", method="GET", + params={ + "page": page, + "limit": limit, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - typing.List[Namespace], + ListNamespacesResponse, construct_type( - type_=typing.List[Namespace], # type: ignore + type_=ListNamespacesResponse, # 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), @@ -655,7 +697,7 @@ async def delete( self, namespace: str, *, - move_to: typing.Optional[str] = OMIT, + move_to: typing.Optional[str] = None, 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, @@ -684,14 +726,10 @@ async def delete( _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}", method="DELETE", - json={ + params={ "moveTo": move_to, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: diff --git a/src/supermemory/namespaces/requests/__init__.py b/src/supermemory/namespaces/requests/__init__.py new file mode 100644 index 0000000..c013ed7 --- /dev/null +++ b/src/supermemory/namespaces/requests/__init__.py @@ -0,0 +1,44 @@ +# 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 .list_namespaces_response import ListNamespacesResponseParams + from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItemParams + from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystemParams +_dynamic_imports: typing.Dict[str, str] = { + "ListNamespacesResponseNamespacesItemParams": ".list_namespaces_response_namespaces_item", + "ListNamespacesResponseNamespacesItemSystemParams": ".list_namespaces_response_namespaces_item_system", + "ListNamespacesResponseParams": ".list_namespaces_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__ = [ + "ListNamespacesResponseNamespacesItemParams", + "ListNamespacesResponseNamespacesItemSystemParams", + "ListNamespacesResponseParams", +] diff --git a/src/supermemory/namespaces/requests/list_namespaces_response.py b/src/supermemory/namespaces/requests/list_namespaces_response.py new file mode 100644 index 0000000..8993e49 --- /dev/null +++ b/src/supermemory/namespaces/requests/list_namespaces_response.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ...requests.pagination import PaginationParams +from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItemParams + + +class ListNamespacesResponseParams(typing_extensions.TypedDict): + namespaces: typing.Sequence[ListNamespacesResponseNamespacesItemParams] + """ + Namespaces on this page, newest first + """ + + pagination: PaginationParams + """ + Pagination metadata + """ diff --git a/src/supermemory/requests/namespace.py b/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py similarity index 71% rename from src/supermemory/requests/namespace.py rename to src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py index 03949b1..61c42c1 100644 --- a/src/supermemory/requests/namespace.py +++ b/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py @@ -3,11 +3,11 @@ import typing import typing_extensions -from ..core.serialization import FieldMetadata -from .namespace_system import NamespaceSystemParams +from ...core.serialization import FieldMetadata +from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystemParams -class NamespaceParams(typing_extensions.TypedDict): +class ListNamespacesResponseNamespacesItemParams(typing_extensions.TypedDict): id: str """ Internal identifier for the namespace @@ -33,7 +33,7 @@ class NamespaceParams(typing_extensions.TypedDict): Human-readable purpose or scope of the namespace """ - system: NamespaceSystemParams + system: ListNamespacesResponseNamespacesItemSystemParams """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py b/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py new file mode 100644 index 0000000..d34d1c9 --- /dev/null +++ b/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + +import typing_extensions +from ...core.serialization import FieldMetadata + + +class ListNamespacesResponseNamespacesItemSystemParams(typing_extensions.TypedDict): + """ + Namespace lifecycle timestamps + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the namespace was created + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the latest namespace update + """ diff --git a/src/supermemory/namespaces/types/__init__.py b/src/supermemory/namespaces/types/__init__.py new file mode 100644 index 0000000..f5f91a3 --- /dev/null +++ b/src/supermemory/namespaces/types/__init__.py @@ -0,0 +1,44 @@ +# 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 .list_namespaces_response import ListNamespacesResponse + from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItem + from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystem +_dynamic_imports: typing.Dict[str, str] = { + "ListNamespacesResponse": ".list_namespaces_response", + "ListNamespacesResponseNamespacesItem": ".list_namespaces_response_namespaces_item", + "ListNamespacesResponseNamespacesItemSystem": ".list_namespaces_response_namespaces_item_system", +} + + +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__ = [ + "ListNamespacesResponse", + "ListNamespacesResponseNamespacesItem", + "ListNamespacesResponseNamespacesItemSystem", +] diff --git a/src/supermemory/namespaces/types/list_namespaces_response.py b/src/supermemory/namespaces/types/list_namespaces_response.py new file mode 100644 index 0000000..49ad06a --- /dev/null +++ b/src/supermemory/namespaces/types/list_namespaces_response.py @@ -0,0 +1,30 @@ +# 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 +from ...types.pagination import Pagination +from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItem + + +class ListNamespacesResponse(UncheckedBaseModel): + namespaces: typing.List[ListNamespacesResponseNamespacesItem] = pydantic.Field() + """ + Namespaces on this page, newest first + """ + + pagination: Pagination = pydantic.Field() + """ + Pagination metadata + """ + + 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/types/namespace.py b/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py similarity index 77% rename from src/supermemory/types/namespace.py rename to src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py index d97b5ca..2e094e2 100644 --- a/src/supermemory/types/namespace.py +++ b/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py @@ -4,13 +4,13 @@ import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .namespace_system import NamespaceSystem +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel +from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystem -class Namespace(UncheckedBaseModel): +class ListNamespacesResponseNamespacesItem(UncheckedBaseModel): id: str = pydantic.Field() """ Internal identifier for the namespace @@ -44,7 +44,7 @@ class Namespace(UncheckedBaseModel): Human-readable purpose or scope of the namespace """ - system: NamespaceSystem = pydantic.Field() + system: ListNamespacesResponseNamespacesItemSystem = pydantic.Field() """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py b/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py new file mode 100644 index 0000000..0100ae4 --- /dev/null +++ b/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel + + +class ListNamespacesResponseNamespacesItemSystem(UncheckedBaseModel): + """ + Namespace lifecycle timestamps + """ + + created_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the namespace was created"), + ] + """ + ISO 8601 timestamp when the namespace was created + """ + + updated_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest namespace update"), + ] + """ + ISO 8601 timestamp of the latest namespace update + """ + + 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/raw_client.py b/src/supermemory/raw_client.py index 6629d2e..715a0d4 100644 --- a/src/supermemory/raw_client.py +++ b/src/supermemory/raw_client.py @@ -22,23 +22,22 @@ from .errors.payment_required_error import PaymentRequiredError from .errors.unauthorized_error import UnauthorizedError from .requests.filter_expression import FilterExpressionParams -from .requests.list_request_limit import ListRequestLimitParams -from .requests.list_request_page import ListRequestPageParams +from .requests.list_request_include import ListRequestIncludeParams from .requests.metadata_value import MetadataValueParams -from .requests.search_request_attach import SearchRequestAttachParams +from .requests.search_request_include import SearchRequestIncludeParams +from .types.add_request_dreaming import AddRequestDreaming +from .types.add_request_task_type import AddRequestTaskType from .types.bad_request_error_body import BadRequestErrorBody from .types.document_ref import DocumentRef -from .types.dreaming_mode import DreamingMode from .types.error_response import ErrorResponse from .types.list_response import ListResponse from .types.list_sort import ListSort from .types.list_type import ListType from .types.profile_response import ProfileResponse -from .types.search_mode import SearchMode from .types.search_request_rerank import SearchRequestRerank +from .types.search_request_search_mode import SearchRequestSearchMode from .types.search_response import SearchResponse from .types.sort_order import SortOrder -from .types.task_type import TaskType from pydantic import ValidationError # this is used as the default value for optional parameters @@ -54,13 +53,13 @@ def add( namespace: str, *, content: str, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, id: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[AddRequestTaskType] = OMIT, + dreaming: typing.Optional[AddRequestDreaming] = 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, @@ -78,12 +77,6 @@ def add( content : str The content to process. This may be plaintext or a URL to supported rich content. - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - id : typing.Optional[str] An optional caller-defined document ID @@ -99,6 +92,12 @@ def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[AddRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[AddRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -110,10 +109,6 @@ def add( _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "content": content, "id": id, @@ -125,6 +120,8 @@ def add( object_=group, annotation=typing.Dict[str, MetadataValueParams], direction="write" ), "date": date, + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -222,10 +219,10 @@ def search( namespace: str, *, query: str, - limit: typing.Optional[int] = None, - search_mode: typing.Optional[SearchMode] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, - attach: typing.Optional[SearchRequestAttachParams] = OMIT, + search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + limit: typing.Optional[int] = OMIT, + include: typing.Optional[SearchRequestIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -246,16 +243,16 @@ def search( query : str Natural-language question, topic, or phrase to retrieve relevant context for. Replaces the v4 `q` field. - limit : typing.Optional[int] - Maximum number of results to return + filter : typing.Optional[FilterExpressionParams] + Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchMode] + search_mode : typing.Optional[SearchRequestSearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. - filter : typing.Optional[FilterExpressionParams] - Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. + limit : typing.Optional[int] + Maximum number of results to return - attach : typing.Optional[SearchRequestAttachParams] + include : typing.Optional[SearchRequestIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -278,17 +275,15 @@ def search( _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/search", method="POST", - params={ - "limit": limit, - "searchMode": search_mode, - }, json={ "query": query, "filter": convert_and_respect_annotation_metadata( object_=filter, annotation=FilterExpressionParams, direction="write" ), - "attach": convert_and_respect_annotation_metadata( - object_=attach, annotation=SearchRequestAttachParams, direction="write" + "searchMode": search_mode, + "limit": limit, + "include": convert_and_respect_annotation_metadata( + object_=include, annotation=SearchRequestIncludeParams, direction="write" ), "threshold": threshold, "rerank": rerank, @@ -491,11 +486,12 @@ def list( namespace: str, type: ListType, *, - page: typing.Optional[ListRequestPageParams] = None, - limit: typing.Optional[ListRequestLimitParams] = None, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, order: typing.Optional[SortOrder] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, + include: typing.Optional[ListRequestIncludeParams] = 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, @@ -513,10 +509,10 @@ def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories - page : typing.Optional[ListRequestPageParams] + page : typing.Optional[int] One-based page number - limit : typing.Optional[ListRequestLimitParams] + limit : typing.Optional[int] Maximum resources to return per page sort : typing.Optional[ListSort] @@ -528,6 +524,9 @@ def list( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before pagination + include : typing.Optional[ListRequestIncludeParams] + Optional extras, matching search's include + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -540,12 +539,8 @@ def list( f"ns/{encode_path_param(namespace)}/list/{encode_path_param(type)}", method="POST", params={ - "page": convert_and_respect_annotation_metadata( - object_=page, annotation=ListRequestPageParams, direction="write" - ), - "limit": convert_and_respect_annotation_metadata( - object_=limit, annotation=ListRequestLimitParams, direction="write" - ), + "page": page, + "limit": limit, "sort": sort, "order": order, }, @@ -553,6 +548,9 @@ def list( "filter": convert_and_respect_annotation_metadata( object_=filter, annotation=FilterExpressionParams, direction="write" ), + "include": convert_and_respect_annotation_metadata( + object_=include, annotation=ListRequestIncludeParams, direction="write" + ), }, headers={ "content-type": "application/json", @@ -633,13 +631,13 @@ async def add( namespace: str, *, content: str, - task_type: typing.Optional[TaskType] = None, - dreaming: typing.Optional[DreamingMode] = None, id: typing.Optional[str] = OMIT, supporting_context: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, + task_type: typing.Optional[AddRequestTaskType] = OMIT, + dreaming: typing.Optional[AddRequestDreaming] = 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, @@ -657,12 +655,6 @@ async def add( content : str The content to process. This may be plaintext or a URL to supported rich content. - task_type : typing.Optional[TaskType] - Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - - dreaming : typing.Optional[DreamingMode] - Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - id : typing.Optional[str] An optional caller-defined document ID @@ -678,6 +670,12 @@ async def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format + task_type : typing.Optional[AddRequestTaskType] + Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. + + dreaming : typing.Optional[AddRequestDreaming] + Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -689,10 +687,6 @@ async def add( _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/document", method="POST", - params={ - "taskType": task_type, - "dreaming": dreaming, - }, json={ "content": content, "id": id, @@ -704,6 +698,8 @@ async def add( object_=group, annotation=typing.Dict[str, MetadataValueParams], direction="write" ), "date": date, + "taskType": task_type, + "dreaming": dreaming, }, headers={ "content-type": "application/json", @@ -801,10 +797,10 @@ async def search( namespace: str, *, query: str, - limit: typing.Optional[int] = None, - search_mode: typing.Optional[SearchMode] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, - attach: typing.Optional[SearchRequestAttachParams] = OMIT, + search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + limit: typing.Optional[int] = OMIT, + include: typing.Optional[SearchRequestIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -825,16 +821,16 @@ async def search( query : str Natural-language question, topic, or phrase to retrieve relevant context for. Replaces the v4 `q` field. - limit : typing.Optional[int] - Maximum number of results to return + filter : typing.Optional[FilterExpressionParams] + Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchMode] + search_mode : typing.Optional[SearchRequestSearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. - filter : typing.Optional[FilterExpressionParams] - Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. + limit : typing.Optional[int] + Maximum number of results to return - attach : typing.Optional[SearchRequestAttachParams] + include : typing.Optional[SearchRequestIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -857,17 +853,15 @@ async def search( _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}/search", method="POST", - params={ - "limit": limit, - "searchMode": search_mode, - }, json={ "query": query, "filter": convert_and_respect_annotation_metadata( object_=filter, annotation=FilterExpressionParams, direction="write" ), - "attach": convert_and_respect_annotation_metadata( - object_=attach, annotation=SearchRequestAttachParams, direction="write" + "searchMode": search_mode, + "limit": limit, + "include": convert_and_respect_annotation_metadata( + object_=include, annotation=SearchRequestIncludeParams, direction="write" ), "threshold": threshold, "rerank": rerank, @@ -1070,11 +1064,12 @@ async def list( namespace: str, type: ListType, *, - page: typing.Optional[ListRequestPageParams] = None, - limit: typing.Optional[ListRequestLimitParams] = None, + page: typing.Optional[int] = None, + limit: typing.Optional[int] = None, sort: typing.Optional[ListSort] = None, order: typing.Optional[SortOrder] = None, filter: typing.Optional[FilterExpressionParams] = OMIT, + include: typing.Optional[ListRequestIncludeParams] = 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, @@ -1092,10 +1087,10 @@ async def list( type : ListType Resource collection to list: source documents, extracted chunks, or learned memories - page : typing.Optional[ListRequestPageParams] + page : typing.Optional[int] One-based page number - limit : typing.Optional[ListRequestLimitParams] + limit : typing.Optional[int] Maximum resources to return per page sort : typing.Optional[ListSort] @@ -1107,6 +1102,9 @@ async def list( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before pagination + include : typing.Optional[ListRequestIncludeParams] + Optional extras, matching search's include + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1119,12 +1117,8 @@ async def list( f"ns/{encode_path_param(namespace)}/list/{encode_path_param(type)}", method="POST", params={ - "page": convert_and_respect_annotation_metadata( - object_=page, annotation=ListRequestPageParams, direction="write" - ), - "limit": convert_and_respect_annotation_metadata( - object_=limit, annotation=ListRequestLimitParams, direction="write" - ), + "page": page, + "limit": limit, "sort": sort, "order": order, }, @@ -1132,6 +1126,9 @@ async def list( "filter": convert_and_respect_annotation_metadata( object_=filter, annotation=FilterExpressionParams, direction="write" ), + "include": convert_and_respect_annotation_metadata( + object_=include, annotation=ListRequestIncludeParams, direction="write" + ), }, headers={ "content-type": "application/json", diff --git a/src/supermemory/requests/__init__.py b/src/supermemory/requests/__init__.py index b52199f..b610c67 100644 --- a/src/supermemory/requests/__init__.py +++ b/src/supermemory/requests/__init__.py @@ -49,10 +49,10 @@ from .document import DocumentParams from .document_input import DocumentInputParams from .document_list_item import DocumentListItemParams + from .document_list_item_system import DocumentListItemSystemParams from .document_ref import DocumentRefParams from .document_system import DocumentSystemParams from .error_response import ErrorResponseParams - from .file_upload_result import FileUploadResultParams from .filter_and import FilterAndParams from .filter_array_contains import FilterArrayContainsParams from .filter_expression import FilterExpressionParams @@ -68,18 +68,16 @@ from .forget_result import ForgetResultParams from .google_drive_config import GoogleDriveConfigParams from .granola_config import GranolaConfigParams - from .list_request_limit import ListRequestLimitParams - from .list_request_page import ListRequestPageParams + from .list_request_include import ListRequestIncludeParams from .list_response import ListResponseParams from .memory import MemoryParams from .memory_system import MemorySystemParams from .metadata_value import MetadataValueParams - from .namespace import NamespaceParams from .namespace_deleted import NamespaceDeletedParams, NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams from .namespace_deleted_deleted import NamespaceDeletedDeletedParams from .namespace_deleted_queued import NamespaceDeletedQueuedParams from .namespace_details import NamespaceDetailsParams - from .namespace_system import NamespaceSystemParams + from .namespace_details_system import NamespaceDetailsSystemParams from .organization import OrganizationParams from .pagination import PaginationParams from .profile import ProfileParams @@ -90,11 +88,12 @@ from .related_memory import RelatedMemoryParams from .related_memory_system import RelatedMemorySystemParams from .s3config import S3ConfigParams - from .search_request_attach import SearchRequestAttachParams + from .search_request_include import SearchRequestIncludeParams from .search_response import SearchResponseParams from .search_result import SearchResultParams from .search_result_included import SearchResultIncludedParams from .search_result_included_document import SearchResultIncludedDocumentParams + from .search_result_included_document_system import SearchResultIncludedDocumentSystemParams from .search_result_system import SearchResultSystemParams from .validation_error_response import ValidationErrorResponseParams from .validation_error_response_error_item import ValidationErrorResponseErrorItemParams @@ -141,11 +140,11 @@ "DeleteDocumentsResultParams": ".delete_documents_result", "DocumentInputParams": ".document_input", "DocumentListItemParams": ".document_list_item", + "DocumentListItemSystemParams": ".document_list_item_system", "DocumentParams": ".document", "DocumentRefParams": ".document_ref", "DocumentSystemParams": ".document_system", "ErrorResponseParams": ".error_response", - "FileUploadResultParams": ".file_upload_result", "FilterAndParams": ".filter_and", "FilterArrayContainsParams": ".filter_array_contains", "FilterExpressionParams": ".filter_expression", @@ -161,8 +160,7 @@ "ForgetResultParams": ".forget_result", "GoogleDriveConfigParams": ".google_drive_config", "GranolaConfigParams": ".granola_config", - "ListRequestLimitParams": ".list_request_limit", - "ListRequestPageParams": ".list_request_page", + "ListRequestIncludeParams": ".list_request_include", "ListResponseParams": ".list_response", "MemoryParams": ".memory", "MemorySystemParams": ".memory_system", @@ -173,8 +171,7 @@ "NamespaceDeleted_DeletedParams": ".namespace_deleted", "NamespaceDeleted_QueuedParams": ".namespace_deleted", "NamespaceDetailsParams": ".namespace_details", - "NamespaceParams": ".namespace", - "NamespaceSystemParams": ".namespace_system", + "NamespaceDetailsSystemParams": ".namespace_details_system", "OrganizationParams": ".organization", "PaginationParams": ".pagination", "ProfileBucketsParams": ".profile_buckets", @@ -185,9 +182,10 @@ "RelatedMemoryParams": ".related_memory", "RelatedMemorySystemParams": ".related_memory_system", "S3ConfigParams": ".s3config", - "SearchRequestAttachParams": ".search_request_attach", + "SearchRequestIncludeParams": ".search_request_include", "SearchResponseParams": ".search_response", "SearchResultIncludedDocumentParams": ".search_result_included_document", + "SearchResultIncludedDocumentSystemParams": ".search_result_included_document_system", "SearchResultIncludedParams": ".search_result_included", "SearchResultParams": ".search_result", "SearchResultSystemParams": ".search_result_system", @@ -260,11 +258,11 @@ def __dir__(): "DeleteDocumentsResultParams", "DocumentInputParams", "DocumentListItemParams", + "DocumentListItemSystemParams", "DocumentParams", "DocumentRefParams", "DocumentSystemParams", "ErrorResponseParams", - "FileUploadResultParams", "FilterAndParams", "FilterArrayContainsParams", "FilterExpressionParams", @@ -280,8 +278,7 @@ def __dir__(): "ForgetResultParams", "GoogleDriveConfigParams", "GranolaConfigParams", - "ListRequestLimitParams", - "ListRequestPageParams", + "ListRequestIncludeParams", "ListResponseParams", "MemoryParams", "MemorySystemParams", @@ -292,8 +289,7 @@ def __dir__(): "NamespaceDeleted_DeletedParams", "NamespaceDeleted_QueuedParams", "NamespaceDetailsParams", - "NamespaceParams", - "NamespaceSystemParams", + "NamespaceDetailsSystemParams", "OrganizationParams", "PaginationParams", "ProfileBucketsParams", @@ -304,9 +300,10 @@ def __dir__(): "RelatedMemoryParams", "RelatedMemorySystemParams", "S3ConfigParams", - "SearchRequestAttachParams", + "SearchRequestIncludeParams", "SearchResponseParams", "SearchResultIncludedDocumentParams", + "SearchResultIncludedDocumentSystemParams", "SearchResultIncludedParams", "SearchResultParams", "SearchResultSystemParams", diff --git a/src/supermemory/requests/batch_add_item_result.py b/src/supermemory/requests/batch_add_item_result.py index 69b4ecf..15240d4 100644 --- a/src/supermemory/requests/batch_add_item_result.py +++ b/src/supermemory/requests/batch_add_item_result.py @@ -1,30 +1,31 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +from ..types.batch_add_item_result_status import BatchAddItemResultStatus class BatchAddItemResultParams(typing_extensions.TypedDict): id: str """ - Unique identifier of the document (empty string for failed items) + Document identifier """ - status: str + status: BatchAddItemResultStatus """ - Status of the document (e.g. 'done', 'queued', 'error') + The document's processing state, as for a single add; error when this item failed """ error: typing_extensions.NotRequired[str] """ - Error message when status is 'error' + Failure reason """ details: typing_extensions.NotRequired[str] """ - Additional error details when status is 'error' + Human-readable explanation of the failure """ url: typing_extensions.NotRequired[str] """ - URL of the failed item, when it had one. Only present on failed items, where it may be the only way to tell which input the error belongs to (the id falls back to 'unknown' when the input had neither an id nor a customId). + URL of the failed item, when it had one """ diff --git a/src/supermemory/requests/batch_add_result.py b/src/supermemory/requests/batch_add_result.py index 4c7313a..b878262 100644 --- a/src/supermemory/requests/batch_add_result.py +++ b/src/supermemory/requests/batch_add_result.py @@ -9,15 +9,15 @@ class BatchAddResultParams(typing_extensions.TypedDict): results: typing.Sequence[BatchAddItemResultParams] """ - Array of results for each document in the batch + One result per submitted document: accepted documents first, in request order, then failed ones. Match results by id, or by url for a failed item with no id. """ - failed: float + count: int """ - Count of documents that failed to add + Number of documents accepted """ - success: float + failed: int """ - Count of documents successfully added + Number of documents that failed """ diff --git a/src/supermemory/requests/chunk.py b/src/supermemory/requests/chunk.py index bd961a0..e460abf 100644 --- a/src/supermemory/requests/chunk.py +++ b/src/supermemory/requests/chunk.py @@ -31,9 +31,9 @@ class ChunkParams(typing_extensions.TypedDict): Chunk content type """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] + metadata: typing.Dict[str, typing.Any] """ - Chunk metadata, when available + Chunk metadata; empty object when none """ system: ChunkSystemParams diff --git a/src/supermemory/requests/chunk_list_item.py b/src/supermemory/requests/chunk_list_item.py index 7f324f5..3cf1f88 100644 --- a/src/supermemory/requests/chunk_list_item.py +++ b/src/supermemory/requests/chunk_list_item.py @@ -28,9 +28,9 @@ class ChunkListItemParams(typing_extensions.TypedDict): Chunk content type """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] + metadata: typing.Dict[str, typing.Any] """ - Chunk metadata, when available + Chunk metadata; empty object when none """ system: ChunkSystemParams diff --git a/src/supermemory/requests/connector.py b/src/supermemory/requests/connector.py index d259aa7..8e3da9d 100644 --- a/src/supermemory/requests/connector.py +++ b/src/supermemory/requests/connector.py @@ -75,10 +75,10 @@ class ConnectorParams(typing_extensions.TypedDict): created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] syncs: typing_extensions.NotRequired[typing.Sequence[ConnectorSyncParams]] """ - Present when attach=syncs + Present when include=syncs """ picker: typing_extensions.NotRequired[typing.Optional[ConnectorPickerParams]] """ - Present when attach=picker. Null for connectors that sync everything. + Present when include=picker. Null for connectors that sync everything. """ diff --git a/src/supermemory/requests/delete_documents_result.py b/src/supermemory/requests/delete_documents_result.py index 240f563..ba1c76e 100644 --- a/src/supermemory/requests/delete_documents_result.py +++ b/src/supermemory/requests/delete_documents_result.py @@ -3,12 +3,11 @@ import typing import typing_extensions -from ..core.serialization import FieldMetadata from .delete_document_error import DeleteDocumentErrorParams class DeleteDocumentsResultParams(typing_extensions.TypedDict): - deleted_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedCount")] + count: int """ Number of documents successfully deleted """ diff --git a/src/supermemory/requests/document.py b/src/supermemory/requests/document.py index 31a0875..e71580a 100644 --- a/src/supermemory/requests/document.py +++ b/src/supermemory/requests/document.py @@ -10,7 +10,7 @@ class DocumentParams(typing_extensions.TypedDict): """ - Namespace-scoped document. Attachment keys are omitted unless requested and are empty arrays when requested without results. + Namespace-scoped document. Included keys are omitted unless requested and are empty arrays when requested without results. """ id: str diff --git a/src/supermemory/requests/document_list_item.py b/src/supermemory/requests/document_list_item.py index 5fa297c..769e257 100644 --- a/src/supermemory/requests/document_list_item.py +++ b/src/supermemory/requests/document_list_item.py @@ -3,7 +3,7 @@ import typing import typing_extensions -from .document_system import DocumentSystemParams +from .document_list_item_system import DocumentListItemSystemParams class DocumentListItemParams(typing_extensions.TypedDict): @@ -41,7 +41,7 @@ class DocumentListItemParams(typing_extensions.TypedDict): Original source URL, when the document was ingested from the web """ - system: DocumentSystemParams + system: DocumentListItemSystemParams """ Processing status, lifecycle timestamps, and storage path maintained by Supermemory """ diff --git a/src/supermemory/requests/document_list_item_system.py b/src/supermemory/requests/document_list_item_system.py new file mode 100644 index 0000000..c529e00 --- /dev/null +++ b/src/supermemory/requests/document_list_item_system.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class DocumentListItemSystemParams(typing_extensions.TypedDict): + """ + Processing status, lifecycle timestamps, and storage path maintained by Supermemory + """ + + status: str + """ + Current extraction and memory-processing status + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the document was created + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the latest document update + """ diff --git a/src/supermemory/requests/document_ref.py b/src/supermemory/requests/document_ref.py index a5319b6..326934d 100644 --- a/src/supermemory/requests/document_ref.py +++ b/src/supermemory/requests/document_ref.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +from ..types.document_ref_status import DocumentRefStatus class DocumentRefParams(typing_extensions.TypedDict): id: str """ - Unique identifier of the document + Document identifier to poll or retrieve """ - status: str + status: DocumentRefStatus """ - Status of the document + The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document. """ diff --git a/src/supermemory/requests/document_system.py b/src/supermemory/requests/document_system.py index a36cef3..8926dbb 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_status import DocumentSystemStatus class DocumentSystemParams(typing_extensions.TypedDict): @@ -11,7 +12,7 @@ class DocumentSystemParams(typing_extensions.TypedDict): Processing status, lifecycle timestamps, and storage path maintained by Supermemory """ - status: str + status: DocumentSystemStatus """ Current extraction and memory-processing status """ diff --git a/src/supermemory/requests/file_upload_result.py b/src/supermemory/requests/file_upload_result.py deleted file mode 100644 index 4ecbd43..0000000 --- a/src/supermemory/requests/file_upload_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions - - -class FileUploadResultParams(typing_extensions.TypedDict): - id: str - """ - Document identifier to poll or retrieve - """ - - status: typing.Literal["processing"] - """ - Confirms the file was accepted for asynchronous processing - """ diff --git a/src/supermemory/requests/list_request_include.py b/src/supermemory/requests/list_request_include.py new file mode 100644 index 0000000..c990ec3 --- /dev/null +++ b/src/supermemory/requests/list_request_include.py @@ -0,0 +1,14 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + + +class ListRequestIncludeParams(typing_extensions.TypedDict): + """ + Optional extras, matching search's include + """ + + forgotten: typing_extensions.NotRequired[bool] + """ + List forgotten and expired memories too, with isForgotten: true. Applies to type memories only. + """ diff --git a/src/supermemory/requests/list_request_limit.py b/src/supermemory/requests/list_request_limit.py deleted file mode 100644 index 7b70cac..0000000 --- a/src/supermemory/requests/list_request_limit.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ListRequestLimitParams = typing.Union[str, float] diff --git a/src/supermemory/requests/list_request_page.py b/src/supermemory/requests/list_request_page.py deleted file mode 100644 index 84cfacd..0000000 --- a/src/supermemory/requests/list_request_page.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ListRequestPageParams = typing.Union[str, float] diff --git a/src/supermemory/requests/memory.py b/src/supermemory/requests/memory.py index 2b4eddf..87c5a95 100644 --- a/src/supermemory/requests/memory.py +++ b/src/supermemory/requests/memory.py @@ -22,9 +22,9 @@ class MemoryParams(typing_extensions.TypedDict): Learned fact or context extracted from the document """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] + metadata: typing.Dict[str, typing.Any] """ - Memory metadata, including temporal context when available + Memory metadata, including temporal context; empty object when none """ is_static: typing_extensions.Annotated[bool, FieldMetadata(alias="isStatic")] diff --git a/src/supermemory/requests/namespace_deleted.py b/src/supermemory/requests/namespace_deleted.py index b3db5e7..cc1f5b0 100644 --- a/src/supermemory/requests/namespace_deleted.py +++ b/src/supermemory/requests/namespace_deleted.py @@ -10,7 +10,6 @@ class NamespaceDeleted_DeletedParams(typing_extensions.TypedDict): status: typing.Literal["deleted"] - success: typing.Literal[True] namespace: str deleted_documents_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedDocumentsCount")] deleted_memories_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedMemoriesCount")] @@ -18,7 +17,6 @@ class NamespaceDeleted_DeletedParams(typing_extensions.TypedDict): class NamespaceDeleted_QueuedParams(typing_extensions.TypedDict): status: typing.Literal["queued"] - success: typing.Literal[True] operation_id: typing_extensions.Annotated[str, FieldMetadata(alias="operationId")] namespace: str move_to: typing_extensions.Annotated[str, FieldMetadata(alias="moveTo")] diff --git a/src/supermemory/requests/namespace_deleted_deleted.py b/src/supermemory/requests/namespace_deleted_deleted.py index 7437fe6..15ec981 100644 --- a/src/supermemory/requests/namespace_deleted_deleted.py +++ b/src/supermemory/requests/namespace_deleted_deleted.py @@ -1,17 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..core.serialization import FieldMetadata class NamespaceDeletedDeletedParams(typing_extensions.TypedDict): - success: typing.Literal[True] - """ - Confirms the namespace was deleted - """ - namespace: str """ Deleted namespace identifier diff --git a/src/supermemory/requests/namespace_deleted_queued.py b/src/supermemory/requests/namespace_deleted_queued.py index 6f6fc9b..af95569 100644 --- a/src/supermemory/requests/namespace_deleted_queued.py +++ b/src/supermemory/requests/namespace_deleted_queued.py @@ -1,17 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..core.serialization import FieldMetadata class NamespaceDeletedQueuedParams(typing_extensions.TypedDict): - success: typing.Literal[True] - """ - Confirms the namespace move was accepted - """ - operation_id: typing_extensions.Annotated[str, FieldMetadata(alias="operationId")] """ Identifier used to trace the asynchronous move operation diff --git a/src/supermemory/requests/namespace_details.py b/src/supermemory/requests/namespace_details.py index 884ce99..25407b0 100644 --- a/src/supermemory/requests/namespace_details.py +++ b/src/supermemory/requests/namespace_details.py @@ -4,7 +4,7 @@ import typing_extensions from ..core.serialization import FieldMetadata -from .namespace_system import NamespaceSystemParams +from .namespace_details_system import NamespaceDetailsSystemParams class NamespaceDetailsParams(typing_extensions.TypedDict): @@ -18,7 +18,7 @@ class NamespaceDetailsParams(typing_extensions.TypedDict): Background that helps Supermemory interpret documents and form better memories in this namespace """ - system: NamespaceSystemParams + system: NamespaceDetailsSystemParams """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/requests/namespace_system.py b/src/supermemory/requests/namespace_details_system.py similarity index 80% rename from src/supermemory/requests/namespace_system.py rename to src/supermemory/requests/namespace_details_system.py index 4c11109..53ef664 100644 --- a/src/supermemory/requests/namespace_system.py +++ b/src/supermemory/requests/namespace_details_system.py @@ -6,7 +6,7 @@ from ..core.serialization import FieldMetadata -class NamespaceSystemParams(typing_extensions.TypedDict): +class NamespaceDetailsSystemParams(typing_extensions.TypedDict): """ Namespace lifecycle timestamps """ @@ -18,5 +18,5 @@ class NamespaceSystemParams(typing_extensions.TypedDict): updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] """ - ISO 8601 timestamp of the latest namespace update + ISO 8601 timestamp of the latest settings update """ diff --git a/src/supermemory/requests/related_memories.py b/src/supermemory/requests/related_memories.py index b65de04..5614e91 100644 --- a/src/supermemory/requests/related_memories.py +++ b/src/supermemory/requests/related_memories.py @@ -8,7 +8,7 @@ class RelatedMemoriesParams(typing_extensions.TypedDict): """ - Memory relationships attached when requested + Memory relationships included when requested """ parents: typing.Sequence[RelatedMemoryParams] diff --git a/src/supermemory/requests/related_memory.py b/src/supermemory/requests/related_memory.py index 618b647..fbf145b 100644 --- a/src/supermemory/requests/related_memory.py +++ b/src/supermemory/requests/related_memory.py @@ -8,6 +8,11 @@ class RelatedMemoryParams(typing_extensions.TypedDict): + id: str + """ + Related memory ID + """ + relation: MemoryRelation """ How this memory is connected to the matched memory @@ -23,7 +28,7 @@ class RelatedMemoryParams(typing_extensions.TypedDict): Related learned fact or context """ - metadata: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] + metadata: typing.Dict[str, typing.Any] """ Public metadata associated with the related memory """ diff --git a/src/supermemory/requests/search_request_attach.py b/src/supermemory/requests/search_request_include.py similarity index 57% rename from src/supermemory/requests/search_request_attach.py rename to src/supermemory/requests/search_request_include.py index 9f17bef..2d1b5ea 100644 --- a/src/supermemory/requests/search_request_attach.py +++ b/src/supermemory/requests/search_request_include.py @@ -3,22 +3,22 @@ import typing_extensions -class SearchRequestAttachParams(typing_extensions.TypedDict): +class SearchRequestIncludeParams(typing_extensions.TypedDict): """ Optional context to include alongside each matching result """ documents: typing_extensions.NotRequired[bool] """ - Attach the source document for each result when one is available + Include the source document for each result when one is available """ related: typing_extensions.NotRequired[bool] """ - Attach parent, child, and sibling memories that explain how each memory evolved + Include parent, child, and sibling memories that explain how each memory evolved """ forgotten: typing_extensions.NotRequired[bool] """ - Allow forgotten memories to participate in recall + Let forgotten and expired memories appear in results """ diff --git a/src/supermemory/requests/search_result.py b/src/supermemory/requests/search_result.py index 9b0694b..ffb59ae 100644 --- a/src/supermemory/requests/search_result.py +++ b/src/supermemory/requests/search_result.py @@ -24,7 +24,7 @@ class SearchResultParams(typing_extensions.TypedDict): Source passage returned by chunk search (only present for chunk results from hybrid search) """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] + metadata: typing.Dict[str, typing.Any] """ Public metadata attached to the result """ @@ -39,6 +39,11 @@ class SearchResultParams(typing_extensions.TypedDict): Whether the memory is its latest version; false for recalled forgotten memories """ + is_inference: typing_extensions.Annotated[bool, FieldMetadata(alias="isInference")] + """ + Whether the memory was inferred rather than stated directly; false for chunks + """ + system: SearchResultSystemParams """ Lifecycle and filesystem details for the result diff --git a/src/supermemory/requests/search_result_included.py b/src/supermemory/requests/search_result_included.py index 1eac276..01a1b0b 100644 --- a/src/supermemory/requests/search_result_included.py +++ b/src/supermemory/requests/search_result_included.py @@ -12,10 +12,10 @@ class SearchResultIncludedParams(typing_extensions.TypedDict): related: typing_extensions.NotRequired[RelatedMemoriesParams] """ - Memory relationships attached when requested + Memory relationships included when requested """ document: typing_extensions.NotRequired[SearchResultIncludedDocumentParams] """ - Source document attached when requested and available + Source document included when requested and available """ diff --git a/src/supermemory/requests/search_result_included_document.py b/src/supermemory/requests/search_result_included_document.py index efd876d..9c06b7a 100644 --- a/src/supermemory/requests/search_result_included_document.py +++ b/src/supermemory/requests/search_result_included_document.py @@ -3,12 +3,12 @@ import typing import typing_extensions -from ..core.serialization import FieldMetadata +from .search_result_included_document_system import SearchResultIncludedDocumentSystemParams class SearchResultIncludedDocumentParams(typing_extensions.TypedDict): """ - Source document attached when requested and available + Source document included when requested and available """ id: str @@ -16,32 +16,27 @@ class SearchResultIncludedDocumentParams(typing_extensions.TypedDict): Source document identifier """ - title: typing_extensions.NotRequired[typing.Optional[str]] + title: typing.Optional[str] """ Source document title """ - type: typing_extensions.NotRequired[typing.Optional[str]] + type: typing.Optional[str] """ Detected source or content type """ - metadata: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] + metadata: typing.Dict[str, typing.Any] """ Public metadata attached to the source document """ - summary: typing_extensions.NotRequired[typing.Optional[str]] + summary: typing.Optional[str] """ Generated summary of the source document """ - created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + system: SearchResultIncludedDocumentSystemParams """ - ISO 8601 timestamp when the source document was created - """ - - updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] - """ - ISO 8601 timestamp of the source document's latest update + Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/requests/search_result_included_document_system.py b/src/supermemory/requests/search_result_included_document_system.py new file mode 100644 index 0000000..562f168 --- /dev/null +++ b/src/supermemory/requests/search_result_included_document_system.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class SearchResultIncludedDocumentSystemParams(typing_extensions.TypedDict): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] + """ + ISO 8601 timestamp of the source document's latest update + """ diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index 20037e7..1ce6057 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -6,8 +6,11 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .add_request_dreaming import AddRequestDreaming + from .add_request_task_type import AddRequestTaskType from .bad_request_error_body import BadRequestErrorBody from .batch_add_item_result import BatchAddItemResult + from .batch_add_item_result_status import BatchAddItemResultStatus from .batch_add_result import BatchAddResult from .chunk import Chunk from .chunk_list_item import ChunkListItem @@ -52,15 +55,14 @@ from .delete_document_error import DeleteDocumentError from .delete_documents_result import DeleteDocumentsResult from .document import Document - from .document_attachment import DocumentAttachment from .document_input import DocumentInput from .document_list_item import DocumentListItem + from .document_list_item_system import DocumentListItemSystem from .document_ref import DocumentRef + from .document_ref_status import DocumentRefStatus from .document_system import DocumentSystem - from .dreaming_mode import DreamingMode + from .document_system_status import DocumentSystemStatus from .error_response import ErrorResponse - from .file_type import FileType - from .file_upload_result import FileUploadResult from .filter_and import FilterAnd from .filter_array_contains import FilterArrayContains from .filter_array_contains_operator import FilterArrayContainsOperator @@ -82,8 +84,7 @@ from .google_drive_config import GoogleDriveConfig from .google_drive_config_sync_scope import GoogleDriveConfigSyncScope from .granola_config import GranolaConfig - from .list_request_limit import ListRequestLimit - from .list_request_page import ListRequestPage + from .list_request_include import ListRequestInclude from .list_response import ListResponse from .list_sort import ListSort from .list_type import ListType @@ -91,12 +92,11 @@ from .memory_relation import MemoryRelation from .memory_system import MemorySystem from .metadata_value import MetadataValue - from .namespace import Namespace from .namespace_deleted import NamespaceDeleted, NamespaceDeleted_Deleted, NamespaceDeleted_Queued from .namespace_deleted_deleted import NamespaceDeletedDeleted from .namespace_deleted_queued import NamespaceDeletedQueued from .namespace_details import NamespaceDetails - from .namespace_system import NamespaceSystem + from .namespace_details_system import NamespaceDetailsSystem from .organization import Organization from .pagination import Pagination from .profile import Profile @@ -107,23 +107,26 @@ from .related_memory import RelatedMemory from .related_memory_system import RelatedMemorySystem from .s3config import S3Config - from .search_mode import SearchMode - from .search_request_attach import SearchRequestAttach + from .search_request_include import SearchRequestInclude from .search_request_rerank import SearchRequestRerank + from .search_request_search_mode import SearchRequestSearchMode from .search_response import SearchResponse from .search_result import SearchResult from .search_result_included import SearchResultIncluded from .search_result_included_document import SearchResultIncludedDocument + from .search_result_included_document_system import SearchResultIncludedDocumentSystem from .search_result_system import SearchResultSystem from .sort_order import SortOrder - from .task_type import TaskType from .validation_error_response import ValidationErrorResponse from .validation_error_response_error_item import ValidationErrorResponseErrorItem from .validation_error_response_error_item_path_item import ValidationErrorResponseErrorItemPathItem from .web_crawler_config import WebCrawlerConfig _dynamic_imports: typing.Dict[str, str] = { + "AddRequestDreaming": ".add_request_dreaming", + "AddRequestTaskType": ".add_request_task_type", "BadRequestErrorBody": ".bad_request_error_body", "BatchAddItemResult": ".batch_add_item_result", + "BatchAddItemResultStatus": ".batch_add_item_result_status", "BatchAddResult": ".batch_add_result", "Chunk": ".chunk", "ChunkListItem": ".chunk_list_item", @@ -166,15 +169,14 @@ "DeleteDocumentError": ".delete_document_error", "DeleteDocumentsResult": ".delete_documents_result", "Document": ".document", - "DocumentAttachment": ".document_attachment", "DocumentInput": ".document_input", "DocumentListItem": ".document_list_item", + "DocumentListItemSystem": ".document_list_item_system", "DocumentRef": ".document_ref", + "DocumentRefStatus": ".document_ref_status", "DocumentSystem": ".document_system", - "DreamingMode": ".dreaming_mode", + "DocumentSystemStatus": ".document_system_status", "ErrorResponse": ".error_response", - "FileType": ".file_type", - "FileUploadResult": ".file_upload_result", "FilterAnd": ".filter_and", "FilterArrayContains": ".filter_array_contains", "FilterArrayContainsOperator": ".filter_array_contains_operator", @@ -196,8 +198,7 @@ "GoogleDriveConfig": ".google_drive_config", "GoogleDriveConfigSyncScope": ".google_drive_config_sync_scope", "GranolaConfig": ".granola_config", - "ListRequestLimit": ".list_request_limit", - "ListRequestPage": ".list_request_page", + "ListRequestInclude": ".list_request_include", "ListResponse": ".list_response", "ListSort": ".list_sort", "ListType": ".list_type", @@ -205,14 +206,13 @@ "MemoryRelation": ".memory_relation", "MemorySystem": ".memory_system", "MetadataValue": ".metadata_value", - "Namespace": ".namespace", "NamespaceDeleted": ".namespace_deleted", "NamespaceDeletedDeleted": ".namespace_deleted_deleted", "NamespaceDeletedQueued": ".namespace_deleted_queued", "NamespaceDeleted_Deleted": ".namespace_deleted", "NamespaceDeleted_Queued": ".namespace_deleted", "NamespaceDetails": ".namespace_details", - "NamespaceSystem": ".namespace_system", + "NamespaceDetailsSystem": ".namespace_details_system", "Organization": ".organization", "Pagination": ".pagination", "Profile": ".profile", @@ -223,16 +223,16 @@ "RelatedMemory": ".related_memory", "RelatedMemorySystem": ".related_memory_system", "S3Config": ".s3config", - "SearchMode": ".search_mode", - "SearchRequestAttach": ".search_request_attach", + "SearchRequestInclude": ".search_request_include", "SearchRequestRerank": ".search_request_rerank", + "SearchRequestSearchMode": ".search_request_search_mode", "SearchResponse": ".search_response", "SearchResult": ".search_result", "SearchResultIncluded": ".search_result_included", "SearchResultIncludedDocument": ".search_result_included_document", + "SearchResultIncludedDocumentSystem": ".search_result_included_document_system", "SearchResultSystem": ".search_result_system", "SortOrder": ".sort_order", - "TaskType": ".task_type", "ValidationErrorResponse": ".validation_error_response", "ValidationErrorResponseErrorItem": ".validation_error_response_error_item", "ValidationErrorResponseErrorItemPathItem": ".validation_error_response_error_item_path_item", @@ -262,8 +262,11 @@ def __dir__(): __all__ = [ + "AddRequestDreaming", + "AddRequestTaskType", "BadRequestErrorBody", "BatchAddItemResult", + "BatchAddItemResultStatus", "BatchAddResult", "Chunk", "ChunkListItem", @@ -306,15 +309,14 @@ def __dir__(): "DeleteDocumentError", "DeleteDocumentsResult", "Document", - "DocumentAttachment", "DocumentInput", "DocumentListItem", + "DocumentListItemSystem", "DocumentRef", + "DocumentRefStatus", "DocumentSystem", - "DreamingMode", + "DocumentSystemStatus", "ErrorResponse", - "FileType", - "FileUploadResult", "FilterAnd", "FilterArrayContains", "FilterArrayContainsOperator", @@ -336,8 +338,7 @@ def __dir__(): "GoogleDriveConfig", "GoogleDriveConfigSyncScope", "GranolaConfig", - "ListRequestLimit", - "ListRequestPage", + "ListRequestInclude", "ListResponse", "ListSort", "ListType", @@ -345,14 +346,13 @@ def __dir__(): "MemoryRelation", "MemorySystem", "MetadataValue", - "Namespace", "NamespaceDeleted", "NamespaceDeletedDeleted", "NamespaceDeletedQueued", "NamespaceDeleted_Deleted", "NamespaceDeleted_Queued", "NamespaceDetails", - "NamespaceSystem", + "NamespaceDetailsSystem", "Organization", "Pagination", "Profile", @@ -363,16 +363,16 @@ def __dir__(): "RelatedMemory", "RelatedMemorySystem", "S3Config", - "SearchMode", - "SearchRequestAttach", + "SearchRequestInclude", "SearchRequestRerank", + "SearchRequestSearchMode", "SearchResponse", "SearchResult", "SearchResultIncluded", "SearchResultIncludedDocument", + "SearchResultIncludedDocumentSystem", "SearchResultSystem", "SortOrder", - "TaskType", "ValidationErrorResponse", "ValidationErrorResponseErrorItem", "ValidationErrorResponseErrorItemPathItem", diff --git a/src/supermemory/types/add_request_dreaming.py b/src/supermemory/types/add_request_dreaming.py new file mode 100644 index 0000000..e06c64b --- /dev/null +++ b/src/supermemory/types/add_request_dreaming.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AddRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/types/add_request_task_type.py b/src/supermemory/types/add_request_task_type.py new file mode 100644 index 0000000..7ac045a --- /dev/null +++ b/src/supermemory/types/add_request_task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AddRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/types/batch_add_item_result.py b/src/supermemory/types/batch_add_item_result.py index c6ecca4..c22900a 100644 --- a/src/supermemory/types/batch_add_item_result.py +++ b/src/supermemory/types/batch_add_item_result.py @@ -5,32 +5,33 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +from .batch_add_item_result_status import BatchAddItemResultStatus class BatchAddItemResult(UncheckedBaseModel): id: str = pydantic.Field() """ - Unique identifier of the document (empty string for failed items) + Document identifier """ - status: str = pydantic.Field() + status: BatchAddItemResultStatus = pydantic.Field() """ - Status of the document (e.g. 'done', 'queued', 'error') + The document's processing state, as for a single add; error when this item failed """ error: typing.Optional[str] = pydantic.Field(default=None) """ - Error message when status is 'error' + Failure reason """ details: typing.Optional[str] = pydantic.Field(default=None) """ - Additional error details when status is 'error' + Human-readable explanation of the failure """ url: typing.Optional[str] = pydantic.Field(default=None) """ - URL of the failed item, when it had one. Only present on failed items, where it may be the only way to tell which input the error belongs to (the id falls back to 'unknown' when the input had neither an id nor a customId). + URL of the failed item, when it had one """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/batch_add_item_result_status.py b/src/supermemory/types/batch_add_item_result_status.py new file mode 100644 index 0000000..a9d4f82 --- /dev/null +++ b/src/supermemory/types/batch_add_item_result_status.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchAddItemResultStatus = typing.Union[ + typing.Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed", "error"], + typing.Any, +] diff --git a/src/supermemory/types/batch_add_result.py b/src/supermemory/types/batch_add_result.py index d92f753..9ce3142 100644 --- a/src/supermemory/types/batch_add_result.py +++ b/src/supermemory/types/batch_add_result.py @@ -11,17 +11,17 @@ class BatchAddResult(UncheckedBaseModel): results: typing.List[BatchAddItemResult] = pydantic.Field() """ - Array of results for each document in the batch + One result per submitted document: accepted documents first, in request order, then failed ones. Match results by id, or by url for a failed item with no id. """ - failed: float = pydantic.Field() + count: int = pydantic.Field() """ - Count of documents that failed to add + Number of documents accepted """ - success: float = pydantic.Field() + failed: int = pydantic.Field() """ - Count of documents successfully added + Number of documents that failed """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/chunk.py b/src/supermemory/types/chunk.py index 3a8c1f8..b10a87b 100644 --- a/src/supermemory/types/chunk.py +++ b/src/supermemory/types/chunk.py @@ -33,9 +33,9 @@ class Chunk(UncheckedBaseModel): Chunk content type """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ - Chunk metadata, when available + Chunk metadata; empty object when none """ system: ChunkSystem = pydantic.Field() diff --git a/src/supermemory/types/chunk_list_item.py b/src/supermemory/types/chunk_list_item.py index 9ebee84..d90a30e 100644 --- a/src/supermemory/types/chunk_list_item.py +++ b/src/supermemory/types/chunk_list_item.py @@ -31,9 +31,9 @@ class ChunkListItem(UncheckedBaseModel): Chunk content type """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ - Chunk metadata, when available + Chunk metadata; empty object when none """ system: ChunkSystem = pydantic.Field() diff --git a/src/supermemory/types/connector.py b/src/supermemory/types/connector.py index a778f34..b6460c4 100644 --- a/src/supermemory/types/connector.py +++ b/src/supermemory/types/connector.py @@ -103,12 +103,12 @@ class Connector(UncheckedBaseModel): ] syncs: typing.Optional[typing.List[ConnectorSync]] = pydantic.Field(default=None) """ - Present when attach=syncs + Present when include=syncs """ picker: typing.Optional[ConnectorPicker] = pydantic.Field(default=None) """ - Present when attach=picker. Null for connectors that sync everything. + Present when include=picker. Null for connectors that sync everything. """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/delete_documents_result.py b/src/supermemory/types/delete_documents_result.py index e3272ea..69d5ce2 100644 --- a/src/supermemory/types/delete_documents_result.py +++ b/src/supermemory/types/delete_documents_result.py @@ -3,19 +3,13 @@ import typing import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .delete_document_error import DeleteDocumentError class DeleteDocumentsResult(UncheckedBaseModel): - deleted_count: typing_extensions.Annotated[ - int, - FieldMetadata(alias="deletedCount"), - pydantic.Field(alias="deletedCount", description="Number of documents successfully deleted"), - ] + count: int = pydantic.Field() """ Number of documents successfully deleted """ diff --git a/src/supermemory/types/document.py b/src/supermemory/types/document.py index 9cd0872..86d0223 100644 --- a/src/supermemory/types/document.py +++ b/src/supermemory/types/document.py @@ -12,7 +12,7 @@ class Document(UncheckedBaseModel): """ - Namespace-scoped document. Attachment keys are omitted unless requested and are empty arrays when requested without results. + Namespace-scoped document. Included keys are omitted unless requested and are empty arrays when requested without results. """ id: str = pydantic.Field() diff --git a/src/supermemory/types/document_attachment.py b/src/supermemory/types/document_attachment.py deleted file mode 100644 index b691cd9..0000000 --- a/src/supermemory/types/document_attachment.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocumentAttachment = typing.Union[typing.Literal["chunks", "memories"], typing.Any] diff --git a/src/supermemory/types/document_list_item.py b/src/supermemory/types/document_list_item.py index 56346b4..13e3ff7 100644 --- a/src/supermemory/types/document_list_item.py +++ b/src/supermemory/types/document_list_item.py @@ -5,7 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .document_system import DocumentSystem +from .document_list_item_system import DocumentListItemSystem class DocumentListItem(UncheckedBaseModel): @@ -43,7 +43,7 @@ class DocumentListItem(UncheckedBaseModel): Original source URL, when the document was ingested from the web """ - system: DocumentSystem = pydantic.Field() + system: DocumentListItemSystem = pydantic.Field() """ Processing status, lifecycle timestamps, and storage path maintained by Supermemory """ diff --git a/src/supermemory/types/document_list_item_system.py b/src/supermemory/types/document_list_item_system.py new file mode 100644 index 0000000..8604708 --- /dev/null +++ b/src/supermemory/types/document_list_item_system.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class DocumentListItemSystem(UncheckedBaseModel): + """ + Processing status, lifecycle timestamps, and storage path maintained by Supermemory + """ + + status: str = pydantic.Field() + """ + Current extraction and memory-processing status + """ + + created_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the document was created"), + ] + """ + ISO 8601 timestamp when the document was created + """ + + updated_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest document update"), + ] + """ + ISO 8601 timestamp of the latest document update + """ + + 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/types/document_ref.py b/src/supermemory/types/document_ref.py index 6df71cc..b110ab1 100644 --- a/src/supermemory/types/document_ref.py +++ b/src/supermemory/types/document_ref.py @@ -5,17 +5,18 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +from .document_ref_status import DocumentRefStatus class DocumentRef(UncheckedBaseModel): id: str = pydantic.Field() """ - Unique identifier of the document + Document identifier to poll or retrieve """ - status: str = pydantic.Field() + status: DocumentRefStatus = pydantic.Field() """ - Status of the document + The document's processing state after this request. queued when new work was queued; otherwise its current state, e.g. done for an unchanged duplicate or failed for a metadata-only update to a failed document. """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/document_ref_status.py b/src/supermemory/types/document_ref_status.py new file mode 100644 index 0000000..b1468a8 --- /dev/null +++ b/src/supermemory/types/document_ref_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocumentRefStatus = typing.Union[ + typing.Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"], typing.Any +] diff --git a/src/supermemory/types/document_system.py b/src/supermemory/types/document_system.py index 84141d0..db8adff 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_status import DocumentSystemStatus class DocumentSystem(UncheckedBaseModel): @@ -15,7 +16,7 @@ class DocumentSystem(UncheckedBaseModel): Processing status, lifecycle timestamps, and storage path maintained by Supermemory """ - status: str = pydantic.Field() + status: DocumentSystemStatus = pydantic.Field() """ Current extraction and memory-processing status """ diff --git a/src/supermemory/types/document_system_status.py b/src/supermemory/types/document_system_status.py new file mode 100644 index 0000000..af74121 --- /dev/null +++ b/src/supermemory/types/document_system_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocumentSystemStatus = typing.Union[ + typing.Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"], typing.Any +] diff --git a/src/supermemory/types/dreaming_mode.py b/src/supermemory/types/dreaming_mode.py deleted file mode 100644 index c591aba..0000000 --- a/src/supermemory/types/dreaming_mode.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DreamingMode = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/types/file_type.py b/src/supermemory/types/file_type.py deleted file mode 100644 index 4decdf6..0000000 --- a/src/supermemory/types/file_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -FileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/types/file_upload_result.py b/src/supermemory/types/list_request_include.py similarity index 67% rename from src/supermemory/types/file_upload_result.py rename to src/supermemory/types/list_request_include.py index 997e6be..c8e17d6 100644 --- a/src/supermemory/types/file_upload_result.py +++ b/src/supermemory/types/list_request_include.py @@ -7,15 +7,14 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class FileUploadResult(UncheckedBaseModel): - id: str = pydantic.Field() +class ListRequestInclude(UncheckedBaseModel): """ - Document identifier to poll or retrieve + Optional extras, matching search's include """ - status: typing.Literal["processing"] = pydantic.Field(default="processing") + forgotten: typing.Optional[bool] = pydantic.Field(default=None) """ - Confirms the file was accepted for asynchronous processing + List forgotten and expired memories too, with isForgotten: true. Applies to type memories only. """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/list_request_limit.py b/src/supermemory/types/list_request_limit.py deleted file mode 100644 index 5b4838d..0000000 --- a/src/supermemory/types/list_request_limit.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ListRequestLimit = typing.Union[str, float] diff --git a/src/supermemory/types/list_request_page.py b/src/supermemory/types/list_request_page.py deleted file mode 100644 index d06e301..0000000 --- a/src/supermemory/types/list_request_page.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ListRequestPage = typing.Union[str, float] diff --git a/src/supermemory/types/memory.py b/src/supermemory/types/memory.py index acb8284..533530b 100644 --- a/src/supermemory/types/memory.py +++ b/src/supermemory/types/memory.py @@ -25,9 +25,9 @@ class Memory(UncheckedBaseModel): Learned fact or context extracted from the document """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ - Memory metadata, including temporal context when available + Memory metadata, including temporal context; empty object when none """ is_static: typing_extensions.Annotated[ diff --git a/src/supermemory/types/namespace_deleted.py b/src/supermemory/types/namespace_deleted.py index ec94455..2df27e5 100644 --- a/src/supermemory/types/namespace_deleted.py +++ b/src/supermemory/types/namespace_deleted.py @@ -13,7 +13,6 @@ class NamespaceDeleted_Deleted(UncheckedBaseModel): status: typing.Literal["deleted"] = "deleted" - success: typing.Literal[True] = True namespace: str deleted_documents_count: typing_extensions.Annotated[ int, FieldMetadata(alias="deletedDocumentsCount"), pydantic.Field(alias="deletedDocumentsCount") @@ -34,7 +33,6 @@ class Config: class NamespaceDeleted_Queued(UncheckedBaseModel): status: typing.Literal["queued"] = "queued" - success: typing.Literal[True] = True operation_id: typing_extensions.Annotated[ str, FieldMetadata(alias="operationId"), pydantic.Field(alias="operationId") ] diff --git a/src/supermemory/types/namespace_deleted_deleted.py b/src/supermemory/types/namespace_deleted_deleted.py index 05c0983..296b2f2 100644 --- a/src/supermemory/types/namespace_deleted_deleted.py +++ b/src/supermemory/types/namespace_deleted_deleted.py @@ -10,11 +10,6 @@ class NamespaceDeletedDeleted(UncheckedBaseModel): - success: typing.Literal[True] = pydantic.Field(default=True) - """ - Confirms the namespace was deleted - """ - namespace: str = pydantic.Field() """ Deleted namespace identifier diff --git a/src/supermemory/types/namespace_deleted_queued.py b/src/supermemory/types/namespace_deleted_queued.py index acf46ee..d04c51f 100644 --- a/src/supermemory/types/namespace_deleted_queued.py +++ b/src/supermemory/types/namespace_deleted_queued.py @@ -10,11 +10,6 @@ class NamespaceDeletedQueued(UncheckedBaseModel): - success: typing.Literal[True] = pydantic.Field(default=True) - """ - Confirms the namespace move was accepted - """ - operation_id: typing_extensions.Annotated[ str, FieldMetadata(alias="operationId"), diff --git a/src/supermemory/types/namespace_details.py b/src/supermemory/types/namespace_details.py index 070eace..f072dd4 100644 --- a/src/supermemory/types/namespace_details.py +++ b/src/supermemory/types/namespace_details.py @@ -7,7 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .namespace_system import NamespaceSystem +from .namespace_details_system import NamespaceDetailsSystem class NamespaceDetails(UncheckedBaseModel): @@ -28,7 +28,7 @@ class NamespaceDetails(UncheckedBaseModel): Background that helps Supermemory interpret documents and form better memories in this namespace """ - system: NamespaceSystem = pydantic.Field() + system: NamespaceDetailsSystem = pydantic.Field() """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/types/namespace_system.py b/src/supermemory/types/namespace_details_system.py similarity index 88% rename from src/supermemory/types/namespace_system.py rename to src/supermemory/types/namespace_details_system.py index 6c1cf7a..0980099 100644 --- a/src/supermemory/types/namespace_system.py +++ b/src/supermemory/types/namespace_details_system.py @@ -10,7 +10,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class NamespaceSystem(UncheckedBaseModel): +class NamespaceDetailsSystem(UncheckedBaseModel): """ Namespace lifecycle timestamps """ @@ -27,10 +27,10 @@ class NamespaceSystem(UncheckedBaseModel): updated_at: typing_extensions.Annotated[ dt.datetime, FieldMetadata(alias="updatedAt"), - pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest namespace update"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest settings update"), ] """ - ISO 8601 timestamp of the latest namespace update + ISO 8601 timestamp of the latest settings update """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/related_memories.py b/src/supermemory/types/related_memories.py index 7eb33de..aedd780 100644 --- a/src/supermemory/types/related_memories.py +++ b/src/supermemory/types/related_memories.py @@ -10,7 +10,7 @@ class RelatedMemories(UncheckedBaseModel): """ - Memory relationships attached when requested + Memory relationships included when requested """ parents: typing.List[RelatedMemory] = pydantic.Field() diff --git a/src/supermemory/types/related_memory.py b/src/supermemory/types/related_memory.py index a1972e7..f779275 100644 --- a/src/supermemory/types/related_memory.py +++ b/src/supermemory/types/related_memory.py @@ -10,6 +10,11 @@ class RelatedMemory(UncheckedBaseModel): + id: str = pydantic.Field() + """ + Related memory ID + """ + relation: MemoryRelation = pydantic.Field() """ How this memory is connected to the matched memory @@ -25,7 +30,7 @@ class RelatedMemory(UncheckedBaseModel): Related learned fact or context """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ Public metadata associated with the related memory """ diff --git a/src/supermemory/types/search_mode.py b/src/supermemory/types/search_mode.py deleted file mode 100644 index db609ce..0000000 --- a/src/supermemory/types/search_mode.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SearchMode = typing.Union[typing.Literal["hybrid", "memories", "chunks"], typing.Any] diff --git a/src/supermemory/types/search_request_attach.py b/src/supermemory/types/search_request_include.py similarity index 76% rename from src/supermemory/types/search_request_attach.py rename to src/supermemory/types/search_request_include.py index 38b1f74..1d5e454 100644 --- a/src/supermemory/types/search_request_attach.py +++ b/src/supermemory/types/search_request_include.py @@ -7,24 +7,24 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class SearchRequestAttach(UncheckedBaseModel): +class SearchRequestInclude(UncheckedBaseModel): """ Optional context to include alongside each matching result """ documents: typing.Optional[bool] = pydantic.Field(default=None) """ - Attach the source document for each result when one is available + Include the source document for each result when one is available """ related: typing.Optional[bool] = pydantic.Field(default=None) """ - Attach parent, child, and sibling memories that explain how each memory evolved + Include parent, child, and sibling memories that explain how each memory evolved """ forgotten: typing.Optional[bool] = pydantic.Field(default=None) """ - Allow forgotten memories to participate in recall + Let forgotten and expired memories appear in results """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/search_request_search_mode.py b/src/supermemory/types/search_request_search_mode.py new file mode 100644 index 0000000..c0a24b6 --- /dev/null +++ b/src/supermemory/types/search_request_search_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SearchRequestSearchMode = typing.Union[typing.Literal["hybrid", "memories", "chunks"], typing.Any] diff --git a/src/supermemory/types/search_result.py b/src/supermemory/types/search_result.py index e80aac3..afc6cf9 100644 --- a/src/supermemory/types/search_result.py +++ b/src/supermemory/types/search_result.py @@ -27,7 +27,7 @@ class SearchResult(UncheckedBaseModel): Source passage returned by chunk search (only present for chunk results from hybrid search) """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ Public metadata attached to the result """ @@ -49,6 +49,18 @@ class SearchResult(UncheckedBaseModel): Whether the memory is its latest version; false for recalled forgotten memories """ + is_inference: typing_extensions.Annotated[ + bool, + FieldMetadata(alias="isInference"), + pydantic.Field( + alias="isInference", + description="Whether the memory was inferred rather than stated directly; false for chunks", + ), + ] + """ + Whether the memory was inferred rather than stated directly; false for chunks + """ + system: SearchResultSystem = pydantic.Field() """ Lifecycle and filesystem details for the result diff --git a/src/supermemory/types/search_result_included.py b/src/supermemory/types/search_result_included.py index d66268e..8bb38c0 100644 --- a/src/supermemory/types/search_result_included.py +++ b/src/supermemory/types/search_result_included.py @@ -16,12 +16,12 @@ class SearchResultIncluded(UncheckedBaseModel): related: typing.Optional[RelatedMemories] = pydantic.Field(default=None) """ - Memory relationships attached when requested + Memory relationships included when requested """ document: typing.Optional[SearchResultIncludedDocument] = pydantic.Field(default=None) """ - Source document attached when requested and available + Source document included when requested and available """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/search_result_included_document.py b/src/supermemory/types/search_result_included_document.py index 8455413..0e1e9a9 100644 --- a/src/supermemory/types/search_result_included_document.py +++ b/src/supermemory/types/search_result_included_document.py @@ -3,15 +3,14 @@ import typing import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .search_result_included_document_system import SearchResultIncludedDocumentSystem class SearchResultIncludedDocument(UncheckedBaseModel): """ - Source document attached when requested and available + Source document included when requested and available """ id: str = pydantic.Field() @@ -29,7 +28,7 @@ class SearchResultIncludedDocument(UncheckedBaseModel): Detected source or content type """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + metadata: typing.Dict[str, typing.Any] = pydantic.Field() """ Public metadata attached to the source document """ @@ -39,22 +38,9 @@ class SearchResultIncludedDocument(UncheckedBaseModel): Generated summary of the source document """ - created_at: typing_extensions.Annotated[ - str, - FieldMetadata(alias="createdAt"), - pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), - ] + system: SearchResultIncludedDocumentSystem = pydantic.Field() """ - ISO 8601 timestamp when the source document was created - """ - - updated_at: typing_extensions.Annotated[ - str, - FieldMetadata(alias="updatedAt"), - pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), - ] - """ - ISO 8601 timestamp of the source document's latest update + Lifecycle timestamps maintained by Supermemory """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/search_result_included_document_system.py b/src/supermemory/types/search_result_included_document_system.py new file mode 100644 index 0000000..d9051d7 --- /dev/null +++ b/src/supermemory/types/search_result_included_document_system.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class SearchResultIncludedDocumentSystem(UncheckedBaseModel): + """ + Lifecycle timestamps maintained by Supermemory + """ + + created_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the source document was created"), + ] + """ + ISO 8601 timestamp when the source document was created + """ + + updated_at: typing_extensions.Annotated[ + str, + FieldMetadata(alias="updatedAt"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the source document's latest update"), + ] + """ + ISO 8601 timestamp of the source document's latest update + """ + + 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/types/task_type.py b/src/supermemory/types/task_type.py deleted file mode 100644 index 4efaacc..0000000 --- a/src/supermemory/types/task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/tests/test_client.py b/tests/test_client.py index c1279ac..f26051d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -73,8 +73,8 @@ def test_body_uses_api_field_names() -> None: captured: Captured = [] _client(captured).search("user_alex", query="meetings", limit=5, rewrite_query=True) (request,) = captured - assert request.url.params["limit"] == "5" - assert _body(request) == {"query": "meetings", "rewriteQuery": True} + assert "limit" not in request.url.params + assert _body(request) == {"query": "meetings", "limit": 5, "rewriteQuery": True} def test_nested_dict_params_use_api_field_names() -> None: diff --git a/tests/test_compat.py b/tests/test_compat.py index d8cd3f6..b443dd4 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -25,6 +25,8 @@ Handler = Callable[[httpx.Request], httpx.Response] +NS_PAGE = {"namespaces": [], "pagination": {"currentPage": 1, "limit": 10, "totalItems": 0, "totalPages": 0}} + def _ok(captured: list[httpx.Request], body: Any = None) -> Handler: def handle(request: httpx.Request) -> httpx.Response: @@ -135,7 +137,7 @@ def handle(request: httpx.Request) -> httpx.Response: def test_timeout_object_is_forwarded_whole() -> None: captured: list[httpx.Request] = [] - client = _client(_ok(captured, []), timeout=httpx.Timeout(10.0, connect=2.5)) + client = _client(_ok(captured, NS_PAGE), timeout=httpx.Timeout(10.0, connect=2.5)) client.namespaces.list() assert captured[0].extensions["timeout"] == {"connect": 2.5, "read": 10.0, "write": 10.0, "pool": 10.0} @@ -150,13 +152,13 @@ def test_timeout_none_disables_timeouts() -> None: captured: list[httpx.Request] = [] off = {"connect": None, "read": None, "write": None, "pool": None} - _client(_ok(captured, [])).namespaces.list() + _client(_ok(captured, NS_PAGE)).namespaces.list() assert captured[0].extensions["timeout"] == {"connect": 5.0, "read": 60.0, "write": 60.0, "pool": 60.0} - _client(_ok(captured, []), timeout=None).namespaces.list() + _client(_ok(captured, NS_PAGE), timeout=None).namespaces.list() assert captured[1].extensions["timeout"] == off - client = _client(_ok(captured, []), timeout=10.0) + client = _client(_ok(captured, NS_PAGE), timeout=10.0) client.namespaces.list(timeout=None) assert captured[2].extensions["timeout"] == off client.namespaces.list(timeout=NOT_GIVEN) @@ -176,9 +178,9 @@ def handle(request: httpx.Request) -> httpx.Response: calls += 1 if calls == 1: raise httpx.ReadTimeout("slow", request=request) - return httpx.Response(200, json=[]) + return httpx.Response(200, json=NS_PAGE) - assert _client(handle, max_retries=2).namespaces.list() == [] + assert _client(handle, max_retries=2).namespaces.list().namespaces == [] assert calls == 2 From 453078390d8c3f7bd38463ea9de5272c82eb48b6 Mon Sep 17 00:00:00 2001 From: Mahesh Sanikommu Date: Tue, 6 Oct 2026 00:52:28 -0700 Subject: [PATCH 2/3] chore: regenerate with the connector field alignment (mono#3413) Schema names follow the new spec locations: taskType/dreaming/searchMode in bodies, include params, ConnectorSystem, ConnectorRun, NamespaceList, MemoryDetails. authorization and picker share the ConnectorLink shape. --- fern/openapi.json | 860 +++++++++++------- fern/schemas.yaml | 32 +- reference.md | 46 +- src/supermemory/__init__.py | 390 ++++---- src/supermemory/client.py | 40 +- src/supermemory/connectors/__init__.py | 30 - src/supermemory/connectors/client.py | 18 +- src/supermemory/connectors/raw_client.py | 18 +- src/supermemory/connectors/types/__init__.py | 34 - .../get_connectors_request_include_item.py | 5 - src/supermemory/documents/__init__.py | 75 -- src/supermemory/documents/client.py | 134 ++- src/supermemory/documents/raw_client.py | 134 ++- src/supermemory/documents/types/__init__.py | 77 -- .../batch_add_documents_request_dreaming.py | 5 - .../batch_add_documents_request_task_type.py | 5 - .../get_documents_request_include_item.py | 5 - ...ce_with_file_documents_request_dreaming.py | 5 - ...e_with_file_documents_request_file_type.py | 7 - ...e_with_file_documents_request_task_type.py | 5 - .../update_documents_request_dreaming.py | 5 - .../update_documents_request_task_type.py | 5 - .../update_file_documents_request_dreaming.py | 5 - ...update_file_documents_request_file_type.py | 5 - ...update_file_documents_request_task_type.py | 5 - .../upload_file_documents_request_dreaming.py | 5 - ...upload_file_documents_request_file_type.py | 5 - ...upload_file_documents_request_task_type.py | 5 - src/supermemory/memories/__init__.py | 140 --- src/supermemory/memories/client.py | 24 +- src/supermemory/memories/raw_client.py | 32 +- src/supermemory/memories/requests/__init__.py | 108 --- .../get_memories_response_included.py | 21 - .../get_memories_response_included_related.py | 29 - src/supermemory/memories/types/__init__.py | 107 --- .../get_memories_request_include_item.py | 5 - .../get_memories_response_included_related.py | 40 - src/supermemory/namespaces/__init__.py | 53 -- src/supermemory/namespaces/client.py | 10 +- src/supermemory/namespaces/raw_client.py | 18 +- .../namespaces/requests/__init__.py | 44 - .../requests/list_namespaces_response.py | 19 - ...espaces_response_namespaces_item_system.py | 22 - src/supermemory/namespaces/types/__init__.py | 44 - ...espaces_response_namespaces_item_system.py | 43 - src/supermemory/raw_client.py | 44 +- src/supermemory/requests/__init__.py | 96 +- src/supermemory/requests/connector.py | 34 +- ...{connector_picker.py => connector_link.py} | 2 +- ...onnector_last_sync.py => connector_run.py} | 12 +- .../requests/connector_run_system.py | 25 + .../requests/connector_setup_result.py | 14 +- src/supermemory/requests/connector_sync.py | 11 +- .../requests/connector_sync_system.py | 25 + src/supermemory/requests/connector_system.py | 31 + .../memory_details.py} | 10 +- src/supermemory/requests/memory_included.py | 21 + .../memory_included_document.py} | 6 +- .../memory_included_document_system.py} | 4 +- .../requests/memory_included_related.py | 29 + .../memory_included_related_children_item.py} | 16 +- ...ncluded_related_children_item_document.py} | 8 +- ..._related_children_item_document_system.py} | 4 +- ..._included_related_children_item_system.py} | 4 +- .../memory_included_related_parents_item.py} | 16 +- ...included_related_parents_item_document.py} | 8 +- ...d_related_parents_item_document_system.py} | 4 +- ...y_included_related_parents_item_system.py} | 4 +- .../memory_included_related_siblings_item.py} | 16 +- ...ncluded_related_siblings_item_document.py} | 8 +- ..._related_siblings_item_document_system.py} | 4 +- ..._included_related_siblings_item_system.py} | 4 +- .../namespace.py} | 8 +- src/supermemory/requests/namespace_details.py | 4 +- src/supermemory/requests/namespace_list.py | 19 + ..._details_system.py => namespace_system.py} | 4 +- ...h_request_include.py => search_include.py} | 2 +- src/supermemory/types/__init__.py | 126 ++- src/supermemory/types/add_request_dreaming.py | 5 - .../types/add_request_task_type.py | 5 - src/supermemory/types/connector.py | 57 +- src/supermemory/types/connector_include.py | 5 + ...{connector_picker.py => connector_link.py} | 2 +- ...onnector_last_sync.py => connector_run.py} | 16 +- src/supermemory/types/connector_run_status.py | 5 + src/supermemory/types/connector_run_system.py | 45 + .../types/connector_setup_result.py | 24 +- src/supermemory/types/connector_sync.py | 15 +- .../types/connector_sync_status.py | 5 - .../types/connector_sync_system.py | 45 + src/supermemory/types/connector_system.py | 52 ++ src/supermemory/types/document_include.py | 5 + src/supermemory/types/dreaming_mode.py | 5 + src/supermemory/types/file_type.py | 5 + .../memory_details.py} | 14 +- src/supermemory/types/memory_include.py | 5 + .../memory_included.py} | 14 +- .../memory_included_document.py} | 10 +- .../memory_included_document_system.py} | 8 +- .../types/memory_included_related.py | 40 + .../memory_included_related_children_item.py} | 24 +- ...ncluded_related_children_item_document.py} | 12 +- ..._related_children_item_document_system.py} | 8 +- ..._included_related_children_item_system.py} | 8 +- .../memory_included_related_parents_item.py} | 24 +- ...included_related_parents_item_document.py} | 12 +- ...d_related_parents_item_document_system.py} | 8 +- ...y_included_related_parents_item_system.py} | 8 +- .../memory_included_related_siblings_item.py} | 24 +- ...ncluded_related_siblings_item_document.py} | 12 +- ..._related_siblings_item_document_system.py} | 8 +- ..._included_related_siblings_item_system.py} | 8 +- .../namespace.py} | 12 +- src/supermemory/types/namespace_details.py | 4 +- .../namespace_list.py} | 12 +- ..._details_system.py => namespace_system.py} | 6 +- ...h_request_include.py => search_include.py} | 2 +- src/supermemory/types/search_mode.py | 5 + .../types/search_request_search_mode.py | 5 - src/supermemory/types/task_type.py | 5 + 120 files changed, 1734 insertions(+), 2207 deletions(-) delete mode 100644 src/supermemory/connectors/types/__init__.py delete mode 100644 src/supermemory/connectors/types/get_connectors_request_include_item.py delete mode 100644 src/supermemory/documents/types/__init__.py delete mode 100644 src/supermemory/documents/types/batch_add_documents_request_dreaming.py delete mode 100644 src/supermemory/documents/types/batch_add_documents_request_task_type.py delete mode 100644 src/supermemory/documents/types/get_documents_request_include_item.py delete mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py delete mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_file_type.py delete mode 100644 src/supermemory/documents/types/replace_with_file_documents_request_task_type.py delete mode 100644 src/supermemory/documents/types/update_documents_request_dreaming.py delete mode 100644 src/supermemory/documents/types/update_documents_request_task_type.py delete mode 100644 src/supermemory/documents/types/update_file_documents_request_dreaming.py delete mode 100644 src/supermemory/documents/types/update_file_documents_request_file_type.py delete mode 100644 src/supermemory/documents/types/update_file_documents_request_task_type.py delete mode 100644 src/supermemory/documents/types/upload_file_documents_request_dreaming.py delete mode 100644 src/supermemory/documents/types/upload_file_documents_request_file_type.py delete mode 100644 src/supermemory/documents/types/upload_file_documents_request_task_type.py delete mode 100644 src/supermemory/memories/requests/__init__.py delete mode 100644 src/supermemory/memories/requests/get_memories_response_included.py delete mode 100644 src/supermemory/memories/requests/get_memories_response_included_related.py delete mode 100644 src/supermemory/memories/types/__init__.py delete mode 100644 src/supermemory/memories/types/get_memories_request_include_item.py delete mode 100644 src/supermemory/memories/types/get_memories_response_included_related.py delete mode 100644 src/supermemory/namespaces/requests/__init__.py delete mode 100644 src/supermemory/namespaces/requests/list_namespaces_response.py delete mode 100644 src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py delete mode 100644 src/supermemory/namespaces/types/__init__.py delete mode 100644 src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py rename src/supermemory/requests/{connector_picker.py => connector_link.py} (85%) rename src/supermemory/requests/{connector_last_sync.py => connector_run.py} (51%) create mode 100644 src/supermemory/requests/connector_run_system.py create mode 100644 src/supermemory/requests/connector_sync_system.py create mode 100644 src/supermemory/requests/connector_system.py rename src/supermemory/{memories/requests/get_memories_response.py => requests/memory_details.py} (79%) create mode 100644 src/supermemory/requests/memory_included.py rename src/supermemory/{memories/requests/get_memories_response_included_document.py => requests/memory_included_document.py} (73%) rename src/supermemory/{memories/requests/get_memories_response_included_document_system.py => requests/memory_included_document_system.py} (78%) create mode 100644 src/supermemory/requests/memory_included_related.py rename src/supermemory/{memories/requests/get_memories_response_included_related_parents_item.py => requests/memory_included_related_children_item.py} (55%) rename src/supermemory/{memories/requests/get_memories_response_included_related_parents_item_document.py => requests/memory_included_related_children_item_document.py} (67%) rename src/supermemory/{memories/requests/get_memories_response_included_related_parents_item_document_system.py => requests/memory_included_related_children_item_document_system.py} (76%) rename src/supermemory/{memories/requests/get_memories_response_included_related_parents_item_system.py => requests/memory_included_related_children_item_system.py} (68%) rename src/supermemory/{memories/requests/get_memories_response_included_related_siblings_item.py => requests/memory_included_related_parents_item.py} (54%) rename src/supermemory/{memories/requests/get_memories_response_included_related_children_item_document.py => requests/memory_included_related_parents_item_document.py} (67%) rename src/supermemory/{memories/requests/get_memories_response_included_related_children_item_document_system.py => requests/memory_included_related_parents_item_document_system.py} (76%) rename src/supermemory/{memories/requests/get_memories_response_included_related_siblings_item_system.py => requests/memory_included_related_parents_item_system.py} (68%) rename src/supermemory/{memories/requests/get_memories_response_included_related_children_item.py => requests/memory_included_related_siblings_item.py} (54%) rename src/supermemory/{memories/requests/get_memories_response_included_related_siblings_item_document.py => requests/memory_included_related_siblings_item_document.py} (67%) rename src/supermemory/{memories/requests/get_memories_response_included_related_siblings_item_document_system.py => requests/memory_included_related_siblings_item_document_system.py} (76%) rename src/supermemory/{memories/requests/get_memories_response_included_related_children_item_system.py => requests/memory_included_related_siblings_item_system.py} (68%) rename src/supermemory/{namespaces/requests/list_namespaces_response_namespaces_item.py => requests/namespace.py} (71%) create mode 100644 src/supermemory/requests/namespace_list.py rename src/supermemory/requests/{namespace_details_system.py => namespace_system.py} (80%) rename src/supermemory/requests/{search_request_include.py => search_include.py} (90%) delete mode 100644 src/supermemory/types/add_request_dreaming.py delete mode 100644 src/supermemory/types/add_request_task_type.py create mode 100644 src/supermemory/types/connector_include.py rename src/supermemory/types/{connector_picker.py => connector_link.py} (95%) rename src/supermemory/types/{connector_last_sync.py => connector_run.py} (66%) create mode 100644 src/supermemory/types/connector_run_status.py create mode 100644 src/supermemory/types/connector_run_system.py delete mode 100644 src/supermemory/types/connector_sync_status.py create mode 100644 src/supermemory/types/connector_sync_system.py create mode 100644 src/supermemory/types/connector_system.py create mode 100644 src/supermemory/types/document_include.py create mode 100644 src/supermemory/types/dreaming_mode.py create mode 100644 src/supermemory/types/file_type.py rename src/supermemory/{memories/types/get_memories_response.py => types/memory_details.py} (84%) create mode 100644 src/supermemory/types/memory_include.py rename src/supermemory/{memories/types/get_memories_response_included.py => types/memory_included.py} (51%) rename src/supermemory/{memories/types/get_memories_response_included_document.py => types/memory_included_document.py} (75%) rename src/supermemory/{memories/types/get_memories_response_included_document_system.py => types/memory_included_document_system.py} (82%) create mode 100644 src/supermemory/types/memory_included_related.py rename src/supermemory/{memories/types/get_memories_response_included_related_parents_item.py => types/memory_included_related_children_item.py} (60%) rename src/supermemory/{memories/types/get_memories_response_included_related_parents_item_document.py => types/memory_included_related_children_item_document.py} (71%) rename src/supermemory/{memories/types/get_memories_response_included_related_parents_item_document_system.py => types/memory_included_related_children_item_document_system.py} (81%) rename src/supermemory/{memories/types/get_memories_response_included_related_parents_item_system.py => types/memory_included_related_children_item_system.py} (76%) rename src/supermemory/{memories/types/get_memories_response_included_related_children_item.py => types/memory_included_related_parents_item.py} (60%) rename src/supermemory/{memories/types/get_memories_response_included_related_children_item_document.py => types/memory_included_related_parents_item_document.py} (71%) rename src/supermemory/{memories/types/get_memories_response_included_related_siblings_item_document_system.py => types/memory_included_related_parents_item_document_system.py} (81%) rename src/supermemory/{memories/types/get_memories_response_included_related_siblings_item_system.py => types/memory_included_related_parents_item_system.py} (76%) rename src/supermemory/{memories/types/get_memories_response_included_related_siblings_item.py => types/memory_included_related_siblings_item.py} (60%) rename src/supermemory/{memories/types/get_memories_response_included_related_siblings_item_document.py => types/memory_included_related_siblings_item_document.py} (71%) rename src/supermemory/{memories/types/get_memories_response_included_related_children_item_document_system.py => types/memory_included_related_siblings_item_document_system.py} (81%) rename src/supermemory/{memories/types/get_memories_response_included_related_children_item_system.py => types/memory_included_related_siblings_item_system.py} (76%) rename src/supermemory/{namespaces/types/list_namespaces_response_namespaces_item.py => types/namespace.py} (77%) rename src/supermemory/{namespaces/types/list_namespaces_response.py => types/namespace_list.py} (58%) rename src/supermemory/types/{namespace_details_system.py => namespace_system.py} (88%) rename src/supermemory/types/{search_request_include.py => search_include.py} (95%) create mode 100644 src/supermemory/types/search_mode.py delete mode 100644 src/supermemory/types/search_request_search_mode.py create mode 100644 src/supermemory/types/task_type.py diff --git a/fern/openapi.json b/fern/openapi.json index 56fcb2e..a8d89ff 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -4350,7 +4350,7 @@ "in": "query", "name": "limit", "schema": { - "default": 50, + "default": 10, "type": "integer", "minimum": 1, "maximum": 100 @@ -4388,23 +4388,25 @@ ], "description": "External source" }, - "status": { - "type": "string", - "enum": [ - "pending_authorization", - "active" - ], - "description": "pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed." - }, - "authUrl": { - "description": "Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize", - "type": "string" - }, - "authUrlExpiresAt": { - "description": "Present while pending: when authUrl stops working", - "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))$" + "authorization": { + "description": "Present while pending, when the caller can create connectors in this namespace", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Send the user here to authorize the provider" + }, + "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))$", + "description": "When url stops working" + } + }, + "required": [ + "url", + "expiresAt" + ] }, "namespace": { "anyOf": [ @@ -4518,19 +4520,11 @@ "documentCount": { "type": "number" }, - "lastSync": { + "latestRun": { "anyOf": [ { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -4559,55 +4553,94 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt" + "system" ] }, { "type": "null" } ], - "description": "Most recent sync run" + "description": "The most recent sync run, which may still be running or may have failed" }, - "lastSyncedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending_authorization", + "active" + ], + "description": "pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed." + }, + "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" }, - { - "type": "null" + "lastSuccessfulSyncAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when content last finished syncing successfully" } + }, + "required": [ + "status", + "createdAt", + "lastSuccessfulSyncAt" ], - "description": "When content last finished syncing" - }, - "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))$" + "description": "Lifecycle status and timestamps maintained by Supermemory" }, "syncs": { "description": "Present when include=syncs", @@ -4615,14 +4648,6 @@ "items": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -4651,22 +4676,43 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" }, "id": { "type": "string" @@ -4725,11 +4771,9 @@ } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt", + "system", "id", "trigger", "itemsProcessed", @@ -4768,7 +4812,6 @@ "required": [ "id", "provider", - "status", "namespace", "account", "capabilities", @@ -4776,9 +4819,8 @@ "selection", "documentLimit", "documentCount", - "lastSync", - "lastSyncedAt", - "createdAt" + "latestRun", + "system" ] } }, @@ -5176,7 +5218,7 @@ } } }, - "description": "Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away.", + "description": "Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away.", "responses": { "201": { "content": { @@ -5188,35 +5230,37 @@ "type": "string", "description": "Connector identifier" }, - "authUrl": { + "authorization": { "anyOf": [ { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Send the user here to authorize the provider. Null for providers that authenticate with config only." - }, - "authUrlExpiresAt": { - "anyOf": [ - { - "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))$" + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Send the user here to authorize the provider" + }, + "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))$", + "description": "When url stops working" + } + }, + "required": [ + "url", + "expiresAt" + ] }, { "type": "null" } ], - "description": "When authUrl stops working" + "description": "Null for providers that authenticate with config only" } }, "required": [ "id", - "authUrl", - "authUrlExpiresAt" + "authorization" ] } } @@ -5346,7 +5390,7 @@ "in": "query", "name": "limit", "schema": { - "default": 50, + "default": 10, "type": "integer", "minimum": 1, "maximum": 100 @@ -5384,23 +5428,25 @@ ], "description": "External source" }, - "status": { - "type": "string", - "enum": [ - "pending_authorization", - "active" - ], - "description": "pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed." - }, - "authUrl": { - "description": "Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize", - "type": "string" - }, - "authUrlExpiresAt": { - "description": "Present while pending: when authUrl stops working", - "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))$" + "authorization": { + "description": "Present while pending, when the caller can create connectors in this namespace", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Send the user here to authorize the provider" + }, + "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))$", + "description": "When url stops working" + } + }, + "required": [ + "url", + "expiresAt" + ] }, "namespace": { "anyOf": [ @@ -5514,19 +5560,11 @@ "documentCount": { "type": "number" }, - "lastSync": { + "latestRun": { "anyOf": [ { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -5555,55 +5593,94 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt" + "system" ] }, { "type": "null" } ], - "description": "Most recent sync run" + "description": "The most recent sync run, which may still be running or may have failed" }, - "lastSyncedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending_authorization", + "active" + ], + "description": "pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed." + }, + "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" }, - { - "type": "null" + "lastSuccessfulSyncAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when content last finished syncing successfully" } + }, + "required": [ + "status", + "createdAt", + "lastSuccessfulSyncAt" ], - "description": "When content last finished syncing" - }, - "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))$" + "description": "Lifecycle status and timestamps maintained by Supermemory" }, "syncs": { "description": "Present when include=syncs", @@ -5611,14 +5688,6 @@ "items": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -5647,22 +5716,43 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" }, "id": { "type": "string" @@ -5721,11 +5811,9 @@ } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt", + "system", "id", "trigger", "itemsProcessed", @@ -5764,7 +5852,6 @@ "required": [ "id", "provider", - "status", "namespace", "account", "capabilities", @@ -5772,9 +5859,8 @@ "selection", "documentLimit", "documentCount", - "lastSync", - "lastSyncedAt", - "createdAt" + "latestRun", + "system" ] } }, @@ -5954,23 +6040,25 @@ ], "description": "External source" }, - "status": { - "type": "string", - "enum": [ - "pending_authorization", - "active" - ], - "description": "pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed." - }, - "authUrl": { - "description": "Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize", - "type": "string" - }, - "authUrlExpiresAt": { - "description": "Present while pending: when authUrl stops working", - "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))$" + "authorization": { + "description": "Present while pending, when the caller can create connectors in this namespace", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Send the user here to authorize the provider" + }, + "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))$", + "description": "When url stops working" + } + }, + "required": [ + "url", + "expiresAt" + ] }, "namespace": { "anyOf": [ @@ -6084,19 +6172,11 @@ "documentCount": { "type": "number" }, - "lastSync": { + "latestRun": { "anyOf": [ { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -6125,55 +6205,94 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt" + "system" ] }, { "type": "null" } ], - "description": "Most recent sync run" + "description": "The most recent sync run, which may still be running or may have failed" }, - "lastSyncedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending_authorization", + "active" + ], + "description": "pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed." + }, + "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" }, - { - "type": "null" + "lastSuccessfulSyncAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when content last finished syncing successfully" } + }, + "required": [ + "status", + "createdAt", + "lastSuccessfulSyncAt" ], - "description": "When content last finished syncing" - }, - "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))$" + "description": "Lifecycle status and timestamps maintained by Supermemory" }, "syncs": { "description": "Present when include=syncs", @@ -6181,14 +6300,6 @@ "items": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -6217,22 +6328,43 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" }, "id": { "type": "string" @@ -6291,11 +6423,9 @@ } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt", + "system", "id", "trigger", "itemsProcessed", @@ -6334,7 +6464,6 @@ "required": [ "id", "provider", - "status", "namespace", "account", "capabilities", @@ -6342,9 +6471,8 @@ "selection", "documentLimit", "documentCount", - "lastSync", - "lastSyncedAt", - "createdAt" + "latestRun", + "system" ] } } @@ -6530,23 +6658,25 @@ ], "description": "External source" }, - "status": { - "type": "string", - "enum": [ - "pending_authorization", - "active" - ], - "description": "pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed." - }, - "authUrl": { - "description": "Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize", - "type": "string" - }, - "authUrlExpiresAt": { - "description": "Present while pending: when authUrl stops working", - "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))$" + "authorization": { + "description": "Present while pending, when the caller can create connectors in this namespace", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Send the user here to authorize the provider" + }, + "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))$", + "description": "When url stops working" + } + }, + "required": [ + "url", + "expiresAt" + ] }, "namespace": { "anyOf": [ @@ -6660,19 +6790,11 @@ "documentCount": { "type": "number" }, - "lastSync": { + "latestRun": { "anyOf": [ { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -6701,55 +6823,94 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt" + "system" ] }, { "type": "null" } ], - "description": "Most recent sync run" + "description": "The most recent sync run, which may still be running or may have failed" }, - "lastSyncedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending_authorization", + "active" + ], + "description": "pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed." + }, + "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" }, - { - "type": "null" + "lastSuccessfulSyncAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when content last finished syncing successfully" } + }, + "required": [ + "status", + "createdAt", + "lastSuccessfulSyncAt" ], - "description": "When content last finished syncing" - }, - "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))$" + "description": "Lifecycle status and timestamps maintained by Supermemory" }, "syncs": { "description": "Present when include=syncs", @@ -6757,14 +6918,6 @@ "items": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "running", - "completed", - "failed" - ] - }, "errorCode": { "anyOf": [ { @@ -6793,22 +6946,43 @@ ], "description": "Customer-safe error message" }, - "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))$" - }, - "completedAt": { - "anyOf": [ - { + "system": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running", + "completed", + "failed" + ] + }, + "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" }, - { - "type": "null" + "completedAt": { + "anyOf": [ + { + "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))$" + }, + { + "type": "null" + } + ], + "description": "ISO 8601 timestamp when the run ended; null while running" } - ] + }, + "required": [ + "status", + "startedAt", + "completedAt" + ], + "description": "Run status and timestamps maintained by Supermemory" }, "id": { "type": "string" @@ -6867,11 +7041,9 @@ } }, "required": [ - "status", "errorCode", "error", - "startedAt", - "completedAt", + "system", "id", "trigger", "itemsProcessed", @@ -6910,7 +7082,6 @@ "required": [ "id", "provider", - "status", "namespace", "account", "capabilities", @@ -6918,9 +7089,8 @@ "selection", "documentLimit", "documentCount", - "lastSync", - "lastSyncedAt", - "createdAt" + "latestRun", + "system" ] } } diff --git a/fern/schemas.yaml b/fern/schemas.yaml index 4534be6..20f993e 100644 --- a/fern/schemas.yaml +++ b/fern/schemas.yaml @@ -15,18 +15,15 @@ # bodies stay inline because their fields become keyword arguments. # --- enums -TaskType: POST /ns/{namespace}/document param:taskType -DreamingMode: POST /ns/{namespace}/document param:dreaming -FileType: POST /ns/{namespace}/document/file param:fileType -SearchMode: POST /ns/{namespace}/search param:searchMode +TaskType: POST /ns/{namespace}/document body.taskType +DreamingMode: POST /ns/{namespace}/document body.dreaming +FileType: POST /ns/{namespace}/document/file body.fileType +SearchMode: POST /ns/{namespace}/search body.searchMode ListType: POST /ns/{namespace}/list/{type} param:type ListSort: POST /ns/{namespace}/list/{type} param:sort SortOrder: POST /ns/{namespace}/list/{type} param:order MemoryRelation: POST /ns/{namespace}/search 200.results[].included.related.parents[].relation ConnectorProvider: GET /connectors param:provider -ConnectorStatus: GET /ns/{namespace}/connectors/{id} 200.status -ConnectorSyncStatus: GET /ns/{namespace}/connectors/{id} 200.lastSync?.status -ConnectorErrorCode: GET /ns/{namespace}/connectors/{id} 200.lastSync?.errorCode? ConnectorSyncTrigger: GET /ns/{namespace}/connectors/{id} 200.syncs[].trigger # --- filters @@ -46,13 +43,17 @@ BatchAddResult: POST /ns/{namespace}/document/batch 200 BatchAddItemResult: POST /ns/{namespace}/document/batch 200.results[] DeleteDocumentsResult: DELETE /ns/{namespace}/document 200 DeleteDocumentError: DELETE /ns/{namespace}/document 200.errors[] -DocumentAttachment: GET /ns/{namespace}/document/{id} param:attach[] -FileUploadResult: POST /ns/{namespace}/document/file 200 +DocumentInclude: GET /ns/{namespace}/document/{id} param:include[] +SearchInclude: POST /ns/{namespace}/search body.include +MemoryInclude: GET /ns/{namespace}/memories/{id} param:include[] +ConnectorInclude: GET /ns/{namespace}/connectors/{id} param:include[] Document: GET /ns/{namespace}/document/{id} 200 DocumentSystem: GET /ns/{namespace}/document/{id} 200.system Chunk: GET /ns/{namespace}/document/{id} 200.chunks[] ChunkSystem: GET /ns/{namespace}/document/{id} 200.chunks[].system Memory: GET /ns/{namespace}/document/{id} 200.memories[] +MemoryIncluded: GET /ns/{namespace}/memories/{id} 200.included +MemoryDetails: GET /ns/{namespace}/memories/{id} 200 MemorySystem: GET /ns/{namespace}/document/{id} 200.memories[].system # --- list @@ -77,12 +78,16 @@ ForgetError: DELETE /ns/{namespace}/memories 200.errors[] ForgetMatch: DELETE /ns/{namespace}/memories 200.matches[] # --- connectors +ConnectorStatus: GET /ns/{namespace}/connectors/{id} 200.system.status +ConnectorRunStatus: GET /ns/{namespace}/connectors/{id} 200.latestRun?.system.status +ConnectorErrorCode: GET /ns/{namespace}/connectors/{id} 200.latestRun?.errorCode? +ConnectorRun: GET /ns/{namespace}/connectors/{id} 200.latestRun? +ConnectorSystem: GET /ns/{namespace}/connectors/{id} 200.system Connector: GET /ns/{namespace}/connectors/{id} 200 ConnectorList: GET /connectors 200 ConnectorCapabilities: GET /ns/{namespace}/connectors/{id} 200.capabilities -ConnectorPicker: GET /ns/{namespace}/connectors/{id} 200.picker? +ConnectorLink: GET /ns/{namespace}/connectors/{id} 200.picker? # same {url, expiresAt} shape as authorization ConnectorSelectionItem: GET /ns/{namespace}/connectors/{id} 200.selection?{}[] -ConnectorLastSync: GET /ns/{namespace}/connectors/{id} 200.lastSync? ConnectorSync: GET /ns/{namespace}/connectors/{id} 200.syncs[] ConnectorSyncFailure: GET /ns/{namespace}/connectors/{id} 200.syncs[].failures[] ConnectorSelection: PATCH /ns/{namespace}/connectors/{id} body.selection @@ -96,8 +101,9 @@ ConnectorSyncStarted: POST /ns/{namespace}/connectors/{id}/sync 202 ConnectorDeleted: DELETE /ns/{namespace}/connectors/{id} 200 # --- namespaces and organization -Namespace: GET /ns 200[] -NamespaceSystem: GET /ns 200[].system +NamespaceList: GET /ns 200 +Namespace: GET /ns 200.namespaces[] +NamespaceSystem: GET /ns 200.namespaces[].system NamespaceDetails: GET /ns/{namespace} 200 NamespaceDeleted: DELETE /ns/{namespace} 200 Organization: GET /organization 200 diff --git a/reference.md b/reference.md index 2c13811..adcaa31 100644 --- a/reference.md +++ b/reference.md @@ -109,7 +109,7 @@ client.add(
-**task_type:** `typing.Optional[AddRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -117,7 +117,7 @@ client.add(
-**dreaming:** `typing.Optional[AddRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -215,7 +215,7 @@ client.search(
-**search_mode:** `typing.Optional[SearchRequestSearchMode]` — Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. +**search_mode:** `typing.Optional[SearchMode]` — Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages.
@@ -231,7 +231,7 @@ client.search(
-**include:** `typing.Optional[SearchRequestInclude]` — Optional context to include alongside each matching result +**include:** `typing.Optional[SearchInclude]` — Optional context to include alongside each matching result
@@ -655,7 +655,7 @@ client.documents.batch_add(
-**task_type:** `typing.Optional[BatchAddDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -663,7 +663,7 @@ client.documents.batch_add(
-**dreaming:** `typing.Optional[BatchAddDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -753,7 +753,7 @@ client.documents.get(
-**include:** `typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]]` — Comma-separated child resources to include: chunks, memories, or both. +**include:** `typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]]` — Comma-separated child resources to include: chunks, memories, or both.
@@ -883,7 +883,7 @@ client.documents.update(
-**task_type:** `typing.Optional[UpdateDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -891,7 +891,7 @@ client.documents.update(
-**dreaming:** `typing.Optional[UpdateDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1013,7 +1013,7 @@ client.documents.upload_file(
-**task_type:** `typing.Optional[UploadFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1021,7 +1021,7 @@ client.documents.upload_file(
-**dreaming:** `typing.Optional[UploadFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1029,7 +1029,7 @@ client.documents.upload_file(
-**file_type:** `typing.Optional[UploadFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient +**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient
@@ -1168,7 +1168,7 @@ client.documents.replace_with_file(
-**task_type:** `typing.Optional[ReplaceWithFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1176,7 +1176,7 @@ client.documents.replace_with_file(
-**dreaming:** `typing.Optional[ReplaceWithFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1184,7 +1184,7 @@ client.documents.replace_with_file(
-**file_type:** `typing.Optional[ReplaceWithFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient +**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient
@@ -1323,7 +1323,7 @@ client.documents.update_file(
-**task_type:** `typing.Optional[UpdateFileDocumentsRequestTaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. +**task_type:** `typing.Optional[TaskType]` — Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories.
@@ -1331,7 +1331,7 @@ client.documents.update_file(
-**dreaming:** `typing.Optional[UpdateFileDocumentsRequestDreaming]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. +**dreaming:** `typing.Optional[DreamingMode]` — Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document.
@@ -1339,7 +1339,7 @@ client.documents.update_file(
-**file_type:** `typing.Optional[UpdateFileDocumentsRequestFileType]` — Explicit source type used when automatic inference is insufficient +**file_type:** `typing.Optional[FileType]` — Explicit source type used when automatic inference is insufficient
@@ -1785,7 +1785,7 @@ client.memories.forget_matching(
-
client.memories.get(...) -> GetMemoriesResponse +
client.memories.get(...) -> MemoryDetails
@@ -1855,7 +1855,7 @@ client.memories.get(
-**include:** `typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]]` — 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. +**include:** `typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]]` — 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.
@@ -2080,7 +2080,7 @@ client.connectors.list(
-Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away. +Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away.
@@ -2222,7 +2222,7 @@ client.connectors.get(
-**include:** `typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]]` — Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. +**include:** `typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]]` — Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL.
@@ -2521,7 +2521,7 @@ client.connectors.sync(
## Namespaces -
client.namespaces.list(...) -> ListNamespacesResponse +
client.namespaces.list(...) -> NamespaceList
diff --git a/src/supermemory/__init__.py b/src/supermemory/__init__.py index 4b52757..77a5cff 100644 --- a/src/supermemory/__init__.py +++ b/src/supermemory/__init__.py @@ -7,8 +7,6 @@ if typing.TYPE_CHECKING: from .types import ( - AddRequestDreaming, - AddRequestTaskType, BadRequestErrorBody, BatchAddItemResult, BatchAddItemResultStatus, @@ -21,10 +19,13 @@ ConnectorConfigValue, ConnectorDeleted, ConnectorErrorCode, - ConnectorLastSync, + ConnectorInclude, + ConnectorLink, ConnectorList, - ConnectorPicker, ConnectorProvider, + ConnectorRun, + ConnectorRunStatus, + ConnectorRunSystem, ConnectorSelection, ConnectorSelectionItem, ConnectorSetup, @@ -49,11 +50,13 @@ ConnectorSync, ConnectorSyncFailure, ConnectorSyncStarted, - ConnectorSyncStatus, + ConnectorSyncSystem, ConnectorSyncTrigger, + ConnectorSystem, DeleteDocumentError, DeleteDocumentsResult, Document, + DocumentInclude, DocumentInput, DocumentListItem, DocumentListItemSystem, @@ -61,7 +64,9 @@ DocumentRefStatus, DocumentSystem, DocumentSystemStatus, + DreamingMode, ErrorResponse, + FileType, FilterAnd, FilterArrayContains, FilterArrayContainsOperator, @@ -88,16 +93,36 @@ ListSort, ListType, Memory, + MemoryDetails, + MemoryInclude, + MemoryIncluded, + MemoryIncludedDocument, + MemoryIncludedDocumentSystem, + MemoryIncludedRelated, + MemoryIncludedRelatedChildrenItem, + MemoryIncludedRelatedChildrenItemDocument, + MemoryIncludedRelatedChildrenItemDocumentSystem, + MemoryIncludedRelatedChildrenItemSystem, + MemoryIncludedRelatedParentsItem, + MemoryIncludedRelatedParentsItemDocument, + MemoryIncludedRelatedParentsItemDocumentSystem, + MemoryIncludedRelatedParentsItemSystem, + MemoryIncludedRelatedSiblingsItem, + MemoryIncludedRelatedSiblingsItemDocument, + MemoryIncludedRelatedSiblingsItemDocumentSystem, + MemoryIncludedRelatedSiblingsItemSystem, MemoryRelation, MemorySystem, MetadataValue, + Namespace, NamespaceDeleted, NamespaceDeletedDeleted, NamespaceDeletedQueued, NamespaceDeleted_Deleted, NamespaceDeleted_Queued, NamespaceDetails, - NamespaceDetailsSystem, + NamespaceList, + NamespaceSystem, Organization, Pagination, Profile, @@ -108,9 +133,9 @@ RelatedMemory, RelatedMemorySystem, S3Config, - SearchRequestInclude, + SearchInclude, + SearchMode, SearchRequestRerank, - SearchRequestSearchMode, SearchResponse, SearchResult, SearchResultIncluded, @@ -118,6 +143,7 @@ SearchResultIncludedDocumentSystem, SearchResultSystem, SortOrder, + TaskType, ValidationErrorResponse, ValidationErrorResponseErrorItem, ValidationErrorResponseErrorItemPathItem, @@ -131,69 +157,7 @@ ) from . import connectors, documents, memories, namespaces, organization, profiles from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient - from .connectors import GetConnectorsRequestIncludeItem - from .documents import ( - BatchAddDocumentsRequestDreaming, - BatchAddDocumentsRequestTaskType, - GetDocumentsRequestIncludeItem, - ReplaceWithFileDocumentsRequestDreaming, - ReplaceWithFileDocumentsRequestFileType, - ReplaceWithFileDocumentsRequestTaskType, - UpdateDocumentsRequestDreaming, - UpdateDocumentsRequestTaskType, - UpdateFileDocumentsRequestDreaming, - UpdateFileDocumentsRequestFileType, - UpdateFileDocumentsRequestTaskType, - UploadFileDocumentsRequestDreaming, - UploadFileDocumentsRequestFileType, - UploadFileDocumentsRequestTaskType, - ) from .environment import SupermemoryEnvironment - from .memories import ( - GetMemoriesRequestIncludeItem, - GetMemoriesResponse, - GetMemoriesResponseIncluded, - GetMemoriesResponseIncludedDocument, - GetMemoriesResponseIncludedDocumentParams, - GetMemoriesResponseIncludedDocumentSystem, - GetMemoriesResponseIncludedDocumentSystemParams, - GetMemoriesResponseIncludedParams, - GetMemoriesResponseIncludedRelated, - GetMemoriesResponseIncludedRelatedChildrenItem, - GetMemoriesResponseIncludedRelatedChildrenItemDocument, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedChildrenItemParams, - GetMemoriesResponseIncludedRelatedChildrenItemSystem, - GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, - GetMemoriesResponseIncludedRelatedParams, - GetMemoriesResponseIncludedRelatedParentsItem, - GetMemoriesResponseIncludedRelatedParentsItemDocument, - GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedParentsItemParams, - GetMemoriesResponseIncludedRelatedParentsItemSystem, - GetMemoriesResponseIncludedRelatedParentsItemSystemParams, - GetMemoriesResponseIncludedRelatedSiblingsItem, - GetMemoriesResponseIncludedRelatedSiblingsItemDocument, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedSiblingsItemParams, - GetMemoriesResponseIncludedRelatedSiblingsItemSystem, - GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, - GetMemoriesResponseParams, - ) - from .namespaces import ( - ListNamespacesResponse, - ListNamespacesResponseNamespacesItem, - ListNamespacesResponseNamespacesItemParams, - ListNamespacesResponseNamespacesItemSystem, - ListNamespacesResponseNamespacesItemSystemParams, - ListNamespacesResponseParams, - ) from .requests import ( BadRequestErrorBodyParams, BatchAddItemResultParams, @@ -204,10 +168,11 @@ ConnectorCapabilitiesParams, ConnectorConfigValueParams, ConnectorDeletedParams, - ConnectorLastSyncParams, + ConnectorLinkParams, ConnectorListParams, ConnectorParams, - ConnectorPickerParams, + ConnectorRunParams, + ConnectorRunSystemParams, ConnectorSelectionItemParams, ConnectorSelectionParams, ConnectorSetupGithubParams, @@ -231,6 +196,8 @@ ConnectorSyncFailureParams, ConnectorSyncParams, ConnectorSyncStartedParams, + ConnectorSyncSystemParams, + ConnectorSystemParams, DeleteDocumentErrorParams, DeleteDocumentsResultParams, DocumentInputParams, @@ -257,6 +224,23 @@ GranolaConfigParams, ListRequestIncludeParams, ListResponseParams, + MemoryDetailsParams, + MemoryIncludedDocumentParams, + MemoryIncludedDocumentSystemParams, + MemoryIncludedParams, + MemoryIncludedRelatedChildrenItemDocumentParams, + MemoryIncludedRelatedChildrenItemDocumentSystemParams, + MemoryIncludedRelatedChildrenItemParams, + MemoryIncludedRelatedChildrenItemSystemParams, + MemoryIncludedRelatedParams, + MemoryIncludedRelatedParentsItemDocumentParams, + MemoryIncludedRelatedParentsItemDocumentSystemParams, + MemoryIncludedRelatedParentsItemParams, + MemoryIncludedRelatedParentsItemSystemParams, + MemoryIncludedRelatedSiblingsItemDocumentParams, + MemoryIncludedRelatedSiblingsItemDocumentSystemParams, + MemoryIncludedRelatedSiblingsItemParams, + MemoryIncludedRelatedSiblingsItemSystemParams, MemoryParams, MemorySystemParams, MetadataValueParams, @@ -266,7 +250,9 @@ NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams, NamespaceDetailsParams, - NamespaceDetailsSystemParams, + NamespaceListParams, + NamespaceParams, + NamespaceSystemParams, OrganizationParams, PaginationParams, ProfileBucketsParams, @@ -277,7 +263,7 @@ RelatedMemoryParams, RelatedMemorySystemParams, S3ConfigParams, - SearchRequestIncludeParams, + SearchIncludeParams, SearchResponseParams, SearchResultIncludedDocumentParams, SearchResultIncludedDocumentSystemParams, @@ -290,12 +276,8 @@ WebCrawlerConfigParams, ) _dynamic_imports: typing.Dict[str, str] = { - "AddRequestDreaming": ".types", - "AddRequestTaskType": ".types", "BadRequestErrorBody": ".types", "BadRequestErrorBodyParams": ".requests", - "BatchAddDocumentsRequestDreaming": ".documents", - "BatchAddDocumentsRequestTaskType": ".documents", "BatchAddItemResult": ".types", "BatchAddItemResultParams": ".requests", "BatchAddItemResultStatus": ".types", @@ -315,14 +297,18 @@ "ConnectorDeleted": ".types", "ConnectorDeletedParams": ".requests", "ConnectorErrorCode": ".types", - "ConnectorLastSync": ".types", - "ConnectorLastSyncParams": ".requests", + "ConnectorInclude": ".types", + "ConnectorLink": ".types", + "ConnectorLinkParams": ".requests", "ConnectorList": ".types", "ConnectorListParams": ".requests", "ConnectorParams": ".requests", - "ConnectorPicker": ".types", - "ConnectorPickerParams": ".requests", "ConnectorProvider": ".types", + "ConnectorRun": ".types", + "ConnectorRunParams": ".requests", + "ConnectorRunStatus": ".types", + "ConnectorRunSystem": ".types", + "ConnectorRunSystemParams": ".requests", "ConnectorSelection": ".types", "ConnectorSelectionItem": ".types", "ConnectorSelectionItemParams": ".requests", @@ -370,8 +356,11 @@ "ConnectorSyncParams": ".requests", "ConnectorSyncStarted": ".types", "ConnectorSyncStartedParams": ".requests", - "ConnectorSyncStatus": ".types", + "ConnectorSyncSystem": ".types", + "ConnectorSyncSystemParams": ".requests", "ConnectorSyncTrigger": ".types", + "ConnectorSystem": ".types", + "ConnectorSystemParams": ".requests", "DefaultAioHttpClient": "._default_clients", "DefaultAsyncHttpxClient": "._default_clients", "DeleteDocumentError": ".types", @@ -379,6 +368,7 @@ "DeleteDocumentsResult": ".types", "DeleteDocumentsResultParams": ".requests", "Document": ".types", + "DocumentInclude": ".types", "DocumentInput": ".types", "DocumentInputParams": ".requests", "DocumentListItem": ".types", @@ -392,8 +382,10 @@ "DocumentSystem": ".types", "DocumentSystemParams": ".requests", "DocumentSystemStatus": ".types", + "DreamingMode": ".types", "ErrorResponse": ".types", "ErrorResponseParams": ".requests", + "FileType": ".types", "FilterAnd": ".types", "FilterAndParams": ".requests", "FilterArrayContains": ".types", @@ -426,54 +418,11 @@ "ForgetMatchParams": ".requests", "ForgetResult": ".types", "ForgetResultParams": ".requests", - "GetConnectorsRequestIncludeItem": ".connectors", - "GetDocumentsRequestIncludeItem": ".documents", - "GetMemoriesRequestIncludeItem": ".memories", - "GetMemoriesResponse": ".memories", - "GetMemoriesResponseIncluded": ".memories", - "GetMemoriesResponseIncludedDocument": ".memories", - "GetMemoriesResponseIncludedDocumentParams": ".memories", - "GetMemoriesResponseIncludedDocumentSystem": ".memories", - "GetMemoriesResponseIncludedDocumentSystemParams": ".memories", - "GetMemoriesResponseIncludedParams": ".memories", - "GetMemoriesResponseIncludedRelated": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItem": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".memories", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".memories", - "GetMemoriesResponseIncludedRelatedParams": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItem": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemParams": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".memories", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItem": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".memories", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".memories", - "GetMemoriesResponseParams": ".memories", "GoogleDriveConfig": ".types", "GoogleDriveConfigParams": ".requests", "GoogleDriveConfigSyncScope": ".types", "GranolaConfig": ".types", "GranolaConfigParams": ".requests", - "ListNamespacesResponse": ".namespaces", - "ListNamespacesResponseNamespacesItem": ".namespaces", - "ListNamespacesResponseNamespacesItemParams": ".namespaces", - "ListNamespacesResponseNamespacesItemSystem": ".namespaces", - "ListNamespacesResponseNamespacesItemSystemParams": ".namespaces", - "ListNamespacesResponseParams": ".namespaces", "ListRequestInclude": ".types", "ListRequestIncludeParams": ".requests", "ListResponse": ".types", @@ -481,12 +430,48 @@ "ListSort": ".types", "ListType": ".types", "Memory": ".types", + "MemoryDetails": ".types", + "MemoryDetailsParams": ".requests", + "MemoryInclude": ".types", + "MemoryIncluded": ".types", + "MemoryIncludedDocument": ".types", + "MemoryIncludedDocumentParams": ".requests", + "MemoryIncludedDocumentSystem": ".types", + "MemoryIncludedDocumentSystemParams": ".requests", + "MemoryIncludedParams": ".requests", + "MemoryIncludedRelated": ".types", + "MemoryIncludedRelatedChildrenItem": ".types", + "MemoryIncludedRelatedChildrenItemDocument": ".types", + "MemoryIncludedRelatedChildrenItemDocumentParams": ".requests", + "MemoryIncludedRelatedChildrenItemDocumentSystem": ".types", + "MemoryIncludedRelatedChildrenItemDocumentSystemParams": ".requests", + "MemoryIncludedRelatedChildrenItemParams": ".requests", + "MemoryIncludedRelatedChildrenItemSystem": ".types", + "MemoryIncludedRelatedChildrenItemSystemParams": ".requests", + "MemoryIncludedRelatedParams": ".requests", + "MemoryIncludedRelatedParentsItem": ".types", + "MemoryIncludedRelatedParentsItemDocument": ".types", + "MemoryIncludedRelatedParentsItemDocumentParams": ".requests", + "MemoryIncludedRelatedParentsItemDocumentSystem": ".types", + "MemoryIncludedRelatedParentsItemDocumentSystemParams": ".requests", + "MemoryIncludedRelatedParentsItemParams": ".requests", + "MemoryIncludedRelatedParentsItemSystem": ".types", + "MemoryIncludedRelatedParentsItemSystemParams": ".requests", + "MemoryIncludedRelatedSiblingsItem": ".types", + "MemoryIncludedRelatedSiblingsItemDocument": ".types", + "MemoryIncludedRelatedSiblingsItemDocumentParams": ".requests", + "MemoryIncludedRelatedSiblingsItemDocumentSystem": ".types", + "MemoryIncludedRelatedSiblingsItemDocumentSystemParams": ".requests", + "MemoryIncludedRelatedSiblingsItemParams": ".requests", + "MemoryIncludedRelatedSiblingsItemSystem": ".types", + "MemoryIncludedRelatedSiblingsItemSystemParams": ".requests", "MemoryParams": ".requests", "MemoryRelation": ".types", "MemorySystem": ".types", "MemorySystemParams": ".requests", "MetadataValue": ".types", "MetadataValueParams": ".requests", + "Namespace": ".types", "NamespaceDeleted": ".types", "NamespaceDeletedDeleted": ".types", "NamespaceDeletedDeletedParams": ".requests", @@ -499,8 +484,11 @@ "NamespaceDeleted_QueuedParams": ".requests", "NamespaceDetails": ".types", "NamespaceDetailsParams": ".requests", - "NamespaceDetailsSystem": ".types", - "NamespaceDetailsSystemParams": ".requests", + "NamespaceList": ".types", + "NamespaceListParams": ".requests", + "NamespaceParams": ".requests", + "NamespaceSystem": ".types", + "NamespaceSystemParams": ".requests", "Organization": ".types", "OrganizationParams": ".requests", "Pagination": ".types", @@ -520,15 +508,12 @@ "RelatedMemoryParams": ".requests", "RelatedMemorySystem": ".types", "RelatedMemorySystemParams": ".requests", - "ReplaceWithFileDocumentsRequestDreaming": ".documents", - "ReplaceWithFileDocumentsRequestFileType": ".documents", - "ReplaceWithFileDocumentsRequestTaskType": ".documents", "S3Config": ".types", "S3ConfigParams": ".requests", - "SearchRequestInclude": ".types", - "SearchRequestIncludeParams": ".requests", + "SearchInclude": ".types", + "SearchIncludeParams": ".requests", + "SearchMode": ".types", "SearchRequestRerank": ".types", - "SearchRequestSearchMode": ".types", "SearchResponse": ".types", "SearchResponseParams": ".requests", "SearchResult": ".types", @@ -544,15 +529,8 @@ "ServiceUnavailableError": ".errors", "SortOrder": ".types", "SupermemoryEnvironment": ".environment", + "TaskType": ".types", "UnauthorizedError": ".errors", - "UpdateDocumentsRequestDreaming": ".documents", - "UpdateDocumentsRequestTaskType": ".documents", - "UpdateFileDocumentsRequestDreaming": ".documents", - "UpdateFileDocumentsRequestFileType": ".documents", - "UpdateFileDocumentsRequestTaskType": ".documents", - "UploadFileDocumentsRequestDreaming": ".documents", - "UploadFileDocumentsRequestFileType": ".documents", - "UploadFileDocumentsRequestTaskType": ".documents", "ValidationErrorResponse": ".types", "ValidationErrorResponseErrorItem": ".types", "ValidationErrorResponseErrorItemParams": ".requests", @@ -592,14 +570,10 @@ def __dir__(): __all__ = [ - "AddRequestDreaming", - "AddRequestTaskType", "AsyncSupermemory", "BadRequestError", "BadRequestErrorBody", "BadRequestErrorBodyParams", - "BatchAddDocumentsRequestDreaming", - "BatchAddDocumentsRequestTaskType", "BatchAddItemResult", "BatchAddItemResultParams", "BatchAddItemResultStatus", @@ -620,14 +594,18 @@ def __dir__(): "ConnectorDeleted", "ConnectorDeletedParams", "ConnectorErrorCode", - "ConnectorLastSync", - "ConnectorLastSyncParams", + "ConnectorInclude", + "ConnectorLink", + "ConnectorLinkParams", "ConnectorList", "ConnectorListParams", "ConnectorParams", - "ConnectorPicker", - "ConnectorPickerParams", "ConnectorProvider", + "ConnectorRun", + "ConnectorRunParams", + "ConnectorRunStatus", + "ConnectorRunSystem", + "ConnectorRunSystemParams", "ConnectorSelection", "ConnectorSelectionItem", "ConnectorSelectionItemParams", @@ -675,8 +653,11 @@ def __dir__(): "ConnectorSyncParams", "ConnectorSyncStarted", "ConnectorSyncStartedParams", - "ConnectorSyncStatus", + "ConnectorSyncSystem", + "ConnectorSyncSystemParams", "ConnectorSyncTrigger", + "ConnectorSystem", + "ConnectorSystemParams", "DefaultAioHttpClient", "DefaultAsyncHttpxClient", "DeleteDocumentError", @@ -684,6 +665,7 @@ def __dir__(): "DeleteDocumentsResult", "DeleteDocumentsResultParams", "Document", + "DocumentInclude", "DocumentInput", "DocumentInputParams", "DocumentListItem", @@ -697,8 +679,10 @@ def __dir__(): "DocumentSystem", "DocumentSystemParams", "DocumentSystemStatus", + "DreamingMode", "ErrorResponse", "ErrorResponseParams", + "FileType", "FilterAnd", "FilterAndParams", "FilterArrayContains", @@ -731,55 +715,12 @@ def __dir__(): "ForgetMatchParams", "ForgetResult", "ForgetResultParams", - "GetConnectorsRequestIncludeItem", - "GetDocumentsRequestIncludeItem", - "GetMemoriesRequestIncludeItem", - "GetMemoriesResponse", - "GetMemoriesResponseIncluded", - "GetMemoriesResponseIncludedDocument", - "GetMemoriesResponseIncludedDocumentParams", - "GetMemoriesResponseIncludedDocumentSystem", - "GetMemoriesResponseIncludedDocumentSystemParams", - "GetMemoriesResponseIncludedParams", - "GetMemoriesResponseIncludedRelated", - "GetMemoriesResponseIncludedRelatedChildrenItem", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", - "GetMemoriesResponseIncludedRelatedParams", - "GetMemoriesResponseIncludedRelatedParentsItem", - "GetMemoriesResponseIncludedRelatedParentsItemDocument", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedParentsItemParams", - "GetMemoriesResponseIncludedRelatedParentsItemSystem", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItem", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", - "GetMemoriesResponseParams", "GoogleDriveConfig", "GoogleDriveConfigParams", "GoogleDriveConfigSyncScope", "GranolaConfig", "GranolaConfigParams", "InternalServerError", - "ListNamespacesResponse", - "ListNamespacesResponseNamespacesItem", - "ListNamespacesResponseNamespacesItemParams", - "ListNamespacesResponseNamespacesItemSystem", - "ListNamespacesResponseNamespacesItemSystemParams", - "ListNamespacesResponseParams", "ListRequestInclude", "ListRequestIncludeParams", "ListResponse", @@ -787,12 +728,48 @@ def __dir__(): "ListSort", "ListType", "Memory", + "MemoryDetails", + "MemoryDetailsParams", + "MemoryInclude", + "MemoryIncluded", + "MemoryIncludedDocument", + "MemoryIncludedDocumentParams", + "MemoryIncludedDocumentSystem", + "MemoryIncludedDocumentSystemParams", + "MemoryIncludedParams", + "MemoryIncludedRelated", + "MemoryIncludedRelatedChildrenItem", + "MemoryIncludedRelatedChildrenItemDocument", + "MemoryIncludedRelatedChildrenItemDocumentParams", + "MemoryIncludedRelatedChildrenItemDocumentSystem", + "MemoryIncludedRelatedChildrenItemDocumentSystemParams", + "MemoryIncludedRelatedChildrenItemParams", + "MemoryIncludedRelatedChildrenItemSystem", + "MemoryIncludedRelatedChildrenItemSystemParams", + "MemoryIncludedRelatedParams", + "MemoryIncludedRelatedParentsItem", + "MemoryIncludedRelatedParentsItemDocument", + "MemoryIncludedRelatedParentsItemDocumentParams", + "MemoryIncludedRelatedParentsItemDocumentSystem", + "MemoryIncludedRelatedParentsItemDocumentSystemParams", + "MemoryIncludedRelatedParentsItemParams", + "MemoryIncludedRelatedParentsItemSystem", + "MemoryIncludedRelatedParentsItemSystemParams", + "MemoryIncludedRelatedSiblingsItem", + "MemoryIncludedRelatedSiblingsItemDocument", + "MemoryIncludedRelatedSiblingsItemDocumentParams", + "MemoryIncludedRelatedSiblingsItemDocumentSystem", + "MemoryIncludedRelatedSiblingsItemDocumentSystemParams", + "MemoryIncludedRelatedSiblingsItemParams", + "MemoryIncludedRelatedSiblingsItemSystem", + "MemoryIncludedRelatedSiblingsItemSystemParams", "MemoryParams", "MemoryRelation", "MemorySystem", "MemorySystemParams", "MetadataValue", "MetadataValueParams", + "Namespace", "NamespaceDeleted", "NamespaceDeletedDeleted", "NamespaceDeletedDeletedParams", @@ -805,8 +782,11 @@ def __dir__(): "NamespaceDeleted_QueuedParams", "NamespaceDetails", "NamespaceDetailsParams", - "NamespaceDetailsSystem", - "NamespaceDetailsSystemParams", + "NamespaceList", + "NamespaceListParams", + "NamespaceParams", + "NamespaceSystem", + "NamespaceSystemParams", "NotFoundError", "Organization", "OrganizationParams", @@ -827,15 +807,12 @@ def __dir__(): "RelatedMemoryParams", "RelatedMemorySystem", "RelatedMemorySystemParams", - "ReplaceWithFileDocumentsRequestDreaming", - "ReplaceWithFileDocumentsRequestFileType", - "ReplaceWithFileDocumentsRequestTaskType", "S3Config", "S3ConfigParams", - "SearchRequestInclude", - "SearchRequestIncludeParams", + "SearchInclude", + "SearchIncludeParams", + "SearchMode", "SearchRequestRerank", - "SearchRequestSearchMode", "SearchResponse", "SearchResponseParams", "SearchResult", @@ -852,15 +829,8 @@ def __dir__(): "SortOrder", "Supermemory", "SupermemoryEnvironment", + "TaskType", "UnauthorizedError", - "UpdateDocumentsRequestDreaming", - "UpdateDocumentsRequestTaskType", - "UpdateFileDocumentsRequestDreaming", - "UpdateFileDocumentsRequestFileType", - "UpdateFileDocumentsRequestTaskType", - "UploadFileDocumentsRequestDreaming", - "UploadFileDocumentsRequestFileType", - "UploadFileDocumentsRequestTaskType", "ValidationErrorResponse", "ValidationErrorResponseErrorItem", "ValidationErrorResponseErrorItemParams", diff --git a/src/supermemory/client.py b/src/supermemory/client.py index 2e4c47d..4f1cbac 100644 --- a/src/supermemory/client.py +++ b/src/supermemory/client.py @@ -17,18 +17,18 @@ from .requests.filter_expression import FilterExpressionParams from .requests.list_request_include import ListRequestIncludeParams from .requests.metadata_value import MetadataValueParams -from .requests.search_request_include import SearchRequestIncludeParams -from .types.add_request_dreaming import AddRequestDreaming -from .types.add_request_task_type import AddRequestTaskType +from .requests.search_include import SearchIncludeParams from .types.document_ref import DocumentRef +from .types.dreaming_mode import DreamingMode from .types.list_response import ListResponse from .types.list_sort import ListSort from .types.list_type import ListType from .types.profile_response import ProfileResponse +from .types.search_mode import SearchMode from .types.search_request_rerank import SearchRequestRerank -from .types.search_request_search_mode import SearchRequestSearchMode from .types.search_response import SearchResponse from .types.sort_order import SortOrder +from .types.task_type import TaskType if typing.TYPE_CHECKING: from .connectors.client import AsyncConnectorsClient, ConnectorsClient @@ -158,8 +158,8 @@ def add( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[AddRequestTaskType] = OMIT, - dreaming: typing.Optional[AddRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -192,10 +192,10 @@ def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[AddRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[AddRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -238,9 +238,9 @@ def search( *, query: str, filter: typing.Optional[FilterExpressionParams] = OMIT, - search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + search_mode: typing.Optional[SearchMode] = OMIT, limit: typing.Optional[int] = OMIT, - include: typing.Optional[SearchRequestIncludeParams] = OMIT, + include: typing.Optional[SearchIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -264,13 +264,13 @@ def search( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchRequestSearchMode] + search_mode : typing.Optional[SearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. limit : typing.Optional[int] Maximum number of results to return - include : typing.Optional[SearchRequestIncludeParams] + include : typing.Optional[SearchIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -632,8 +632,8 @@ async def add( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[AddRequestTaskType] = OMIT, - dreaming: typing.Optional[AddRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -666,10 +666,10 @@ async def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[AddRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[AddRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -720,9 +720,9 @@ async def search( *, query: str, filter: typing.Optional[FilterExpressionParams] = OMIT, - search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + search_mode: typing.Optional[SearchMode] = OMIT, limit: typing.Optional[int] = OMIT, - include: typing.Optional[SearchRequestIncludeParams] = OMIT, + include: typing.Optional[SearchIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -746,13 +746,13 @@ async def search( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchRequestSearchMode] + search_mode : typing.Optional[SearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. limit : typing.Optional[int] Maximum number of results to return - include : typing.Optional[SearchRequestIncludeParams] + include : typing.Optional[SearchIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] diff --git a/src/supermemory/connectors/__init__.py b/src/supermemory/connectors/__init__.py index 819ca17..5cde020 100644 --- a/src/supermemory/connectors/__init__.py +++ b/src/supermemory/connectors/__init__.py @@ -2,33 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import GetConnectorsRequestIncludeItem -_dynamic_imports: typing.Dict[str, str] = {"GetConnectorsRequestIncludeItem": ".types"} - - -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__ = ["GetConnectorsRequestIncludeItem"] diff --git a/src/supermemory/connectors/client.py b/src/supermemory/connectors/client.py index e56861b..5741b9f 100644 --- a/src/supermemory/connectors/client.py +++ b/src/supermemory/connectors/client.py @@ -12,12 +12,12 @@ from ..requests.connector_setup import ConnectorSetupParams from ..types.connector import Connector from ..types.connector_deleted import ConnectorDeleted +from ..types.connector_include import ConnectorInclude from ..types.connector_list import ConnectorList from ..types.connector_provider import ConnectorProvider from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from .raw_client import AsyncRawConnectorsClient, RawConnectorsClient -from .types.get_connectors_request_include_item import GetConnectorsRequestIncludeItem # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -152,7 +152,7 @@ def create( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> ConnectorSetupResult: """ - Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away. + Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away. Parameters ---------- @@ -189,9 +189,7 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -210,7 +208,7 @@ def get( id : str Connector identifier returned when the connector was created - include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] + include : typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -538,7 +536,7 @@ async def create( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> ConnectorSetupResult: """ - Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away. + Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away. Parameters ---------- @@ -583,9 +581,7 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -604,7 +600,7 @@ async def get( id : str Connector identifier returned when the connector was created - include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] + include : typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] diff --git a/src/supermemory/connectors/raw_client.py b/src/supermemory/connectors/raw_client.py index a11d63c..cd66a11 100644 --- a/src/supermemory/connectors/raw_client.py +++ b/src/supermemory/connectors/raw_client.py @@ -28,12 +28,12 @@ from ..types.bad_request_error_body import BadRequestErrorBody from ..types.connector import Connector from ..types.connector_deleted import ConnectorDeleted +from ..types.connector_include import ConnectorInclude from ..types.connector_list import ConnectorList from ..types.connector_provider import ConnectorProvider from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from ..types.error_response import ErrorResponse -from .types.get_connectors_request_include_item import GetConnectorsRequestIncludeItem from pydantic import ValidationError # this is used as the default value for optional parameters @@ -274,7 +274,7 @@ def create( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> HttpResponse[ConnectorSetupResult]: """ - Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away. + Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away. Parameters ---------- @@ -393,9 +393,7 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -414,7 +412,7 @@ def get( id : str Connector identifier returned when the connector was created - include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] + include : typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] @@ -1131,7 +1129,7 @@ async def create( timeout: typing.Union[float, httpx.Timeout, None, NotGiven] = NOT_GIVEN, ) -> AsyncHttpResponse[ConnectorSetupResult]: """ - Connect an external source to this namespace. OAuth providers return an authUrl to send the user to; providers that authenticate with config start syncing right away. + Connect an external source to this namespace. OAuth providers return an authorization url to send the user to; providers that authenticate with config start syncing right away. Parameters ---------- @@ -1250,9 +1248,7 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] = None, return_url: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -1271,7 +1267,7 @@ async def get( id : str Connector identifier returned when the connector was created - include : typing.Optional[typing.Union[GetConnectorsRequestIncludeItem, typing.Sequence[GetConnectorsRequestIncludeItem]]] + include : typing.Optional[typing.Union[ConnectorInclude, typing.Sequence[ConnectorInclude]]] Comma-separated extras. syncs: the 10 most recent sync runs with their failed items. picker: a one-time hosted picker URL. return_url : typing.Optional[str] diff --git a/src/supermemory/connectors/types/__init__.py b/src/supermemory/connectors/types/__init__.py deleted file mode 100644 index 763517c..0000000 --- a/src/supermemory/connectors/types/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 .get_connectors_request_include_item import GetConnectorsRequestIncludeItem -_dynamic_imports: typing.Dict[str, str] = {"GetConnectorsRequestIncludeItem": ".get_connectors_request_include_item"} - - -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__ = ["GetConnectorsRequestIncludeItem"] diff --git a/src/supermemory/connectors/types/get_connectors_request_include_item.py b/src/supermemory/connectors/types/get_connectors_request_include_item.py deleted file mode 100644 index 146ee19..0000000 --- a/src/supermemory/connectors/types/get_connectors_request_include_item.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -GetConnectorsRequestIncludeItem = typing.Union[typing.Literal["syncs", "picker"], typing.Any] diff --git a/src/supermemory/documents/__init__.py b/src/supermemory/documents/__init__.py index 483d1c3..5cde020 100644 --- a/src/supermemory/documents/__init__.py +++ b/src/supermemory/documents/__init__.py @@ -2,78 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - BatchAddDocumentsRequestDreaming, - BatchAddDocumentsRequestTaskType, - GetDocumentsRequestIncludeItem, - ReplaceWithFileDocumentsRequestDreaming, - ReplaceWithFileDocumentsRequestFileType, - ReplaceWithFileDocumentsRequestTaskType, - UpdateDocumentsRequestDreaming, - UpdateDocumentsRequestTaskType, - UpdateFileDocumentsRequestDreaming, - UpdateFileDocumentsRequestFileType, - UpdateFileDocumentsRequestTaskType, - UploadFileDocumentsRequestDreaming, - UploadFileDocumentsRequestFileType, - UploadFileDocumentsRequestTaskType, - ) -_dynamic_imports: typing.Dict[str, str] = { - "BatchAddDocumentsRequestDreaming": ".types", - "BatchAddDocumentsRequestTaskType": ".types", - "GetDocumentsRequestIncludeItem": ".types", - "ReplaceWithFileDocumentsRequestDreaming": ".types", - "ReplaceWithFileDocumentsRequestFileType": ".types", - "ReplaceWithFileDocumentsRequestTaskType": ".types", - "UpdateDocumentsRequestDreaming": ".types", - "UpdateDocumentsRequestTaskType": ".types", - "UpdateFileDocumentsRequestDreaming": ".types", - "UpdateFileDocumentsRequestFileType": ".types", - "UpdateFileDocumentsRequestTaskType": ".types", - "UploadFileDocumentsRequestDreaming": ".types", - "UploadFileDocumentsRequestFileType": ".types", - "UploadFileDocumentsRequestTaskType": ".types", -} - - -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__ = [ - "BatchAddDocumentsRequestDreaming", - "BatchAddDocumentsRequestTaskType", - "GetDocumentsRequestIncludeItem", - "ReplaceWithFileDocumentsRequestDreaming", - "ReplaceWithFileDocumentsRequestFileType", - "ReplaceWithFileDocumentsRequestTaskType", - "UpdateDocumentsRequestDreaming", - "UpdateDocumentsRequestTaskType", - "UpdateFileDocumentsRequestDreaming", - "UpdateFileDocumentsRequestFileType", - "UpdateFileDocumentsRequestTaskType", - "UploadFileDocumentsRequestDreaming", - "UploadFileDocumentsRequestFileType", - "UploadFileDocumentsRequestTaskType", -] diff --git a/src/supermemory/documents/client.py b/src/supermemory/documents/client.py index 0757042..5068abe 100644 --- a/src/supermemory/documents/client.py +++ b/src/supermemory/documents/client.py @@ -14,22 +14,12 @@ from ..types.batch_add_result import BatchAddResult from ..types.delete_documents_result import DeleteDocumentsResult from ..types.document import Document +from ..types.document_include import DocumentInclude from ..types.document_ref import DocumentRef +from ..types.dreaming_mode import DreamingMode +from ..types.file_type import FileType +from ..types.task_type import TaskType from .raw_client import AsyncRawDocumentsClient, RawDocumentsClient -from .types.batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming -from .types.batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType -from .types.get_documents_request_include_item import GetDocumentsRequestIncludeItem -from .types.replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming -from .types.replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType -from .types.replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType -from .types.update_documents_request_dreaming import UpdateDocumentsRequestDreaming -from .types.update_documents_request_task_type import UpdateDocumentsRequestTaskType -from .types.update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming -from .types.update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType -from .types.update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType -from .types.upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming -from .types.upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType -from .types.upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -100,8 +90,8 @@ def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -119,10 +109,10 @@ def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[BatchAddDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -159,9 +149,7 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] = None, 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, @@ -179,7 +167,7 @@ def get( id : str The public document ID - include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + include : typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] @@ -215,8 +203,8 @@ def update( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -249,10 +237,10 @@ def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -298,9 +286,9 @@ def upload_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -331,13 +319,13 @@ def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UploadFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -387,9 +375,9 @@ def replace_with_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -423,13 +411,13 @@ def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -481,9 +469,9 @@ def update_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -517,13 +505,13 @@ def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -639,8 +627,8 @@ async def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -658,10 +646,10 @@ async def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[BatchAddDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -706,9 +694,7 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] = None, 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, @@ -726,7 +712,7 @@ async def get( id : str The public document ID - include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + include : typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] @@ -770,8 +756,8 @@ async def update( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -804,10 +790,10 @@ async def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -861,9 +847,9 @@ async def upload_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -894,13 +880,13 @@ async def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UploadFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -958,9 +944,9 @@ async def replace_with_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -994,13 +980,13 @@ async def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -1060,9 +1046,9 @@ async def update_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -1096,13 +1082,13 @@ async def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] diff --git a/src/supermemory/documents/raw_client.py b/src/supermemory/documents/raw_client.py index eca6e77..032047b 100644 --- a/src/supermemory/documents/raw_client.py +++ b/src/supermemory/documents/raw_client.py @@ -29,22 +29,12 @@ from ..types.batch_add_result import BatchAddResult from ..types.delete_documents_result import DeleteDocumentsResult from ..types.document import Document +from ..types.document_include import DocumentInclude from ..types.document_ref import DocumentRef +from ..types.dreaming_mode import DreamingMode from ..types.error_response import ErrorResponse -from .types.batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming -from .types.batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType -from .types.get_documents_request_include_item import GetDocumentsRequestIncludeItem -from .types.replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming -from .types.replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType -from .types.replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType -from .types.update_documents_request_dreaming import UpdateDocumentsRequestDreaming -from .types.update_documents_request_task_type import UpdateDocumentsRequestTaskType -from .types.update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming -from .types.update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType -from .types.update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType -from .types.upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming -from .types.upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType -from .types.upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType +from ..types.file_type import FileType +from ..types.task_type import TaskType from pydantic import ValidationError # this is used as the default value for optional parameters @@ -165,8 +155,8 @@ def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -184,10 +174,10 @@ def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[BatchAddDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -293,9 +283,7 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] = None, 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, @@ -313,7 +301,7 @@ def get( id : str The public document ID - include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + include : typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] @@ -416,8 +404,8 @@ def update( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -450,10 +438,10 @@ def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -591,9 +579,9 @@ def upload_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -624,13 +612,13 @@ def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UploadFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -759,9 +747,9 @@ def replace_with_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -795,13 +783,13 @@ def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -941,9 +929,9 @@ def update_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -977,13 +965,13 @@ def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -1228,8 +1216,8 @@ async def batch_add( namespace: str, *, documents: typing.Sequence[DocumentInputParams], - task_type: typing.Optional[BatchAddDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[BatchAddDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -1247,10 +1235,10 @@ async def batch_add( documents : typing.Sequence[DocumentInputParams] Documents to ingest or append in one request - task_type : typing.Optional[BatchAddDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[BatchAddDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -1356,9 +1344,7 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] = None, 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, @@ -1376,7 +1362,7 @@ async def get( id : str The public document ID - include : typing.Optional[typing.Union[GetDocumentsRequestIncludeItem, typing.Sequence[GetDocumentsRequestIncludeItem]]] + include : typing.Optional[typing.Union[DocumentInclude, typing.Sequence[DocumentInclude]]] Comma-separated child resources to include: chunks, memories, or both. request_options : typing.Optional[RequestOptions] @@ -1479,8 +1465,8 @@ async def update( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateDocumentsRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -1513,10 +1499,10 @@ async def update( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -1654,9 +1640,9 @@ async def upload_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UploadFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UploadFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UploadFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -1687,13 +1673,13 @@ async def upload_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UploadFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UploadFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UploadFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -1822,9 +1808,9 @@ async def replace_with_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[ReplaceWithFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[ReplaceWithFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[ReplaceWithFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -1858,13 +1844,13 @@ async def replace_with_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[ReplaceWithFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[ReplaceWithFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[ReplaceWithFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] @@ -2004,9 +1990,9 @@ async def update_file( metadata: typing.Optional[str] = OMIT, group: typing.Optional[str] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[UpdateFileDocumentsRequestTaskType] = OMIT, - dreaming: typing.Optional[UpdateFileDocumentsRequestDreaming] = OMIT, - file_type: typing.Optional[UpdateFileDocumentsRequestFileType] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = OMIT, + file_type: typing.Optional[FileType] = OMIT, mime_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, @@ -2040,13 +2026,13 @@ async def update_file( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[UpdateFileDocumentsRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[UpdateFileDocumentsRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. - file_type : typing.Optional[UpdateFileDocumentsRequestFileType] + file_type : typing.Optional[FileType] Explicit source type used when automatic inference is insufficient mime_type : typing.Optional[str] diff --git a/src/supermemory/documents/types/__init__.py b/src/supermemory/documents/types/__init__.py deleted file mode 100644 index a896da6..0000000 --- a/src/supermemory/documents/types/__init__.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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 .batch_add_documents_request_dreaming import BatchAddDocumentsRequestDreaming - from .batch_add_documents_request_task_type import BatchAddDocumentsRequestTaskType - from .get_documents_request_include_item import GetDocumentsRequestIncludeItem - from .replace_with_file_documents_request_dreaming import ReplaceWithFileDocumentsRequestDreaming - from .replace_with_file_documents_request_file_type import ReplaceWithFileDocumentsRequestFileType - from .replace_with_file_documents_request_task_type import ReplaceWithFileDocumentsRequestTaskType - from .update_documents_request_dreaming import UpdateDocumentsRequestDreaming - from .update_documents_request_task_type import UpdateDocumentsRequestTaskType - from .update_file_documents_request_dreaming import UpdateFileDocumentsRequestDreaming - from .update_file_documents_request_file_type import UpdateFileDocumentsRequestFileType - from .update_file_documents_request_task_type import UpdateFileDocumentsRequestTaskType - from .upload_file_documents_request_dreaming import UploadFileDocumentsRequestDreaming - from .upload_file_documents_request_file_type import UploadFileDocumentsRequestFileType - from .upload_file_documents_request_task_type import UploadFileDocumentsRequestTaskType -_dynamic_imports: typing.Dict[str, str] = { - "BatchAddDocumentsRequestDreaming": ".batch_add_documents_request_dreaming", - "BatchAddDocumentsRequestTaskType": ".batch_add_documents_request_task_type", - "GetDocumentsRequestIncludeItem": ".get_documents_request_include_item", - "ReplaceWithFileDocumentsRequestDreaming": ".replace_with_file_documents_request_dreaming", - "ReplaceWithFileDocumentsRequestFileType": ".replace_with_file_documents_request_file_type", - "ReplaceWithFileDocumentsRequestTaskType": ".replace_with_file_documents_request_task_type", - "UpdateDocumentsRequestDreaming": ".update_documents_request_dreaming", - "UpdateDocumentsRequestTaskType": ".update_documents_request_task_type", - "UpdateFileDocumentsRequestDreaming": ".update_file_documents_request_dreaming", - "UpdateFileDocumentsRequestFileType": ".update_file_documents_request_file_type", - "UpdateFileDocumentsRequestTaskType": ".update_file_documents_request_task_type", - "UploadFileDocumentsRequestDreaming": ".upload_file_documents_request_dreaming", - "UploadFileDocumentsRequestFileType": ".upload_file_documents_request_file_type", - "UploadFileDocumentsRequestTaskType": ".upload_file_documents_request_task_type", -} - - -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__ = [ - "BatchAddDocumentsRequestDreaming", - "BatchAddDocumentsRequestTaskType", - "GetDocumentsRequestIncludeItem", - "ReplaceWithFileDocumentsRequestDreaming", - "ReplaceWithFileDocumentsRequestFileType", - "ReplaceWithFileDocumentsRequestTaskType", - "UpdateDocumentsRequestDreaming", - "UpdateDocumentsRequestTaskType", - "UpdateFileDocumentsRequestDreaming", - "UpdateFileDocumentsRequestFileType", - "UpdateFileDocumentsRequestTaskType", - "UploadFileDocumentsRequestDreaming", - "UploadFileDocumentsRequestFileType", - "UploadFileDocumentsRequestTaskType", -] diff --git a/src/supermemory/documents/types/batch_add_documents_request_dreaming.py b/src/supermemory/documents/types/batch_add_documents_request_dreaming.py deleted file mode 100644 index b214f15..0000000 --- a/src/supermemory/documents/types/batch_add_documents_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -BatchAddDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/batch_add_documents_request_task_type.py b/src/supermemory/documents/types/batch_add_documents_request_task_type.py deleted file mode 100644 index aeb6144..0000000 --- a/src/supermemory/documents/types/batch_add_documents_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -BatchAddDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/get_documents_request_include_item.py b/src/supermemory/documents/types/get_documents_request_include_item.py deleted file mode 100644 index e9428aa..0000000 --- a/src/supermemory/documents/types/get_documents_request_include_item.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -GetDocumentsRequestIncludeItem = typing.Union[typing.Literal["chunks", "memories"], typing.Any] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py b/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py deleted file mode 100644 index 0fcaf7f..0000000 --- a/src/supermemory/documents/types/replace_with_file_documents_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ReplaceWithFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py b/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py deleted file mode 100644 index 8602ce0..0000000 --- a/src/supermemory/documents/types/replace_with_file_documents_request_file_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ReplaceWithFileDocumentsRequestFileType = typing.Union[ - typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any -] diff --git a/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py b/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py deleted file mode 100644 index 1bfd317..0000000 --- a/src/supermemory/documents/types/replace_with_file_documents_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ReplaceWithFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/update_documents_request_dreaming.py b/src/supermemory/documents/types/update_documents_request_dreaming.py deleted file mode 100644 index 556a40c..0000000 --- a/src/supermemory/documents/types/update_documents_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UpdateDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/update_documents_request_task_type.py b/src/supermemory/documents/types/update_documents_request_task_type.py deleted file mode 100644 index 8d3eb00..0000000 --- a/src/supermemory/documents/types/update_documents_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UpdateDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_dreaming.py b/src/supermemory/documents/types/update_file_documents_request_dreaming.py deleted file mode 100644 index 13eaa57..0000000 --- a/src/supermemory/documents/types/update_file_documents_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UpdateFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_file_type.py b/src/supermemory/documents/types/update_file_documents_request_file_type.py deleted file mode 100644 index 1444c6e..0000000 --- a/src/supermemory/documents/types/update_file_documents_request_file_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UpdateFileDocumentsRequestFileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/documents/types/update_file_documents_request_task_type.py b/src/supermemory/documents/types/update_file_documents_request_task_type.py deleted file mode 100644 index 9614065..0000000 --- a/src/supermemory/documents/types/update_file_documents_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UpdateFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_dreaming.py b/src/supermemory/documents/types/upload_file_documents_request_dreaming.py deleted file mode 100644 index 3312084..0000000 --- a/src/supermemory/documents/types/upload_file_documents_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UploadFileDocumentsRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_file_type.py b/src/supermemory/documents/types/upload_file_documents_request_file_type.py deleted file mode 100644 index 8a13dff..0000000 --- a/src/supermemory/documents/types/upload_file_documents_request_file_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UploadFileDocumentsRequestFileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/documents/types/upload_file_documents_request_task_type.py b/src/supermemory/documents/types/upload_file_documents_request_task_type.py deleted file mode 100644 index 889acaf..0000000 --- a/src/supermemory/documents/types/upload_file_documents_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UploadFileDocumentsRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/memories/__init__.py b/src/supermemory/memories/__init__.py index 331de67..5cde020 100644 --- a/src/supermemory/memories/__init__.py +++ b/src/supermemory/memories/__init__.py @@ -2,143 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - GetMemoriesRequestIncludeItem, - GetMemoriesResponse, - GetMemoriesResponseIncluded, - GetMemoriesResponseIncludedDocument, - GetMemoriesResponseIncludedDocumentSystem, - GetMemoriesResponseIncludedRelated, - GetMemoriesResponseIncludedRelatedChildrenItem, - GetMemoriesResponseIncludedRelatedChildrenItemDocument, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, - GetMemoriesResponseIncludedRelatedChildrenItemSystem, - GetMemoriesResponseIncludedRelatedParentsItem, - GetMemoriesResponseIncludedRelatedParentsItemDocument, - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, - GetMemoriesResponseIncludedRelatedParentsItemSystem, - GetMemoriesResponseIncludedRelatedSiblingsItem, - GetMemoriesResponseIncludedRelatedSiblingsItemDocument, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, - GetMemoriesResponseIncludedRelatedSiblingsItemSystem, - ) - from .requests import ( - GetMemoriesResponseIncludedDocumentParams, - GetMemoriesResponseIncludedDocumentSystemParams, - GetMemoriesResponseIncludedParams, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedChildrenItemParams, - GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, - GetMemoriesResponseIncludedRelatedParams, - GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedParentsItemParams, - GetMemoriesResponseIncludedRelatedParentsItemSystemParams, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, - GetMemoriesResponseIncludedRelatedSiblingsItemParams, - GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, - GetMemoriesResponseParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "GetMemoriesRequestIncludeItem": ".types", - "GetMemoriesResponse": ".types", - "GetMemoriesResponseIncluded": ".types", - "GetMemoriesResponseIncludedDocument": ".types", - "GetMemoriesResponseIncludedDocumentParams": ".requests", - "GetMemoriesResponseIncludedDocumentSystem": ".types", - "GetMemoriesResponseIncludedDocumentSystemParams": ".requests", - "GetMemoriesResponseIncludedParams": ".requests", - "GetMemoriesResponseIncludedRelated": ".types", - "GetMemoriesResponseIncludedRelatedChildrenItem": ".types", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".types", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".requests", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".types", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".requests", - "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".requests", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".types", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".requests", - "GetMemoriesResponseIncludedRelatedParams": ".requests", - "GetMemoriesResponseIncludedRelatedParentsItem": ".types", - "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".types", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".requests", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".types", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".requests", - "GetMemoriesResponseIncludedRelatedParentsItemParams": ".requests", - "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".types", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".requests", - "GetMemoriesResponseIncludedRelatedSiblingsItem": ".types", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".types", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".requests", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".types", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".requests", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".requests", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".types", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".requests", - "GetMemoriesResponseParams": ".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__ = [ - "GetMemoriesRequestIncludeItem", - "GetMemoriesResponse", - "GetMemoriesResponseIncluded", - "GetMemoriesResponseIncludedDocument", - "GetMemoriesResponseIncludedDocumentParams", - "GetMemoriesResponseIncludedDocumentSystem", - "GetMemoriesResponseIncludedDocumentSystemParams", - "GetMemoriesResponseIncludedParams", - "GetMemoriesResponseIncludedRelated", - "GetMemoriesResponseIncludedRelatedChildrenItem", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", - "GetMemoriesResponseIncludedRelatedParams", - "GetMemoriesResponseIncludedRelatedParentsItem", - "GetMemoriesResponseIncludedRelatedParentsItemDocument", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedParentsItemParams", - "GetMemoriesResponseIncludedRelatedParentsItemSystem", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItem", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", - "GetMemoriesResponseParams", -] diff --git a/src/supermemory/memories/client.py b/src/supermemory/memories/client.py index f2b4e0e..c3eb759 100644 --- a/src/supermemory/memories/client.py +++ b/src/supermemory/memories/client.py @@ -9,9 +9,9 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.forget_result import ForgetResult +from ..types.memory_details import MemoryDetails +from ..types.memory_include import MemoryInclude from .raw_client import AsyncRawMemoriesClient, RawMemoriesClient -from .types.get_memories_request_include_item import GetMemoriesRequestIncludeItem -from .types.get_memories_response import GetMemoriesResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -134,16 +134,14 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] = None, related_limit: typing.Optional[int] = None, 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, - ) -> GetMemoriesResponse: + ) -> 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. @@ -155,7 +153,7 @@ def get( id : str Memory identifier - include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + include : typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] 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] @@ -166,7 +164,7 @@ def get( Returns ------- - GetMemoriesResponse + MemoryDetails Memory retrieved Examples @@ -320,16 +318,14 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] = None, related_limit: typing.Optional[int] = None, 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, - ) -> GetMemoriesResponse: + ) -> 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. @@ -341,7 +337,7 @@ async def get( id : str Memory identifier - include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + include : typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] 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] @@ -352,7 +348,7 @@ async def get( Returns ------- - GetMemoriesResponse + MemoryDetails Memory retrieved Examples diff --git a/src/supermemory/memories/raw_client.py b/src/supermemory/memories/raw_client.py index 68e5179..f0c33db 100644 --- a/src/supermemory/memories/raw_client.py +++ b/src/supermemory/memories/raw_client.py @@ -22,8 +22,8 @@ from ..types.bad_request_error_body import BadRequestErrorBody from ..types.error_response import ErrorResponse from ..types.forget_result import ForgetResult -from .types.get_memories_request_include_item import GetMemoriesRequestIncludeItem -from .types.get_memories_response import GetMemoriesResponse +from ..types.memory_details import MemoryDetails +from ..types.memory_include import MemoryInclude from pydantic import ValidationError # this is used as the default value for optional parameters @@ -254,16 +254,14 @@ def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] = None, related_limit: typing.Optional[int] = None, 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[GetMemoriesResponse]: + ) -> 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. @@ -275,7 +273,7 @@ def get( id : str Memory identifier - include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + include : typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] 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] @@ -286,7 +284,7 @@ def get( Returns ------- - HttpResponse[GetMemoriesResponse] + HttpResponse[MemoryDetails] Memory retrieved """ _response = self._client_wrapper.httpx_client.request( @@ -301,9 +299,9 @@ def get( try: if 200 <= _response.status_code < 300: _data = typing.cast( - GetMemoriesResponse, + MemoryDetails, construct_type( - type_=GetMemoriesResponse, # type: ignore + type_=MemoryDetails, # type: ignore object_=_response.json(), ), ) @@ -597,16 +595,14 @@ async def get( namespace: str, id: str, *, - include: typing.Optional[ - typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]] - ] = None, + include: typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] = None, related_limit: typing.Optional[int] = None, 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[GetMemoriesResponse]: + ) -> 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. @@ -618,7 +614,7 @@ async def get( id : str Memory identifier - include : typing.Optional[typing.Union[GetMemoriesRequestIncludeItem, typing.Sequence[GetMemoriesRequestIncludeItem]]] + include : typing.Optional[typing.Union[MemoryInclude, typing.Sequence[MemoryInclude]]] 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] @@ -629,7 +625,7 @@ async def get( Returns ------- - AsyncHttpResponse[GetMemoriesResponse] + AsyncHttpResponse[MemoryDetails] Memory retrieved """ _response = await self._client_wrapper.httpx_client.request( @@ -644,9 +640,9 @@ async def get( try: if 200 <= _response.status_code < 300: _data = typing.cast( - GetMemoriesResponse, + MemoryDetails, construct_type( - type_=GetMemoriesResponse, # type: ignore + type_=MemoryDetails, # type: ignore object_=_response.json(), ), ) diff --git a/src/supermemory/memories/requests/__init__.py b/src/supermemory/memories/requests/__init__.py deleted file mode 100644 index da467a7..0000000 --- a/src/supermemory/memories/requests/__init__.py +++ /dev/null @@ -1,108 +0,0 @@ -# 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 .get_memories_response import GetMemoriesResponseParams - from .get_memories_response_included import GetMemoriesResponseIncludedParams - from .get_memories_response_included_document import GetMemoriesResponseIncludedDocumentParams - from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystemParams - from .get_memories_response_included_related import GetMemoriesResponseIncludedRelatedParams - from .get_memories_response_included_related_children_item import ( - GetMemoriesResponseIncludedRelatedChildrenItemParams, - ) - from .get_memories_response_included_related_children_item_document import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, - ) - from .get_memories_response_included_related_children_item_document_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, - ) - from .get_memories_response_included_related_children_item_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, - ) - from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItemParams - from .get_memories_response_included_related_parents_item_document import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, - ) - from .get_memories_response_included_related_parents_item_document_system import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, - ) - from .get_memories_response_included_related_parents_item_system import ( - GetMemoriesResponseIncludedRelatedParentsItemSystemParams, - ) - from .get_memories_response_included_related_siblings_item import ( - GetMemoriesResponseIncludedRelatedSiblingsItemParams, - ) - from .get_memories_response_included_related_siblings_item_document import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, - ) - from .get_memories_response_included_related_siblings_item_document_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, - ) - from .get_memories_response_included_related_siblings_item_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "GetMemoriesResponseIncludedDocumentParams": ".get_memories_response_included_document", - "GetMemoriesResponseIncludedDocumentSystemParams": ".get_memories_response_included_document_system", - "GetMemoriesResponseIncludedParams": ".get_memories_response_included", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams": ".get_memories_response_included_related_children_item_document", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams": ".get_memories_response_included_related_children_item_document_system", - "GetMemoriesResponseIncludedRelatedChildrenItemParams": ".get_memories_response_included_related_children_item", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams": ".get_memories_response_included_related_children_item_system", - "GetMemoriesResponseIncludedRelatedParams": ".get_memories_response_included_related", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams": ".get_memories_response_included_related_parents_item_document", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams": ".get_memories_response_included_related_parents_item_document_system", - "GetMemoriesResponseIncludedRelatedParentsItemParams": ".get_memories_response_included_related_parents_item", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams": ".get_memories_response_included_related_parents_item_system", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams": ".get_memories_response_included_related_siblings_item_document", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams": ".get_memories_response_included_related_siblings_item_document_system", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams": ".get_memories_response_included_related_siblings_item", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams": ".get_memories_response_included_related_siblings_item_system", - "GetMemoriesResponseParams": ".get_memories_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__ = [ - "GetMemoriesResponseIncludedDocumentParams", - "GetMemoriesResponseIncludedDocumentSystemParams", - "GetMemoriesResponseIncludedParams", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemParams", - "GetMemoriesResponseIncludedRelatedChildrenItemSystemParams", - "GetMemoriesResponseIncludedRelatedParams", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedParentsItemParams", - "GetMemoriesResponseIncludedRelatedParentsItemSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemParams", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams", - "GetMemoriesResponseParams", -] diff --git a/src/supermemory/memories/requests/get_memories_response_included.py b/src/supermemory/memories/requests/get_memories_response_included.py deleted file mode 100644 index 83dc2c9..0000000 --- a/src/supermemory/memories/requests/get_memories_response_included.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from .get_memories_response_included_document import GetMemoriesResponseIncludedDocumentParams -from .get_memories_response_included_related import GetMemoriesResponseIncludedRelatedParams - - -class GetMemoriesResponseIncludedParams(typing_extensions.TypedDict): - """ - Requested extras - """ - - related: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedParams] - """ - Present when include has related - """ - - document: typing_extensions.NotRequired[GetMemoriesResponseIncludedDocumentParams] - """ - Source document; present when include has documents and one exists - """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related.py b/src/supermemory/memories/requests/get_memories_response_included_related.py deleted file mode 100644 index 50f0104..0000000 --- a/src/supermemory/memories/requests/get_memories_response_included_related.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItemParams -from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItemParams -from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItemParams - - -class GetMemoriesResponseIncludedRelatedParams(typing_extensions.TypedDict): - """ - Present when include has related - """ - - parents: typing.Sequence[GetMemoriesResponseIncludedRelatedParentsItemParams] - """ - Earlier versions this memory updates, nearest first - """ - - children: typing.Sequence[GetMemoriesResponseIncludedRelatedChildrenItemParams] - """ - Newer versions that update this memory, nearest first - """ - - siblings: typing.Sequence[GetMemoriesResponseIncludedRelatedSiblingsItemParams] - """ - Memories connected by extends or derives, nearest first - """ diff --git a/src/supermemory/memories/types/__init__.py b/src/supermemory/memories/types/__init__.py deleted file mode 100644 index c73b1c6..0000000 --- a/src/supermemory/memories/types/__init__.py +++ /dev/null @@ -1,107 +0,0 @@ -# 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 .get_memories_request_include_item import GetMemoriesRequestIncludeItem - from .get_memories_response import GetMemoriesResponse - from .get_memories_response_included import GetMemoriesResponseIncluded - from .get_memories_response_included_document import GetMemoriesResponseIncludedDocument - from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystem - from .get_memories_response_included_related import GetMemoriesResponseIncludedRelated - from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItem - from .get_memories_response_included_related_children_item_document import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocument, - ) - from .get_memories_response_included_related_children_item_document_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, - ) - from .get_memories_response_included_related_children_item_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemSystem, - ) - from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItem - from .get_memories_response_included_related_parents_item_document import ( - GetMemoriesResponseIncludedRelatedParentsItemDocument, - ) - from .get_memories_response_included_related_parents_item_document_system import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, - ) - from .get_memories_response_included_related_parents_item_system import ( - GetMemoriesResponseIncludedRelatedParentsItemSystem, - ) - from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItem - from .get_memories_response_included_related_siblings_item_document import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocument, - ) - from .get_memories_response_included_related_siblings_item_document_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, - ) - from .get_memories_response_included_related_siblings_item_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemSystem, - ) -_dynamic_imports: typing.Dict[str, str] = { - "GetMemoriesRequestIncludeItem": ".get_memories_request_include_item", - "GetMemoriesResponse": ".get_memories_response", - "GetMemoriesResponseIncluded": ".get_memories_response_included", - "GetMemoriesResponseIncludedDocument": ".get_memories_response_included_document", - "GetMemoriesResponseIncludedDocumentSystem": ".get_memories_response_included_document_system", - "GetMemoriesResponseIncludedRelated": ".get_memories_response_included_related", - "GetMemoriesResponseIncludedRelatedChildrenItem": ".get_memories_response_included_related_children_item", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument": ".get_memories_response_included_related_children_item_document", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem": ".get_memories_response_included_related_children_item_document_system", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem": ".get_memories_response_included_related_children_item_system", - "GetMemoriesResponseIncludedRelatedParentsItem": ".get_memories_response_included_related_parents_item", - "GetMemoriesResponseIncludedRelatedParentsItemDocument": ".get_memories_response_included_related_parents_item_document", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem": ".get_memories_response_included_related_parents_item_document_system", - "GetMemoriesResponseIncludedRelatedParentsItemSystem": ".get_memories_response_included_related_parents_item_system", - "GetMemoriesResponseIncludedRelatedSiblingsItem": ".get_memories_response_included_related_siblings_item", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument": ".get_memories_response_included_related_siblings_item_document", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem": ".get_memories_response_included_related_siblings_item_document_system", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem": ".get_memories_response_included_related_siblings_item_system", -} - - -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__ = [ - "GetMemoriesRequestIncludeItem", - "GetMemoriesResponse", - "GetMemoriesResponseIncluded", - "GetMemoriesResponseIncludedDocument", - "GetMemoriesResponseIncludedDocumentSystem", - "GetMemoriesResponseIncludedRelated", - "GetMemoriesResponseIncludedRelatedChildrenItem", - "GetMemoriesResponseIncludedRelatedChildrenItemDocument", - "GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedChildrenItemSystem", - "GetMemoriesResponseIncludedRelatedParentsItem", - "GetMemoriesResponseIncludedRelatedParentsItemDocument", - "GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedParentsItemSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItem", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocument", - "GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem", - "GetMemoriesResponseIncludedRelatedSiblingsItemSystem", -] diff --git a/src/supermemory/memories/types/get_memories_request_include_item.py b/src/supermemory/memories/types/get_memories_request_include_item.py deleted file mode 100644 index be2ea50..0000000 --- a/src/supermemory/memories/types/get_memories_request_include_item.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -GetMemoriesRequestIncludeItem = typing.Union[typing.Literal["related", "documents"], typing.Any] diff --git a/src/supermemory/memories/types/get_memories_response_included_related.py b/src/supermemory/memories/types/get_memories_response_included_related.py deleted file mode 100644 index 1ef7b40..0000000 --- a/src/supermemory/memories/types/get_memories_response_included_related.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 -from .get_memories_response_included_related_children_item import GetMemoriesResponseIncludedRelatedChildrenItem -from .get_memories_response_included_related_parents_item import GetMemoriesResponseIncludedRelatedParentsItem -from .get_memories_response_included_related_siblings_item import GetMemoriesResponseIncludedRelatedSiblingsItem - - -class GetMemoriesResponseIncludedRelated(UncheckedBaseModel): - """ - Present when include has related - """ - - parents: typing.List[GetMemoriesResponseIncludedRelatedParentsItem] = pydantic.Field() - """ - Earlier versions this memory updates, nearest first - """ - - children: typing.List[GetMemoriesResponseIncludedRelatedChildrenItem] = pydantic.Field() - """ - Newer versions that update this memory, nearest first - """ - - siblings: typing.List[GetMemoriesResponseIncludedRelatedSiblingsItem] = pydantic.Field() - """ - Memories connected by extends or derives, nearest first - """ - - 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/namespaces/__init__.py b/src/supermemory/namespaces/__init__.py index 3c9eaff..5cde020 100644 --- a/src/supermemory/namespaces/__init__.py +++ b/src/supermemory/namespaces/__init__.py @@ -2,56 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - ListNamespacesResponse, - ListNamespacesResponseNamespacesItem, - ListNamespacesResponseNamespacesItemSystem, - ) - from .requests import ( - ListNamespacesResponseNamespacesItemParams, - ListNamespacesResponseNamespacesItemSystemParams, - ListNamespacesResponseParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "ListNamespacesResponse": ".types", - "ListNamespacesResponseNamespacesItem": ".types", - "ListNamespacesResponseNamespacesItemParams": ".requests", - "ListNamespacesResponseNamespacesItemSystem": ".types", - "ListNamespacesResponseNamespacesItemSystemParams": ".requests", - "ListNamespacesResponseParams": ".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__ = [ - "ListNamespacesResponse", - "ListNamespacesResponseNamespacesItem", - "ListNamespacesResponseNamespacesItemParams", - "ListNamespacesResponseNamespacesItemSystem", - "ListNamespacesResponseNamespacesItemSystemParams", - "ListNamespacesResponseParams", -] diff --git a/src/supermemory/namespaces/client.py b/src/supermemory/namespaces/client.py index 8eac474..5f26551 100644 --- a/src/supermemory/namespaces/client.py +++ b/src/supermemory/namespaces/client.py @@ -10,8 +10,8 @@ from ..core.request_options import RequestOptions from ..types.namespace_deleted import NamespaceDeleted from ..types.namespace_details import NamespaceDetails +from ..types.namespace_list import NamespaceList from .raw_client import AsyncRawNamespacesClient, RawNamespacesClient -from .types.list_namespaces_response import ListNamespacesResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -42,7 +42,7 @@ def list( 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, - ) -> ListNamespacesResponse: + ) -> NamespaceList: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. @@ -59,7 +59,7 @@ def list( Returns ------- - ListNamespacesResponse + NamespaceList Namespaces available to the caller Examples @@ -231,7 +231,7 @@ async def list( 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, - ) -> ListNamespacesResponse: + ) -> NamespaceList: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. @@ -248,7 +248,7 @@ async def list( Returns ------- - ListNamespacesResponse + NamespaceList Namespaces available to the caller Examples diff --git a/src/supermemory/namespaces/raw_client.py b/src/supermemory/namespaces/raw_client.py index aa8f373..ca322fb 100644 --- a/src/supermemory/namespaces/raw_client.py +++ b/src/supermemory/namespaces/raw_client.py @@ -24,7 +24,7 @@ from ..types.error_response import ErrorResponse from ..types.namespace_deleted import NamespaceDeleted from ..types.namespace_details import NamespaceDetails -from .types.list_namespaces_response import ListNamespacesResponse +from ..types.namespace_list import NamespaceList from pydantic import ValidationError # this is used as the default value for optional parameters @@ -45,7 +45,7 @@ def list( 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[ListNamespacesResponse]: + ) -> HttpResponse[NamespaceList]: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. @@ -62,7 +62,7 @@ def list( Returns ------- - HttpResponse[ListNamespacesResponse] + HttpResponse[NamespaceList] Namespaces available to the caller """ _response = self._client_wrapper.httpx_client.request( @@ -77,9 +77,9 @@ def list( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ListNamespacesResponse, + NamespaceList, construct_type( - type_=ListNamespacesResponse, # type: ignore + type_=NamespaceList, # type: ignore object_=_response.json(), ), ) @@ -496,7 +496,7 @@ async def list( 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[ListNamespacesResponse]: + ) -> AsyncHttpResponse[NamespaceList]: """ Discover every namespace available to the caller, including its purpose, document volume, memory count, and lifecycle timestamps. @@ -513,7 +513,7 @@ async def list( Returns ------- - AsyncHttpResponse[ListNamespacesResponse] + AsyncHttpResponse[NamespaceList] Namespaces available to the caller """ _response = await self._client_wrapper.httpx_client.request( @@ -528,9 +528,9 @@ async def list( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ListNamespacesResponse, + NamespaceList, construct_type( - type_=ListNamespacesResponse, # type: ignore + type_=NamespaceList, # type: ignore object_=_response.json(), ), ) diff --git a/src/supermemory/namespaces/requests/__init__.py b/src/supermemory/namespaces/requests/__init__.py deleted file mode 100644 index c013ed7..0000000 --- a/src/supermemory/namespaces/requests/__init__.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 .list_namespaces_response import ListNamespacesResponseParams - from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItemParams - from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystemParams -_dynamic_imports: typing.Dict[str, str] = { - "ListNamespacesResponseNamespacesItemParams": ".list_namespaces_response_namespaces_item", - "ListNamespacesResponseNamespacesItemSystemParams": ".list_namespaces_response_namespaces_item_system", - "ListNamespacesResponseParams": ".list_namespaces_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__ = [ - "ListNamespacesResponseNamespacesItemParams", - "ListNamespacesResponseNamespacesItemSystemParams", - "ListNamespacesResponseParams", -] diff --git a/src/supermemory/namespaces/requests/list_namespaces_response.py b/src/supermemory/namespaces/requests/list_namespaces_response.py deleted file mode 100644 index 8993e49..0000000 --- a/src/supermemory/namespaces/requests/list_namespaces_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ...requests.pagination import PaginationParams -from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItemParams - - -class ListNamespacesResponseParams(typing_extensions.TypedDict): - namespaces: typing.Sequence[ListNamespacesResponseNamespacesItemParams] - """ - Namespaces on this page, newest first - """ - - pagination: PaginationParams - """ - Pagination metadata - """ diff --git a/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py b/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py deleted file mode 100644 index d34d1c9..0000000 --- a/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item_system.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - -import typing_extensions -from ...core.serialization import FieldMetadata - - -class ListNamespacesResponseNamespacesItemSystemParams(typing_extensions.TypedDict): - """ - Namespace lifecycle timestamps - """ - - created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] - """ - ISO 8601 timestamp when the namespace was created - """ - - updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] - """ - ISO 8601 timestamp of the latest namespace update - """ diff --git a/src/supermemory/namespaces/types/__init__.py b/src/supermemory/namespaces/types/__init__.py deleted file mode 100644 index f5f91a3..0000000 --- a/src/supermemory/namespaces/types/__init__.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 .list_namespaces_response import ListNamespacesResponse - from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItem - from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystem -_dynamic_imports: typing.Dict[str, str] = { - "ListNamespacesResponse": ".list_namespaces_response", - "ListNamespacesResponseNamespacesItem": ".list_namespaces_response_namespaces_item", - "ListNamespacesResponseNamespacesItemSystem": ".list_namespaces_response_namespaces_item_system", -} - - -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__ = [ - "ListNamespacesResponse", - "ListNamespacesResponseNamespacesItem", - "ListNamespacesResponseNamespacesItemSystem", -] diff --git a/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py b/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py deleted file mode 100644 index 0100ae4..0000000 --- a/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item_system.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel - - -class ListNamespacesResponseNamespacesItemSystem(UncheckedBaseModel): - """ - Namespace lifecycle timestamps - """ - - created_at: typing_extensions.Annotated[ - dt.datetime, - FieldMetadata(alias="createdAt"), - pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the namespace was created"), - ] - """ - ISO 8601 timestamp when the namespace was created - """ - - updated_at: typing_extensions.Annotated[ - dt.datetime, - FieldMetadata(alias="updatedAt"), - pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest namespace update"), - ] - """ - ISO 8601 timestamp of the latest namespace update - """ - - 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/raw_client.py b/src/supermemory/raw_client.py index 715a0d4..09cca69 100644 --- a/src/supermemory/raw_client.py +++ b/src/supermemory/raw_client.py @@ -24,20 +24,20 @@ from .requests.filter_expression import FilterExpressionParams from .requests.list_request_include import ListRequestIncludeParams from .requests.metadata_value import MetadataValueParams -from .requests.search_request_include import SearchRequestIncludeParams -from .types.add_request_dreaming import AddRequestDreaming -from .types.add_request_task_type import AddRequestTaskType +from .requests.search_include import SearchIncludeParams from .types.bad_request_error_body import BadRequestErrorBody from .types.document_ref import DocumentRef +from .types.dreaming_mode import DreamingMode from .types.error_response import ErrorResponse from .types.list_response import ListResponse from .types.list_sort import ListSort from .types.list_type import ListType from .types.profile_response import ProfileResponse +from .types.search_mode import SearchMode from .types.search_request_rerank import SearchRequestRerank -from .types.search_request_search_mode import SearchRequestSearchMode from .types.search_response import SearchResponse from .types.sort_order import SortOrder +from .types.task_type import TaskType from pydantic import ValidationError # this is used as the default value for optional parameters @@ -58,8 +58,8 @@ def add( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[AddRequestTaskType] = OMIT, - dreaming: typing.Optional[AddRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -92,10 +92,10 @@ def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[AddRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[AddRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -220,9 +220,9 @@ def search( *, query: str, filter: typing.Optional[FilterExpressionParams] = OMIT, - search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + search_mode: typing.Optional[SearchMode] = OMIT, limit: typing.Optional[int] = OMIT, - include: typing.Optional[SearchRequestIncludeParams] = OMIT, + include: typing.Optional[SearchIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -246,13 +246,13 @@ def search( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchRequestSearchMode] + search_mode : typing.Optional[SearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. limit : typing.Optional[int] Maximum number of results to return - include : typing.Optional[SearchRequestIncludeParams] + include : typing.Optional[SearchIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -283,7 +283,7 @@ def search( "searchMode": search_mode, "limit": limit, "include": convert_and_respect_annotation_metadata( - object_=include, annotation=SearchRequestIncludeParams, direction="write" + object_=include, annotation=SearchIncludeParams, direction="write" ), "threshold": threshold, "rerank": rerank, @@ -636,8 +636,8 @@ async def add( metadata: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, group: typing.Optional[typing.Dict[str, MetadataValueParams]] = OMIT, date: typing.Optional[str] = OMIT, - task_type: typing.Optional[AddRequestTaskType] = OMIT, - dreaming: typing.Optional[AddRequestDreaming] = OMIT, + task_type: typing.Optional[TaskType] = OMIT, + dreaming: typing.Optional[DreamingMode] = 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, @@ -670,10 +670,10 @@ async def add( date : typing.Optional[str] When the source content is from, in ISO 8601 format - task_type : typing.Optional[AddRequestTaskType] + task_type : typing.Optional[TaskType] Processing pipeline. "memory" builds durable learned context; "superrag" optimizes the document for retrieval without generating memories. - dreaming : typing.Optional[AddRequestDreaming] + dreaming : typing.Optional[DreamingMode] Processing mode. "dynamic" (default) groups related documents so memories form from coherent context. "instant" processes each document independently right away and bills one extra operation per document. request_options : typing.Optional[RequestOptions] @@ -798,9 +798,9 @@ async def search( *, query: str, filter: typing.Optional[FilterExpressionParams] = OMIT, - search_mode: typing.Optional[SearchRequestSearchMode] = OMIT, + search_mode: typing.Optional[SearchMode] = OMIT, limit: typing.Optional[int] = OMIT, - include: typing.Optional[SearchRequestIncludeParams] = OMIT, + include: typing.Optional[SearchIncludeParams] = OMIT, threshold: typing.Optional[float] = OMIT, rerank: typing.Optional[SearchRequestRerank] = OMIT, rewrite_query: typing.Optional[bool] = OMIT, @@ -824,13 +824,13 @@ async def search( filter : typing.Optional[FilterExpressionParams] Type-safe metadata conditions applied before ranking results. Replaces the v4 `filters` field and unifies both legacy filter formats into one expression type. - search_mode : typing.Optional[SearchRequestSearchMode] + search_mode : typing.Optional[SearchMode] Search surface. "hybrid" combines learned memories with source chunks, "memories" returns learned context, and "chunks" returns source passages. limit : typing.Optional[int] Maximum number of results to return - include : typing.Optional[SearchRequestIncludeParams] + include : typing.Optional[SearchIncludeParams] Optional context to include alongside each matching result threshold : typing.Optional[float] @@ -861,7 +861,7 @@ async def search( "searchMode": search_mode, "limit": limit, "include": convert_and_respect_annotation_metadata( - object_=include, annotation=SearchRequestIncludeParams, direction="write" + object_=include, annotation=SearchIncludeParams, direction="write" ), "threshold": threshold, "rerank": rerank, diff --git a/src/supermemory/requests/__init__.py b/src/supermemory/requests/__init__.py index b610c67..f994ada 100644 --- a/src/supermemory/requests/__init__.py +++ b/src/supermemory/requests/__init__.py @@ -16,9 +16,10 @@ from .connector_capabilities import ConnectorCapabilitiesParams from .connector_config_value import ConnectorConfigValueParams from .connector_deleted import ConnectorDeletedParams - from .connector_last_sync import ConnectorLastSyncParams + from .connector_link import ConnectorLinkParams from .connector_list import ConnectorListParams - from .connector_picker import ConnectorPickerParams + from .connector_run import ConnectorRunParams + from .connector_run_system import ConnectorRunSystemParams from .connector_selection import ConnectorSelectionParams from .connector_selection_item import ConnectorSelectionItemParams from .connector_setup import ( @@ -44,6 +45,8 @@ from .connector_sync import ConnectorSyncParams from .connector_sync_failure import ConnectorSyncFailureParams from .connector_sync_started import ConnectorSyncStartedParams + from .connector_sync_system import ConnectorSyncSystemParams + from .connector_system import ConnectorSystemParams from .delete_document_error import DeleteDocumentErrorParams from .delete_documents_result import DeleteDocumentsResultParams from .document import DocumentParams @@ -71,13 +74,38 @@ from .list_request_include import ListRequestIncludeParams from .list_response import ListResponseParams from .memory import MemoryParams + from .memory_details import MemoryDetailsParams + from .memory_included import MemoryIncludedParams + from .memory_included_document import MemoryIncludedDocumentParams + from .memory_included_document_system import MemoryIncludedDocumentSystemParams + from .memory_included_related import MemoryIncludedRelatedParams + from .memory_included_related_children_item import MemoryIncludedRelatedChildrenItemParams + from .memory_included_related_children_item_document import MemoryIncludedRelatedChildrenItemDocumentParams + from .memory_included_related_children_item_document_system import ( + MemoryIncludedRelatedChildrenItemDocumentSystemParams, + ) + from .memory_included_related_children_item_system import MemoryIncludedRelatedChildrenItemSystemParams + from .memory_included_related_parents_item import MemoryIncludedRelatedParentsItemParams + from .memory_included_related_parents_item_document import MemoryIncludedRelatedParentsItemDocumentParams + from .memory_included_related_parents_item_document_system import ( + MemoryIncludedRelatedParentsItemDocumentSystemParams, + ) + from .memory_included_related_parents_item_system import MemoryIncludedRelatedParentsItemSystemParams + from .memory_included_related_siblings_item import MemoryIncludedRelatedSiblingsItemParams + from .memory_included_related_siblings_item_document import MemoryIncludedRelatedSiblingsItemDocumentParams + from .memory_included_related_siblings_item_document_system import ( + MemoryIncludedRelatedSiblingsItemDocumentSystemParams, + ) + from .memory_included_related_siblings_item_system import MemoryIncludedRelatedSiblingsItemSystemParams from .memory_system import MemorySystemParams from .metadata_value import MetadataValueParams + from .namespace import NamespaceParams from .namespace_deleted import NamespaceDeletedParams, NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams from .namespace_deleted_deleted import NamespaceDeletedDeletedParams from .namespace_deleted_queued import NamespaceDeletedQueuedParams from .namespace_details import NamespaceDetailsParams - from .namespace_details_system import NamespaceDetailsSystemParams + from .namespace_list import NamespaceListParams + from .namespace_system import NamespaceSystemParams from .organization import OrganizationParams from .pagination import PaginationParams from .profile import ProfileParams @@ -88,7 +116,7 @@ from .related_memory import RelatedMemoryParams from .related_memory_system import RelatedMemorySystemParams from .s3config import S3ConfigParams - from .search_request_include import SearchRequestIncludeParams + from .search_include import SearchIncludeParams from .search_response import SearchResponseParams from .search_result import SearchResultParams from .search_result_included import SearchResultIncludedParams @@ -109,10 +137,11 @@ "ConnectorCapabilitiesParams": ".connector_capabilities", "ConnectorConfigValueParams": ".connector_config_value", "ConnectorDeletedParams": ".connector_deleted", - "ConnectorLastSyncParams": ".connector_last_sync", + "ConnectorLinkParams": ".connector_link", "ConnectorListParams": ".connector_list", "ConnectorParams": ".connector", - "ConnectorPickerParams": ".connector_picker", + "ConnectorRunParams": ".connector_run", + "ConnectorRunSystemParams": ".connector_run_system", "ConnectorSelectionItemParams": ".connector_selection_item", "ConnectorSelectionParams": ".connector_selection", "ConnectorSetupGithubParams": ".connector_setup_github", @@ -136,6 +165,8 @@ "ConnectorSyncFailureParams": ".connector_sync_failure", "ConnectorSyncParams": ".connector_sync", "ConnectorSyncStartedParams": ".connector_sync_started", + "ConnectorSyncSystemParams": ".connector_sync_system", + "ConnectorSystemParams": ".connector_system", "DeleteDocumentErrorParams": ".delete_document_error", "DeleteDocumentsResultParams": ".delete_documents_result", "DocumentInputParams": ".document_input", @@ -162,6 +193,23 @@ "GranolaConfigParams": ".granola_config", "ListRequestIncludeParams": ".list_request_include", "ListResponseParams": ".list_response", + "MemoryDetailsParams": ".memory_details", + "MemoryIncludedDocumentParams": ".memory_included_document", + "MemoryIncludedDocumentSystemParams": ".memory_included_document_system", + "MemoryIncludedParams": ".memory_included", + "MemoryIncludedRelatedChildrenItemDocumentParams": ".memory_included_related_children_item_document", + "MemoryIncludedRelatedChildrenItemDocumentSystemParams": ".memory_included_related_children_item_document_system", + "MemoryIncludedRelatedChildrenItemParams": ".memory_included_related_children_item", + "MemoryIncludedRelatedChildrenItemSystemParams": ".memory_included_related_children_item_system", + "MemoryIncludedRelatedParams": ".memory_included_related", + "MemoryIncludedRelatedParentsItemDocumentParams": ".memory_included_related_parents_item_document", + "MemoryIncludedRelatedParentsItemDocumentSystemParams": ".memory_included_related_parents_item_document_system", + "MemoryIncludedRelatedParentsItemParams": ".memory_included_related_parents_item", + "MemoryIncludedRelatedParentsItemSystemParams": ".memory_included_related_parents_item_system", + "MemoryIncludedRelatedSiblingsItemDocumentParams": ".memory_included_related_siblings_item_document", + "MemoryIncludedRelatedSiblingsItemDocumentSystemParams": ".memory_included_related_siblings_item_document_system", + "MemoryIncludedRelatedSiblingsItemParams": ".memory_included_related_siblings_item", + "MemoryIncludedRelatedSiblingsItemSystemParams": ".memory_included_related_siblings_item_system", "MemoryParams": ".memory", "MemorySystemParams": ".memory_system", "MetadataValueParams": ".metadata_value", @@ -171,7 +219,9 @@ "NamespaceDeleted_DeletedParams": ".namespace_deleted", "NamespaceDeleted_QueuedParams": ".namespace_deleted", "NamespaceDetailsParams": ".namespace_details", - "NamespaceDetailsSystemParams": ".namespace_details_system", + "NamespaceListParams": ".namespace_list", + "NamespaceParams": ".namespace", + "NamespaceSystemParams": ".namespace_system", "OrganizationParams": ".organization", "PaginationParams": ".pagination", "ProfileBucketsParams": ".profile_buckets", @@ -182,7 +232,7 @@ "RelatedMemoryParams": ".related_memory", "RelatedMemorySystemParams": ".related_memory_system", "S3ConfigParams": ".s3config", - "SearchRequestIncludeParams": ".search_request_include", + "SearchIncludeParams": ".search_include", "SearchResponseParams": ".search_response", "SearchResultIncludedDocumentParams": ".search_result_included_document", "SearchResultIncludedDocumentSystemParams": ".search_result_included_document_system", @@ -227,10 +277,11 @@ def __dir__(): "ConnectorCapabilitiesParams", "ConnectorConfigValueParams", "ConnectorDeletedParams", - "ConnectorLastSyncParams", + "ConnectorLinkParams", "ConnectorListParams", "ConnectorParams", - "ConnectorPickerParams", + "ConnectorRunParams", + "ConnectorRunSystemParams", "ConnectorSelectionItemParams", "ConnectorSelectionParams", "ConnectorSetupGithubParams", @@ -254,6 +305,8 @@ def __dir__(): "ConnectorSyncFailureParams", "ConnectorSyncParams", "ConnectorSyncStartedParams", + "ConnectorSyncSystemParams", + "ConnectorSystemParams", "DeleteDocumentErrorParams", "DeleteDocumentsResultParams", "DocumentInputParams", @@ -280,6 +333,23 @@ def __dir__(): "GranolaConfigParams", "ListRequestIncludeParams", "ListResponseParams", + "MemoryDetailsParams", + "MemoryIncludedDocumentParams", + "MemoryIncludedDocumentSystemParams", + "MemoryIncludedParams", + "MemoryIncludedRelatedChildrenItemDocumentParams", + "MemoryIncludedRelatedChildrenItemDocumentSystemParams", + "MemoryIncludedRelatedChildrenItemParams", + "MemoryIncludedRelatedChildrenItemSystemParams", + "MemoryIncludedRelatedParams", + "MemoryIncludedRelatedParentsItemDocumentParams", + "MemoryIncludedRelatedParentsItemDocumentSystemParams", + "MemoryIncludedRelatedParentsItemParams", + "MemoryIncludedRelatedParentsItemSystemParams", + "MemoryIncludedRelatedSiblingsItemDocumentParams", + "MemoryIncludedRelatedSiblingsItemDocumentSystemParams", + "MemoryIncludedRelatedSiblingsItemParams", + "MemoryIncludedRelatedSiblingsItemSystemParams", "MemoryParams", "MemorySystemParams", "MetadataValueParams", @@ -289,7 +359,9 @@ def __dir__(): "NamespaceDeleted_DeletedParams", "NamespaceDeleted_QueuedParams", "NamespaceDetailsParams", - "NamespaceDetailsSystemParams", + "NamespaceListParams", + "NamespaceParams", + "NamespaceSystemParams", "OrganizationParams", "PaginationParams", "ProfileBucketsParams", @@ -300,7 +372,7 @@ def __dir__(): "RelatedMemoryParams", "RelatedMemorySystemParams", "S3ConfigParams", - "SearchRequestIncludeParams", + "SearchIncludeParams", "SearchResponseParams", "SearchResultIncludedDocumentParams", "SearchResultIncludedDocumentSystemParams", diff --git a/src/supermemory/requests/connector.py b/src/supermemory/requests/connector.py index 8e3da9d..3b3025d 100644 --- a/src/supermemory/requests/connector.py +++ b/src/supermemory/requests/connector.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import typing_extensions from ..core.serialization import FieldMetadata from ..types.connector_provider import ConnectorProvider -from ..types.connector_status import ConnectorStatus from .connector_capabilities import ConnectorCapabilitiesParams from .connector_config_value import ConnectorConfigValueParams -from .connector_last_sync import ConnectorLastSyncParams -from .connector_picker import ConnectorPickerParams +from .connector_link import ConnectorLinkParams +from .connector_run import ConnectorRunParams from .connector_selection_item import ConnectorSelectionItemParams from .connector_sync import ConnectorSyncParams +from .connector_system import ConnectorSystemParams class ConnectorParams(typing_extensions.TypedDict): @@ -22,21 +21,9 @@ class ConnectorParams(typing_extensions.TypedDict): External source """ - status: ConnectorStatus + authorization: typing_extensions.NotRequired[ConnectorLinkParams] """ - pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed. - """ - - auth_url: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="authUrl")]] - """ - Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize - """ - - auth_url_expires_at: typing_extensions.NotRequired[ - typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="authUrlExpiresAt")] - ] - """ - Present while pending: when authUrl stops working + Present while pending, when the caller can create connectors in this namespace """ namespace: typing.Optional[str] @@ -62,23 +49,22 @@ class ConnectorParams(typing_extensions.TypedDict): document_limit: typing_extensions.Annotated[float, FieldMetadata(alias="documentLimit")] document_count: typing_extensions.Annotated[float, FieldMetadata(alias="documentCount")] - last_sync: typing_extensions.Annotated[typing.Optional[ConnectorLastSyncParams], FieldMetadata(alias="lastSync")] + latest_run: typing_extensions.Annotated[typing.Optional[ConnectorRunParams], FieldMetadata(alias="latestRun")] """ - Most recent sync run + The most recent sync run, which may still be running or may have failed """ - last_synced_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="lastSyncedAt")] + system: ConnectorSystemParams """ - When content last finished syncing + Lifecycle status and timestamps maintained by Supermemory """ - created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] syncs: typing_extensions.NotRequired[typing.Sequence[ConnectorSyncParams]] """ Present when include=syncs """ - picker: typing_extensions.NotRequired[typing.Optional[ConnectorPickerParams]] + picker: typing_extensions.NotRequired[typing.Optional[ConnectorLinkParams]] """ Present when include=picker. Null for connectors that sync everything. """ diff --git a/src/supermemory/requests/connector_picker.py b/src/supermemory/requests/connector_link.py similarity index 85% rename from src/supermemory/requests/connector_picker.py rename to src/supermemory/requests/connector_link.py index 6d3c6ee..efaf7bf 100644 --- a/src/supermemory/requests/connector_picker.py +++ b/src/supermemory/requests/connector_link.py @@ -6,7 +6,7 @@ from ..core.serialization import FieldMetadata -class ConnectorPickerParams(typing_extensions.TypedDict): +class ConnectorLinkParams(typing_extensions.TypedDict): url: str """ Send the user here to choose what syncs. Works once, in any browser. diff --git a/src/supermemory/requests/connector_last_sync.py b/src/supermemory/requests/connector_run.py similarity index 51% rename from src/supermemory/requests/connector_last_sync.py rename to src/supermemory/requests/connector_run.py index 1a15d3f..56a8998 100644 --- a/src/supermemory/requests/connector_last_sync.py +++ b/src/supermemory/requests/connector_run.py @@ -1,21 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import typing_extensions from ..core.serialization import FieldMetadata from ..types.connector_error_code import ConnectorErrorCode -from ..types.connector_sync_status import ConnectorSyncStatus +from .connector_run_system import ConnectorRunSystemParams -class ConnectorLastSyncParams(typing_extensions.TypedDict): - status: ConnectorSyncStatus +class ConnectorRunParams(typing_extensions.TypedDict): error_code: typing_extensions.Annotated[typing.Optional[ConnectorErrorCode], FieldMetadata(alias="errorCode")] error: typing.Optional[str] """ Customer-safe error message """ - started_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startedAt")] - completed_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="completedAt")] + system: ConnectorRunSystemParams + """ + Run status and timestamps maintained by Supermemory + """ diff --git a/src/supermemory/requests/connector_run_system.py b/src/supermemory/requests/connector_run_system.py new file mode 100644 index 0000000..273e8f8 --- /dev/null +++ b/src/supermemory/requests/connector_run_system.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata +from ..types.connector_run_status import ConnectorRunStatus + + +class ConnectorRunSystemParams(typing_extensions.TypedDict): + """ + Run status and timestamps maintained by Supermemory + """ + + status: ConnectorRunStatus + started_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startedAt")] + """ + ISO 8601 timestamp when the run started + """ + + completed_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="completedAt")] + """ + ISO 8601 timestamp when the run ended; null while running + """ diff --git a/src/supermemory/requests/connector_setup_result.py b/src/supermemory/requests/connector_setup_result.py index 47a09b6..3f60139 100644 --- a/src/supermemory/requests/connector_setup_result.py +++ b/src/supermemory/requests/connector_setup_result.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import typing_extensions -from ..core.serialization import FieldMetadata +from .connector_link import ConnectorLinkParams class ConnectorSetupResultParams(typing_extensions.TypedDict): @@ -13,14 +12,7 @@ class ConnectorSetupResultParams(typing_extensions.TypedDict): Connector identifier """ - auth_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="authUrl")] + authorization: typing.Optional[ConnectorLinkParams] """ - Send the user here to authorize the provider. Null for providers that authenticate with config only. - """ - - auth_url_expires_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], FieldMetadata(alias="authUrlExpiresAt") - ] - """ - When authUrl stops working + Null for providers that authenticate with config only """ diff --git a/src/supermemory/requests/connector_sync.py b/src/supermemory/requests/connector_sync.py index e9c52ab..6591f74 100644 --- a/src/supermemory/requests/connector_sync.py +++ b/src/supermemory/requests/connector_sync.py @@ -1,26 +1,27 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import typing_extensions from ..core.serialization import FieldMetadata from ..types.connector_error_code import ConnectorErrorCode -from ..types.connector_sync_status import ConnectorSyncStatus from ..types.connector_sync_trigger import ConnectorSyncTrigger from .connector_sync_failure import ConnectorSyncFailureParams +from .connector_sync_system import ConnectorSyncSystemParams class ConnectorSyncParams(typing_extensions.TypedDict): - status: ConnectorSyncStatus error_code: typing_extensions.Annotated[typing.Optional[ConnectorErrorCode], FieldMetadata(alias="errorCode")] error: typing.Optional[str] """ Customer-safe error message """ - started_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startedAt")] - completed_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="completedAt")] + system: ConnectorSyncSystemParams + """ + Run status and timestamps maintained by Supermemory + """ + id: str trigger: ConnectorSyncTrigger items_processed: typing_extensions.Annotated[float, FieldMetadata(alias="itemsProcessed")] diff --git a/src/supermemory/requests/connector_sync_system.py b/src/supermemory/requests/connector_sync_system.py new file mode 100644 index 0000000..81c2b1b --- /dev/null +++ b/src/supermemory/requests/connector_sync_system.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata +from ..types.connector_run_status import ConnectorRunStatus + + +class ConnectorSyncSystemParams(typing_extensions.TypedDict): + """ + Run status and timestamps maintained by Supermemory + """ + + status: ConnectorRunStatus + started_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startedAt")] + """ + ISO 8601 timestamp when the run started + """ + + completed_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="completedAt")] + """ + ISO 8601 timestamp when the run ended; null while running + """ diff --git a/src/supermemory/requests/connector_system.py b/src/supermemory/requests/connector_system.py new file mode 100644 index 0000000..ca83efc --- /dev/null +++ b/src/supermemory/requests/connector_system.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata +from ..types.connector_status import ConnectorStatus + + +class ConnectorSystemParams(typing_extensions.TypedDict): + """ + Lifecycle status and timestamps maintained by Supermemory + """ + + status: ConnectorStatus + """ + pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + """ + ISO 8601 timestamp when the connector was created + """ + + last_successful_sync_at: typing_extensions.Annotated[ + typing.Optional[dt.datetime], FieldMetadata(alias="lastSuccessfulSyncAt") + ] + """ + ISO 8601 timestamp when content last finished syncing successfully + """ diff --git a/src/supermemory/memories/requests/get_memories_response.py b/src/supermemory/requests/memory_details.py similarity index 79% rename from src/supermemory/memories/requests/get_memories_response.py rename to src/supermemory/requests/memory_details.py index 279d812..2e59c6a 100644 --- a/src/supermemory/memories/requests/get_memories_response.py +++ b/src/supermemory/requests/memory_details.py @@ -3,12 +3,12 @@ import typing import typing_extensions -from ...core.serialization import FieldMetadata -from ...requests.memory_system import MemorySystemParams -from .get_memories_response_included import GetMemoriesResponseIncludedParams +from ..core.serialization import FieldMetadata +from .memory_included import MemoryIncludedParams +from .memory_system import MemorySystemParams -class GetMemoriesResponseParams(typing_extensions.TypedDict): +class MemoryDetailsParams(typing_extensions.TypedDict): id: str """ Stable memory identifier @@ -54,7 +54,7 @@ class GetMemoriesResponseParams(typing_extensions.TypedDict): Lifecycle timestamps maintained by Supermemory """ - included: typing_extensions.NotRequired[GetMemoriesResponseIncludedParams] + included: typing_extensions.NotRequired[MemoryIncludedParams] """ Requested extras """ diff --git a/src/supermemory/requests/memory_included.py b/src/supermemory/requests/memory_included.py new file mode 100644 index 0000000..f89a313 --- /dev/null +++ b/src/supermemory/requests/memory_included.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from .memory_included_document import MemoryIncludedDocumentParams +from .memory_included_related import MemoryIncludedRelatedParams + + +class MemoryIncludedParams(typing_extensions.TypedDict): + """ + Requested extras + """ + + related: typing_extensions.NotRequired[MemoryIncludedRelatedParams] + """ + Present when include has related + """ + + document: typing_extensions.NotRequired[MemoryIncludedDocumentParams] + """ + Source document; present when include has documents and one exists + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_document.py b/src/supermemory/requests/memory_included_document.py similarity index 73% rename from src/supermemory/memories/requests/get_memories_response_included_document.py rename to src/supermemory/requests/memory_included_document.py index 492142a..f339e4a 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_document.py +++ b/src/supermemory/requests/memory_included_document.py @@ -3,10 +3,10 @@ import typing import typing_extensions -from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystemParams +from .memory_included_document_system import MemoryIncludedDocumentSystemParams -class GetMemoriesResponseIncludedDocumentParams(typing_extensions.TypedDict): +class MemoryIncludedDocumentParams(typing_extensions.TypedDict): """ Source document; present when include has documents and one exists """ @@ -36,7 +36,7 @@ class GetMemoriesResponseIncludedDocumentParams(typing_extensions.TypedDict): Generated summary of the source document """ - system: GetMemoriesResponseIncludedDocumentSystemParams + system: MemoryIncludedDocumentSystemParams """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_document_system.py b/src/supermemory/requests/memory_included_document_system.py similarity index 78% rename from src/supermemory/memories/requests/get_memories_response_included_document_system.py rename to src/supermemory/requests/memory_included_document_system.py index e5d7bab..23aa7ac 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_document_system.py +++ b/src/supermemory/requests/memory_included_document_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedDocumentSystemParams(typing_extensions.TypedDict): +class MemoryIncludedDocumentSystemParams(typing_extensions.TypedDict): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/requests/memory_included_related.py b/src/supermemory/requests/memory_included_related.py new file mode 100644 index 0000000..dfa713a --- /dev/null +++ b/src/supermemory/requests/memory_included_related.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .memory_included_related_children_item import MemoryIncludedRelatedChildrenItemParams +from .memory_included_related_parents_item import MemoryIncludedRelatedParentsItemParams +from .memory_included_related_siblings_item import MemoryIncludedRelatedSiblingsItemParams + + +class MemoryIncludedRelatedParams(typing_extensions.TypedDict): + """ + Present when include has related + """ + + parents: typing.Sequence[MemoryIncludedRelatedParentsItemParams] + """ + Earlier versions this memory updates, nearest first + """ + + children: typing.Sequence[MemoryIncludedRelatedChildrenItemParams] + """ + Newer versions that update this memory, nearest first + """ + + siblings: typing.Sequence[MemoryIncludedRelatedSiblingsItemParams] + """ + Memories connected by extends or derives, nearest first + """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py b/src/supermemory/requests/memory_included_related_children_item.py similarity index 55% rename from src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py rename to src/supermemory/requests/memory_included_related_children_item.py index 5f7e5a2..e8e1ff8 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item.py +++ b/src/supermemory/requests/memory_included_related_children_item.py @@ -3,16 +3,12 @@ import typing import typing_extensions -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_parents_item_document import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentParams, -) -from .get_memories_response_included_related_parents_item_system import ( - GetMemoriesResponseIncludedRelatedParentsItemSystemParams, -) +from ..types.memory_relation import MemoryRelation +from .memory_included_related_children_item_document import MemoryIncludedRelatedChildrenItemDocumentParams +from .memory_included_related_children_item_system import MemoryIncludedRelatedChildrenItemSystemParams -class GetMemoriesResponseIncludedRelatedParentsItemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedChildrenItemParams(typing_extensions.TypedDict): id: str """ Related memory ID @@ -38,12 +34,12 @@ class GetMemoriesResponseIncludedRelatedParentsItemParams(typing_extensions.Type Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedParentsItemSystemParams + system: MemoryIncludedRelatedChildrenItemSystemParams """ Lifecycle details for the related memory """ - document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedParentsItemDocumentParams] + document: typing_extensions.NotRequired[MemoryIncludedRelatedChildrenItemDocumentParams] """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py b/src/supermemory/requests/memory_included_related_children_item_document.py similarity index 67% rename from src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py rename to src/supermemory/requests/memory_included_related_children_item_document.py index 70131d3..fddb2a6 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document.py +++ b/src/supermemory/requests/memory_included_related_children_item_document.py @@ -3,12 +3,10 @@ import typing import typing_extensions -from .get_memories_response_included_related_parents_item_document_system import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams, -) +from .memory_included_related_children_item_document_system import MemoryIncludedRelatedChildrenItemDocumentSystemParams -class GetMemoriesResponseIncludedRelatedParentsItemDocumentParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedChildrenItemDocumentParams(typing_extensions.TypedDict): """ Source document; present when include has both related and documents """ @@ -38,7 +36,7 @@ class GetMemoriesResponseIncludedRelatedParentsItemDocumentParams(typing_extensi Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams + system: MemoryIncludedRelatedChildrenItemDocumentSystemParams """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py b/src/supermemory/requests/memory_included_related_children_item_document_system.py similarity index 76% rename from src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py rename to src/supermemory/requests/memory_included_related_children_item_document_system.py index bf9b62e..ae0962c 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_document_system.py +++ b/src/supermemory/requests/memory_included_related_children_item_document_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedParentsItemDocumentSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedChildrenItemDocumentSystemParams(typing_extensions.TypedDict): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py b/src/supermemory/requests/memory_included_related_children_item_system.py similarity index 68% rename from src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py rename to src/supermemory/requests/memory_included_related_children_item_system.py index 002582a..df362a7 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_parents_item_system.py +++ b/src/supermemory/requests/memory_included_related_children_item_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedParentsItemSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedChildrenItemSystemParams(typing_extensions.TypedDict): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py b/src/supermemory/requests/memory_included_related_parents_item.py similarity index 54% rename from src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py rename to src/supermemory/requests/memory_included_related_parents_item.py index c64b9a5..52ba297 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item.py +++ b/src/supermemory/requests/memory_included_related_parents_item.py @@ -3,16 +3,12 @@ import typing import typing_extensions -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_siblings_item_document import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams, -) -from .get_memories_response_included_related_siblings_item_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams, -) +from ..types.memory_relation import MemoryRelation +from .memory_included_related_parents_item_document import MemoryIncludedRelatedParentsItemDocumentParams +from .memory_included_related_parents_item_system import MemoryIncludedRelatedParentsItemSystemParams -class GetMemoriesResponseIncludedRelatedSiblingsItemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedParentsItemParams(typing_extensions.TypedDict): id: str """ Related memory ID @@ -38,12 +34,12 @@ class GetMemoriesResponseIncludedRelatedSiblingsItemParams(typing_extensions.Typ Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams + system: MemoryIncludedRelatedParentsItemSystemParams """ Lifecycle details for the related memory """ - document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams] + document: typing_extensions.NotRequired[MemoryIncludedRelatedParentsItemDocumentParams] """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py b/src/supermemory/requests/memory_included_related_parents_item_document.py similarity index 67% rename from src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py rename to src/supermemory/requests/memory_included_related_parents_item_document.py index 6d7d92e..ab870b8 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document.py +++ b/src/supermemory/requests/memory_included_related_parents_item_document.py @@ -3,12 +3,10 @@ import typing import typing_extensions -from .get_memories_response_included_related_children_item_document_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams, -) +from .memory_included_related_parents_item_document_system import MemoryIncludedRelatedParentsItemDocumentSystemParams -class GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedParentsItemDocumentParams(typing_extensions.TypedDict): """ Source document; present when include has both related and documents """ @@ -38,7 +36,7 @@ class GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams(typing_extens Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams + system: MemoryIncludedRelatedParentsItemDocumentSystemParams """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py b/src/supermemory/requests/memory_included_related_parents_item_document_system.py similarity index 76% rename from src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py rename to src/supermemory/requests/memory_included_related_parents_item_document_system.py index 5e4a10c..433a041 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_document_system.py +++ b/src/supermemory/requests/memory_included_related_parents_item_document_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedParentsItemDocumentSystemParams(typing_extensions.TypedDict): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py b/src/supermemory/requests/memory_included_related_parents_item_system.py similarity index 68% rename from src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py rename to src/supermemory/requests/memory_included_related_parents_item_system.py index 45c1b21..3bd9d79 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_system.py +++ b/src/supermemory/requests/memory_included_related_parents_item_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedSiblingsItemSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedParentsItemSystemParams(typing_extensions.TypedDict): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item.py b/src/supermemory/requests/memory_included_related_siblings_item.py similarity index 54% rename from src/supermemory/memories/requests/get_memories_response_included_related_children_item.py rename to src/supermemory/requests/memory_included_related_siblings_item.py index 253cdd3..0b2e08a 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_children_item.py +++ b/src/supermemory/requests/memory_included_related_siblings_item.py @@ -3,16 +3,12 @@ import typing import typing_extensions -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_children_item_document import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams, -) -from .get_memories_response_included_related_children_item_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemSystemParams, -) +from ..types.memory_relation import MemoryRelation +from .memory_included_related_siblings_item_document import MemoryIncludedRelatedSiblingsItemDocumentParams +from .memory_included_related_siblings_item_system import MemoryIncludedRelatedSiblingsItemSystemParams -class GetMemoriesResponseIncludedRelatedChildrenItemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedSiblingsItemParams(typing_extensions.TypedDict): id: str """ Related memory ID @@ -38,12 +34,12 @@ class GetMemoriesResponseIncludedRelatedChildrenItemParams(typing_extensions.Typ Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedChildrenItemSystemParams + system: MemoryIncludedRelatedSiblingsItemSystemParams """ Lifecycle details for the related memory """ - document: typing_extensions.NotRequired[GetMemoriesResponseIncludedRelatedChildrenItemDocumentParams] + document: typing_extensions.NotRequired[MemoryIncludedRelatedSiblingsItemDocumentParams] """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py b/src/supermemory/requests/memory_included_related_siblings_item_document.py similarity index 67% rename from src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py rename to src/supermemory/requests/memory_included_related_siblings_item_document.py index 0afa1c9..23e8f42 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document.py +++ b/src/supermemory/requests/memory_included_related_siblings_item_document.py @@ -3,12 +3,10 @@ import typing import typing_extensions -from .get_memories_response_included_related_siblings_item_document_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams, -) +from .memory_included_related_siblings_item_document_system import MemoryIncludedRelatedSiblingsItemDocumentSystemParams -class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedSiblingsItemDocumentParams(typing_extensions.TypedDict): """ Source document; present when include has both related and documents """ @@ -38,7 +36,7 @@ class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentParams(typing_extens Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams + system: MemoryIncludedRelatedSiblingsItemDocumentSystemParams """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py b/src/supermemory/requests/memory_included_related_siblings_item_document_system.py similarity index 76% rename from src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py rename to src/supermemory/requests/memory_included_related_siblings_item_document_system.py index bccb1da..71d1da2 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_siblings_item_document_system.py +++ b/src/supermemory/requests/memory_included_related_siblings_item_document_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedSiblingsItemDocumentSystemParams(typing_extensions.TypedDict): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py b/src/supermemory/requests/memory_included_related_siblings_item_system.py similarity index 68% rename from src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py rename to src/supermemory/requests/memory_included_related_siblings_item_system.py index 0e46cec..8a4d0c3 100644 --- a/src/supermemory/memories/requests/get_memories_response_included_related_children_item_system.py +++ b/src/supermemory/requests/memory_included_related_siblings_item_system.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ...core.serialization import FieldMetadata +from ..core.serialization import FieldMetadata -class GetMemoriesResponseIncludedRelatedChildrenItemSystemParams(typing_extensions.TypedDict): +class MemoryIncludedRelatedSiblingsItemSystemParams(typing_extensions.TypedDict): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py b/src/supermemory/requests/namespace.py similarity index 71% rename from src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py rename to src/supermemory/requests/namespace.py index 61c42c1..03949b1 100644 --- a/src/supermemory/namespaces/requests/list_namespaces_response_namespaces_item.py +++ b/src/supermemory/requests/namespace.py @@ -3,11 +3,11 @@ import typing import typing_extensions -from ...core.serialization import FieldMetadata -from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystemParams +from ..core.serialization import FieldMetadata +from .namespace_system import NamespaceSystemParams -class ListNamespacesResponseNamespacesItemParams(typing_extensions.TypedDict): +class NamespaceParams(typing_extensions.TypedDict): id: str """ Internal identifier for the namespace @@ -33,7 +33,7 @@ class ListNamespacesResponseNamespacesItemParams(typing_extensions.TypedDict): Human-readable purpose or scope of the namespace """ - system: ListNamespacesResponseNamespacesItemSystemParams + system: NamespaceSystemParams """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/requests/namespace_details.py b/src/supermemory/requests/namespace_details.py index 25407b0..884ce99 100644 --- a/src/supermemory/requests/namespace_details.py +++ b/src/supermemory/requests/namespace_details.py @@ -4,7 +4,7 @@ import typing_extensions from ..core.serialization import FieldMetadata -from .namespace_details_system import NamespaceDetailsSystemParams +from .namespace_system import NamespaceSystemParams class NamespaceDetailsParams(typing_extensions.TypedDict): @@ -18,7 +18,7 @@ class NamespaceDetailsParams(typing_extensions.TypedDict): Background that helps Supermemory interpret documents and form better memories in this namespace """ - system: NamespaceDetailsSystemParams + system: NamespaceSystemParams """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/requests/namespace_list.py b/src/supermemory/requests/namespace_list.py new file mode 100644 index 0000000..f9ce174 --- /dev/null +++ b/src/supermemory/requests/namespace_list.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .namespace import NamespaceParams +from .pagination import PaginationParams + + +class NamespaceListParams(typing_extensions.TypedDict): + namespaces: typing.Sequence[NamespaceParams] + """ + Namespaces on this page, newest first + """ + + pagination: PaginationParams + """ + Pagination metadata + """ diff --git a/src/supermemory/requests/namespace_details_system.py b/src/supermemory/requests/namespace_system.py similarity index 80% rename from src/supermemory/requests/namespace_details_system.py rename to src/supermemory/requests/namespace_system.py index 53ef664..4c11109 100644 --- a/src/supermemory/requests/namespace_details_system.py +++ b/src/supermemory/requests/namespace_system.py @@ -6,7 +6,7 @@ from ..core.serialization import FieldMetadata -class NamespaceDetailsSystemParams(typing_extensions.TypedDict): +class NamespaceSystemParams(typing_extensions.TypedDict): """ Namespace lifecycle timestamps """ @@ -18,5 +18,5 @@ class NamespaceDetailsSystemParams(typing_extensions.TypedDict): updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] """ - ISO 8601 timestamp of the latest settings update + ISO 8601 timestamp of the latest namespace update """ diff --git a/src/supermemory/requests/search_request_include.py b/src/supermemory/requests/search_include.py similarity index 90% rename from src/supermemory/requests/search_request_include.py rename to src/supermemory/requests/search_include.py index 2d1b5ea..cb77128 100644 --- a/src/supermemory/requests/search_request_include.py +++ b/src/supermemory/requests/search_include.py @@ -3,7 +3,7 @@ import typing_extensions -class SearchRequestIncludeParams(typing_extensions.TypedDict): +class SearchIncludeParams(typing_extensions.TypedDict): """ Optional context to include alongside each matching result """ diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index 1ce6057..397db6f 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -6,8 +6,6 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .add_request_dreaming import AddRequestDreaming - from .add_request_task_type import AddRequestTaskType from .bad_request_error_body import BadRequestErrorBody from .batch_add_item_result import BatchAddItemResult from .batch_add_item_result_status import BatchAddItemResultStatus @@ -20,10 +18,13 @@ from .connector_config_value import ConnectorConfigValue from .connector_deleted import ConnectorDeleted from .connector_error_code import ConnectorErrorCode - from .connector_last_sync import ConnectorLastSync + from .connector_include import ConnectorInclude + from .connector_link import ConnectorLink from .connector_list import ConnectorList - from .connector_picker import ConnectorPicker from .connector_provider import ConnectorProvider + from .connector_run import ConnectorRun + from .connector_run_status import ConnectorRunStatus + from .connector_run_system import ConnectorRunSystem from .connector_selection import ConnectorSelection from .connector_selection_item import ConnectorSelectionItem from .connector_setup import ( @@ -50,11 +51,13 @@ from .connector_sync import ConnectorSync from .connector_sync_failure import ConnectorSyncFailure from .connector_sync_started import ConnectorSyncStarted - from .connector_sync_status import ConnectorSyncStatus + from .connector_sync_system import ConnectorSyncSystem from .connector_sync_trigger import ConnectorSyncTrigger + from .connector_system import ConnectorSystem from .delete_document_error import DeleteDocumentError from .delete_documents_result import DeleteDocumentsResult from .document import Document + from .document_include import DocumentInclude from .document_input import DocumentInput from .document_list_item import DocumentListItem from .document_list_item_system import DocumentListItemSystem @@ -62,7 +65,9 @@ from .document_ref_status import DocumentRefStatus from .document_system import DocumentSystem from .document_system_status import DocumentSystemStatus + from .dreaming_mode import DreamingMode from .error_response import ErrorResponse + from .file_type import FileType from .filter_and import FilterAnd from .filter_array_contains import FilterArrayContains from .filter_array_contains_operator import FilterArrayContainsOperator @@ -89,14 +94,34 @@ from .list_sort import ListSort from .list_type import ListType from .memory import Memory + from .memory_details import MemoryDetails + from .memory_include import MemoryInclude + from .memory_included import MemoryIncluded + from .memory_included_document import MemoryIncludedDocument + from .memory_included_document_system import MemoryIncludedDocumentSystem + from .memory_included_related import MemoryIncludedRelated + from .memory_included_related_children_item import MemoryIncludedRelatedChildrenItem + from .memory_included_related_children_item_document import MemoryIncludedRelatedChildrenItemDocument + from .memory_included_related_children_item_document_system import MemoryIncludedRelatedChildrenItemDocumentSystem + from .memory_included_related_children_item_system import MemoryIncludedRelatedChildrenItemSystem + from .memory_included_related_parents_item import MemoryIncludedRelatedParentsItem + from .memory_included_related_parents_item_document import MemoryIncludedRelatedParentsItemDocument + from .memory_included_related_parents_item_document_system import MemoryIncludedRelatedParentsItemDocumentSystem + from .memory_included_related_parents_item_system import MemoryIncludedRelatedParentsItemSystem + from .memory_included_related_siblings_item import MemoryIncludedRelatedSiblingsItem + from .memory_included_related_siblings_item_document import MemoryIncludedRelatedSiblingsItemDocument + from .memory_included_related_siblings_item_document_system import MemoryIncludedRelatedSiblingsItemDocumentSystem + from .memory_included_related_siblings_item_system import MemoryIncludedRelatedSiblingsItemSystem from .memory_relation import MemoryRelation from .memory_system import MemorySystem from .metadata_value import MetadataValue + from .namespace import Namespace from .namespace_deleted import NamespaceDeleted, NamespaceDeleted_Deleted, NamespaceDeleted_Queued from .namespace_deleted_deleted import NamespaceDeletedDeleted from .namespace_deleted_queued import NamespaceDeletedQueued from .namespace_details import NamespaceDetails - from .namespace_details_system import NamespaceDetailsSystem + from .namespace_list import NamespaceList + from .namespace_system import NamespaceSystem from .organization import Organization from .pagination import Pagination from .profile import Profile @@ -107,9 +132,9 @@ from .related_memory import RelatedMemory from .related_memory_system import RelatedMemorySystem from .s3config import S3Config - from .search_request_include import SearchRequestInclude + from .search_include import SearchInclude + from .search_mode import SearchMode from .search_request_rerank import SearchRequestRerank - from .search_request_search_mode import SearchRequestSearchMode from .search_response import SearchResponse from .search_result import SearchResult from .search_result_included import SearchResultIncluded @@ -117,13 +142,12 @@ from .search_result_included_document_system import SearchResultIncludedDocumentSystem from .search_result_system import SearchResultSystem from .sort_order import SortOrder + from .task_type import TaskType from .validation_error_response import ValidationErrorResponse from .validation_error_response_error_item import ValidationErrorResponseErrorItem from .validation_error_response_error_item_path_item import ValidationErrorResponseErrorItemPathItem from .web_crawler_config import WebCrawlerConfig _dynamic_imports: typing.Dict[str, str] = { - "AddRequestDreaming": ".add_request_dreaming", - "AddRequestTaskType": ".add_request_task_type", "BadRequestErrorBody": ".bad_request_error_body", "BatchAddItemResult": ".batch_add_item_result", "BatchAddItemResultStatus": ".batch_add_item_result_status", @@ -136,10 +160,13 @@ "ConnectorConfigValue": ".connector_config_value", "ConnectorDeleted": ".connector_deleted", "ConnectorErrorCode": ".connector_error_code", - "ConnectorLastSync": ".connector_last_sync", + "ConnectorInclude": ".connector_include", + "ConnectorLink": ".connector_link", "ConnectorList": ".connector_list", - "ConnectorPicker": ".connector_picker", "ConnectorProvider": ".connector_provider", + "ConnectorRun": ".connector_run", + "ConnectorRunStatus": ".connector_run_status", + "ConnectorRunSystem": ".connector_run_system", "ConnectorSelection": ".connector_selection", "ConnectorSelectionItem": ".connector_selection_item", "ConnectorSetup": ".connector_setup", @@ -164,11 +191,13 @@ "ConnectorSync": ".connector_sync", "ConnectorSyncFailure": ".connector_sync_failure", "ConnectorSyncStarted": ".connector_sync_started", - "ConnectorSyncStatus": ".connector_sync_status", + "ConnectorSyncSystem": ".connector_sync_system", "ConnectorSyncTrigger": ".connector_sync_trigger", + "ConnectorSystem": ".connector_system", "DeleteDocumentError": ".delete_document_error", "DeleteDocumentsResult": ".delete_documents_result", "Document": ".document", + "DocumentInclude": ".document_include", "DocumentInput": ".document_input", "DocumentListItem": ".document_list_item", "DocumentListItemSystem": ".document_list_item_system", @@ -176,7 +205,9 @@ "DocumentRefStatus": ".document_ref_status", "DocumentSystem": ".document_system", "DocumentSystemStatus": ".document_system_status", + "DreamingMode": ".dreaming_mode", "ErrorResponse": ".error_response", + "FileType": ".file_type", "FilterAnd": ".filter_and", "FilterArrayContains": ".filter_array_contains", "FilterArrayContainsOperator": ".filter_array_contains_operator", @@ -203,16 +234,36 @@ "ListSort": ".list_sort", "ListType": ".list_type", "Memory": ".memory", + "MemoryDetails": ".memory_details", + "MemoryInclude": ".memory_include", + "MemoryIncluded": ".memory_included", + "MemoryIncludedDocument": ".memory_included_document", + "MemoryIncludedDocumentSystem": ".memory_included_document_system", + "MemoryIncludedRelated": ".memory_included_related", + "MemoryIncludedRelatedChildrenItem": ".memory_included_related_children_item", + "MemoryIncludedRelatedChildrenItemDocument": ".memory_included_related_children_item_document", + "MemoryIncludedRelatedChildrenItemDocumentSystem": ".memory_included_related_children_item_document_system", + "MemoryIncludedRelatedChildrenItemSystem": ".memory_included_related_children_item_system", + "MemoryIncludedRelatedParentsItem": ".memory_included_related_parents_item", + "MemoryIncludedRelatedParentsItemDocument": ".memory_included_related_parents_item_document", + "MemoryIncludedRelatedParentsItemDocumentSystem": ".memory_included_related_parents_item_document_system", + "MemoryIncludedRelatedParentsItemSystem": ".memory_included_related_parents_item_system", + "MemoryIncludedRelatedSiblingsItem": ".memory_included_related_siblings_item", + "MemoryIncludedRelatedSiblingsItemDocument": ".memory_included_related_siblings_item_document", + "MemoryIncludedRelatedSiblingsItemDocumentSystem": ".memory_included_related_siblings_item_document_system", + "MemoryIncludedRelatedSiblingsItemSystem": ".memory_included_related_siblings_item_system", "MemoryRelation": ".memory_relation", "MemorySystem": ".memory_system", "MetadataValue": ".metadata_value", + "Namespace": ".namespace", "NamespaceDeleted": ".namespace_deleted", "NamespaceDeletedDeleted": ".namespace_deleted_deleted", "NamespaceDeletedQueued": ".namespace_deleted_queued", "NamespaceDeleted_Deleted": ".namespace_deleted", "NamespaceDeleted_Queued": ".namespace_deleted", "NamespaceDetails": ".namespace_details", - "NamespaceDetailsSystem": ".namespace_details_system", + "NamespaceList": ".namespace_list", + "NamespaceSystem": ".namespace_system", "Organization": ".organization", "Pagination": ".pagination", "Profile": ".profile", @@ -223,9 +274,9 @@ "RelatedMemory": ".related_memory", "RelatedMemorySystem": ".related_memory_system", "S3Config": ".s3config", - "SearchRequestInclude": ".search_request_include", + "SearchInclude": ".search_include", + "SearchMode": ".search_mode", "SearchRequestRerank": ".search_request_rerank", - "SearchRequestSearchMode": ".search_request_search_mode", "SearchResponse": ".search_response", "SearchResult": ".search_result", "SearchResultIncluded": ".search_result_included", @@ -233,6 +284,7 @@ "SearchResultIncludedDocumentSystem": ".search_result_included_document_system", "SearchResultSystem": ".search_result_system", "SortOrder": ".sort_order", + "TaskType": ".task_type", "ValidationErrorResponse": ".validation_error_response", "ValidationErrorResponseErrorItem": ".validation_error_response_error_item", "ValidationErrorResponseErrorItemPathItem": ".validation_error_response_error_item_path_item", @@ -262,8 +314,6 @@ def __dir__(): __all__ = [ - "AddRequestDreaming", - "AddRequestTaskType", "BadRequestErrorBody", "BatchAddItemResult", "BatchAddItemResultStatus", @@ -276,10 +326,13 @@ def __dir__(): "ConnectorConfigValue", "ConnectorDeleted", "ConnectorErrorCode", - "ConnectorLastSync", + "ConnectorInclude", + "ConnectorLink", "ConnectorList", - "ConnectorPicker", "ConnectorProvider", + "ConnectorRun", + "ConnectorRunStatus", + "ConnectorRunSystem", "ConnectorSelection", "ConnectorSelectionItem", "ConnectorSetup", @@ -304,11 +357,13 @@ def __dir__(): "ConnectorSync", "ConnectorSyncFailure", "ConnectorSyncStarted", - "ConnectorSyncStatus", + "ConnectorSyncSystem", "ConnectorSyncTrigger", + "ConnectorSystem", "DeleteDocumentError", "DeleteDocumentsResult", "Document", + "DocumentInclude", "DocumentInput", "DocumentListItem", "DocumentListItemSystem", @@ -316,7 +371,9 @@ def __dir__(): "DocumentRefStatus", "DocumentSystem", "DocumentSystemStatus", + "DreamingMode", "ErrorResponse", + "FileType", "FilterAnd", "FilterArrayContains", "FilterArrayContainsOperator", @@ -343,16 +400,36 @@ def __dir__(): "ListSort", "ListType", "Memory", + "MemoryDetails", + "MemoryInclude", + "MemoryIncluded", + "MemoryIncludedDocument", + "MemoryIncludedDocumentSystem", + "MemoryIncludedRelated", + "MemoryIncludedRelatedChildrenItem", + "MemoryIncludedRelatedChildrenItemDocument", + "MemoryIncludedRelatedChildrenItemDocumentSystem", + "MemoryIncludedRelatedChildrenItemSystem", + "MemoryIncludedRelatedParentsItem", + "MemoryIncludedRelatedParentsItemDocument", + "MemoryIncludedRelatedParentsItemDocumentSystem", + "MemoryIncludedRelatedParentsItemSystem", + "MemoryIncludedRelatedSiblingsItem", + "MemoryIncludedRelatedSiblingsItemDocument", + "MemoryIncludedRelatedSiblingsItemDocumentSystem", + "MemoryIncludedRelatedSiblingsItemSystem", "MemoryRelation", "MemorySystem", "MetadataValue", + "Namespace", "NamespaceDeleted", "NamespaceDeletedDeleted", "NamespaceDeletedQueued", "NamespaceDeleted_Deleted", "NamespaceDeleted_Queued", "NamespaceDetails", - "NamespaceDetailsSystem", + "NamespaceList", + "NamespaceSystem", "Organization", "Pagination", "Profile", @@ -363,9 +440,9 @@ def __dir__(): "RelatedMemory", "RelatedMemorySystem", "S3Config", - "SearchRequestInclude", + "SearchInclude", + "SearchMode", "SearchRequestRerank", - "SearchRequestSearchMode", "SearchResponse", "SearchResult", "SearchResultIncluded", @@ -373,6 +450,7 @@ def __dir__(): "SearchResultIncludedDocumentSystem", "SearchResultSystem", "SortOrder", + "TaskType", "ValidationErrorResponse", "ValidationErrorResponseErrorItem", "ValidationErrorResponseErrorItemPathItem", diff --git a/src/supermemory/types/add_request_dreaming.py b/src/supermemory/types/add_request_dreaming.py deleted file mode 100644 index e06c64b..0000000 --- a/src/supermemory/types/add_request_dreaming.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AddRequestDreaming = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/types/add_request_task_type.py b/src/supermemory/types/add_request_task_type.py deleted file mode 100644 index 7ac045a..0000000 --- a/src/supermemory/types/add_request_task_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AddRequestTaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] diff --git a/src/supermemory/types/connector.py b/src/supermemory/types/connector.py index b6460c4..09f3407 100644 --- a/src/supermemory/types/connector.py +++ b/src/supermemory/types/connector.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic @@ -10,12 +9,12 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .connector_capabilities import ConnectorCapabilities from .connector_config_value import ConnectorConfigValue -from .connector_last_sync import ConnectorLastSync -from .connector_picker import ConnectorPicker +from .connector_link import ConnectorLink from .connector_provider import ConnectorProvider +from .connector_run import ConnectorRun from .connector_selection_item import ConnectorSelectionItem -from .connector_status import ConnectorStatus from .connector_sync import ConnectorSync +from .connector_system import ConnectorSystem class Connector(UncheckedBaseModel): @@ -25,30 +24,9 @@ class Connector(UncheckedBaseModel): External source """ - status: ConnectorStatus = pydantic.Field() + authorization: typing.Optional[ConnectorLink] = pydantic.Field(default=None) """ - pending_authorization until the user finishes the provider login at authUrl; DELETE cancels it. Pending connectors are not listed. - """ - - auth_url: typing_extensions.Annotated[ - typing.Optional[str], - FieldMetadata(alias="authUrl"), - pydantic.Field( - alias="authUrl", - description="Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize", - ), - ] = None - """ - Present while pending, when the caller can create connectors in this namespace: where to send the user to authorize - """ - - auth_url_expires_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], - FieldMetadata(alias="authUrlExpiresAt"), - pydantic.Field(alias="authUrlExpiresAt", description="Present while pending: when authUrl stops working"), - ] = None - """ - Present while pending: when authUrl stops working + Present while pending, when the caller can create connectors in this namespace """ namespace: typing.Optional[str] = pydantic.Field(default=None) @@ -80,33 +58,28 @@ class Connector(UncheckedBaseModel): document_count: typing_extensions.Annotated[ float, FieldMetadata(alias="documentCount"), pydantic.Field(alias="documentCount") ] - last_sync: typing_extensions.Annotated[ - typing.Optional[ConnectorLastSync], - FieldMetadata(alias="lastSync"), - pydantic.Field(alias="lastSync", description="Most recent sync run"), + latest_run: typing_extensions.Annotated[ + typing.Optional[ConnectorRun], + FieldMetadata(alias="latestRun"), + pydantic.Field( + alias="latestRun", description="The most recent sync run, which may still be running or may have failed" + ), ] = None """ - Most recent sync run + The most recent sync run, which may still be running or may have failed """ - last_synced_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], - FieldMetadata(alias="lastSyncedAt"), - pydantic.Field(alias="lastSyncedAt", description="When content last finished syncing"), - ] = None + system: ConnectorSystem = pydantic.Field() """ - When content last finished syncing + Lifecycle status and timestamps maintained by Supermemory """ - created_at: typing_extensions.Annotated[ - dt.datetime, FieldMetadata(alias="createdAt"), pydantic.Field(alias="createdAt") - ] syncs: typing.Optional[typing.List[ConnectorSync]] = pydantic.Field(default=None) """ Present when include=syncs """ - picker: typing.Optional[ConnectorPicker] = pydantic.Field(default=None) + picker: typing.Optional[ConnectorLink] = pydantic.Field(default=None) """ Present when include=picker. Null for connectors that sync everything. """ diff --git a/src/supermemory/types/connector_include.py b/src/supermemory/types/connector_include.py new file mode 100644 index 0000000..37a9695 --- /dev/null +++ b/src/supermemory/types/connector_include.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConnectorInclude = typing.Union[typing.Literal["syncs", "picker"], typing.Any] diff --git a/src/supermemory/types/connector_picker.py b/src/supermemory/types/connector_link.py similarity index 95% rename from src/supermemory/types/connector_picker.py rename to src/supermemory/types/connector_link.py index eabee7d..629b7ed 100644 --- a/src/supermemory/types/connector_picker.py +++ b/src/supermemory/types/connector_link.py @@ -10,7 +10,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class ConnectorPicker(UncheckedBaseModel): +class ConnectorLink(UncheckedBaseModel): url: str = pydantic.Field() """ Send the user here to choose what syncs. Works once, in any browser. diff --git a/src/supermemory/types/connector_last_sync.py b/src/supermemory/types/connector_run.py similarity index 66% rename from src/supermemory/types/connector_last_sync.py rename to src/supermemory/types/connector_run.py index 677a86d..713f1ee 100644 --- a/src/supermemory/types/connector_last_sync.py +++ b/src/supermemory/types/connector_run.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic @@ -9,11 +8,10 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .connector_error_code import ConnectorErrorCode -from .connector_sync_status import ConnectorSyncStatus +from .connector_run_system import ConnectorRunSystem -class ConnectorLastSync(UncheckedBaseModel): - status: ConnectorSyncStatus +class ConnectorRun(UncheckedBaseModel): error_code: typing_extensions.Annotated[ typing.Optional[ConnectorErrorCode], FieldMetadata(alias="errorCode"), pydantic.Field(alias="errorCode") ] = None @@ -22,12 +20,10 @@ class ConnectorLastSync(UncheckedBaseModel): Customer-safe error message """ - started_at: typing_extensions.Annotated[ - dt.datetime, FieldMetadata(alias="startedAt"), pydantic.Field(alias="startedAt") - ] - completed_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], FieldMetadata(alias="completedAt"), pydantic.Field(alias="completedAt") - ] = None + system: ConnectorRunSystem = pydantic.Field() + """ + Run status and timestamps maintained by Supermemory + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/supermemory/types/connector_run_status.py b/src/supermemory/types/connector_run_status.py new file mode 100644 index 0000000..ea85722 --- /dev/null +++ b/src/supermemory/types/connector_run_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConnectorRunStatus = typing.Union[typing.Literal["running", "completed", "failed"], typing.Any] diff --git a/src/supermemory/types/connector_run_system.py b/src/supermemory/types/connector_run_system.py new file mode 100644 index 0000000..81ddfae --- /dev/null +++ b/src/supermemory/types/connector_run_system.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .connector_run_status import ConnectorRunStatus + + +class ConnectorRunSystem(UncheckedBaseModel): + """ + Run status and timestamps maintained by Supermemory + """ + + status: ConnectorRunStatus + started_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="startedAt"), + pydantic.Field(alias="startedAt", description="ISO 8601 timestamp when the run started"), + ] + """ + ISO 8601 timestamp when the run started + """ + + completed_at: typing_extensions.Annotated[ + typing.Optional[dt.datetime], + FieldMetadata(alias="completedAt"), + pydantic.Field(alias="completedAt", description="ISO 8601 timestamp when the run ended; null while running"), + ] = None + """ + ISO 8601 timestamp when the run ended; null while running + """ + + 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/types/connector_setup_result.py b/src/supermemory/types/connector_setup_result.py index 3223089..901fff9 100644 --- a/src/supermemory/types/connector_setup_result.py +++ b/src/supermemory/types/connector_setup_result.py @@ -1,13 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .connector_link import ConnectorLink class ConnectorSetupResult(UncheckedBaseModel): @@ -16,25 +14,9 @@ class ConnectorSetupResult(UncheckedBaseModel): Connector identifier """ - auth_url: typing_extensions.Annotated[ - typing.Optional[str], - FieldMetadata(alias="authUrl"), - pydantic.Field( - alias="authUrl", - description="Send the user here to authorize the provider. Null for providers that authenticate with config only.", - ), - ] = None + authorization: typing.Optional[ConnectorLink] = pydantic.Field(default=None) """ - Send the user here to authorize the provider. Null for providers that authenticate with config only. - """ - - auth_url_expires_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], - FieldMetadata(alias="authUrlExpiresAt"), - pydantic.Field(alias="authUrlExpiresAt", description="When authUrl stops working"), - ] = None - """ - When authUrl stops working + Null for providers that authenticate with config only """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/connector_sync.py b/src/supermemory/types/connector_sync.py index 8a069cc..d038853 100644 --- a/src/supermemory/types/connector_sync.py +++ b/src/supermemory/types/connector_sync.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic @@ -10,12 +9,11 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .connector_error_code import ConnectorErrorCode from .connector_sync_failure import ConnectorSyncFailure -from .connector_sync_status import ConnectorSyncStatus +from .connector_sync_system import ConnectorSyncSystem from .connector_sync_trigger import ConnectorSyncTrigger class ConnectorSync(UncheckedBaseModel): - status: ConnectorSyncStatus error_code: typing_extensions.Annotated[ typing.Optional[ConnectorErrorCode], FieldMetadata(alias="errorCode"), pydantic.Field(alias="errorCode") ] = None @@ -24,12 +22,11 @@ class ConnectorSync(UncheckedBaseModel): Customer-safe error message """ - started_at: typing_extensions.Annotated[ - dt.datetime, FieldMetadata(alias="startedAt"), pydantic.Field(alias="startedAt") - ] - completed_at: typing_extensions.Annotated[ - typing.Optional[dt.datetime], FieldMetadata(alias="completedAt"), pydantic.Field(alias="completedAt") - ] = None + system: ConnectorSyncSystem = pydantic.Field() + """ + Run status and timestamps maintained by Supermemory + """ + id: str trigger: ConnectorSyncTrigger items_processed: typing_extensions.Annotated[ diff --git a/src/supermemory/types/connector_sync_status.py b/src/supermemory/types/connector_sync_status.py deleted file mode 100644 index 20e4882..0000000 --- a/src/supermemory/types/connector_sync_status.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ConnectorSyncStatus = typing.Union[typing.Literal["running", "completed", "failed"], typing.Any] diff --git a/src/supermemory/types/connector_sync_system.py b/src/supermemory/types/connector_sync_system.py new file mode 100644 index 0000000..d063319 --- /dev/null +++ b/src/supermemory/types/connector_sync_system.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .connector_run_status import ConnectorRunStatus + + +class ConnectorSyncSystem(UncheckedBaseModel): + """ + Run status and timestamps maintained by Supermemory + """ + + status: ConnectorRunStatus + started_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="startedAt"), + pydantic.Field(alias="startedAt", description="ISO 8601 timestamp when the run started"), + ] + """ + ISO 8601 timestamp when the run started + """ + + completed_at: typing_extensions.Annotated[ + typing.Optional[dt.datetime], + FieldMetadata(alias="completedAt"), + pydantic.Field(alias="completedAt", description="ISO 8601 timestamp when the run ended; null while running"), + ] = None + """ + ISO 8601 timestamp when the run ended; null while running + """ + + 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/types/connector_system.py b/src/supermemory/types/connector_system.py new file mode 100644 index 0000000..8986fda --- /dev/null +++ b/src/supermemory/types/connector_system.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .connector_status import ConnectorStatus + + +class ConnectorSystem(UncheckedBaseModel): + """ + Lifecycle status and timestamps maintained by Supermemory + """ + + status: ConnectorStatus = pydantic.Field() + """ + pending_authorization until the user finishes the provider login at authorization.url; DELETE cancels it. Pending connectors are not listed. + """ + + created_at: typing_extensions.Annotated[ + dt.datetime, + FieldMetadata(alias="createdAt"), + pydantic.Field(alias="createdAt", description="ISO 8601 timestamp when the connector was created"), + ] + """ + ISO 8601 timestamp when the connector was created + """ + + last_successful_sync_at: typing_extensions.Annotated[ + typing.Optional[dt.datetime], + FieldMetadata(alias="lastSuccessfulSyncAt"), + pydantic.Field( + alias="lastSuccessfulSyncAt", + description="ISO 8601 timestamp when content last finished syncing successfully", + ), + ] = None + """ + ISO 8601 timestamp when content last finished syncing successfully + """ + + 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/types/document_include.py b/src/supermemory/types/document_include.py new file mode 100644 index 0000000..f02642c --- /dev/null +++ b/src/supermemory/types/document_include.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocumentInclude = typing.Union[typing.Literal["chunks", "memories"], typing.Any] diff --git a/src/supermemory/types/dreaming_mode.py b/src/supermemory/types/dreaming_mode.py new file mode 100644 index 0000000..c591aba --- /dev/null +++ b/src/supermemory/types/dreaming_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DreamingMode = typing.Union[typing.Literal["dynamic", "instant"], typing.Any] diff --git a/src/supermemory/types/file_type.py b/src/supermemory/types/file_type.py new file mode 100644 index 0000000..4decdf6 --- /dev/null +++ b/src/supermemory/types/file_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FileType = typing.Union[typing.Literal["text", "pdf", "image", "video", "audio"], typing.Any] diff --git a/src/supermemory/memories/types/get_memories_response.py b/src/supermemory/types/memory_details.py similarity index 84% rename from src/supermemory/memories/types/get_memories_response.py rename to src/supermemory/types/memory_details.py index de7341e..ea16057 100644 --- a/src/supermemory/memories/types/get_memories_response.py +++ b/src/supermemory/types/memory_details.py @@ -4,14 +4,14 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel -from ...types.memory_system import MemorySystem -from .get_memories_response_included import GetMemoriesResponseIncluded +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included import MemoryIncluded +from .memory_system import MemorySystem -class GetMemoriesResponse(UncheckedBaseModel): +class MemoryDetails(UncheckedBaseModel): id: str = pydantic.Field() """ Stable memory identifier @@ -75,7 +75,7 @@ class GetMemoriesResponse(UncheckedBaseModel): Lifecycle timestamps maintained by Supermemory """ - included: typing.Optional[GetMemoriesResponseIncluded] = pydantic.Field(default=None) + included: typing.Optional[MemoryIncluded] = pydantic.Field(default=None) """ Requested extras """ diff --git a/src/supermemory/types/memory_include.py b/src/supermemory/types/memory_include.py new file mode 100644 index 0000000..7b23058 --- /dev/null +++ b/src/supermemory/types/memory_include.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +MemoryInclude = typing.Union[typing.Literal["related", "documents"], typing.Any] diff --git a/src/supermemory/memories/types/get_memories_response_included.py b/src/supermemory/types/memory_included.py similarity index 51% rename from src/supermemory/memories/types/get_memories_response_included.py rename to src/supermemory/types/memory_included.py index 2d96d61..28e29ea 100644 --- a/src/supermemory/memories/types/get_memories_response_included.py +++ b/src/supermemory/types/memory_included.py @@ -3,23 +3,23 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from .get_memories_response_included_document import GetMemoriesResponseIncludedDocument -from .get_memories_response_included_related import GetMemoriesResponseIncludedRelated +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_document import MemoryIncludedDocument +from .memory_included_related import MemoryIncludedRelated -class GetMemoriesResponseIncluded(UncheckedBaseModel): +class MemoryIncluded(UncheckedBaseModel): """ Requested extras """ - related: typing.Optional[GetMemoriesResponseIncludedRelated] = pydantic.Field(default=None) + related: typing.Optional[MemoryIncludedRelated] = pydantic.Field(default=None) """ Present when include has related """ - document: typing.Optional[GetMemoriesResponseIncludedDocument] = pydantic.Field(default=None) + document: typing.Optional[MemoryIncludedDocument] = pydantic.Field(default=None) """ Source document; present when include has documents and one exists """ diff --git a/src/supermemory/memories/types/get_memories_response_included_document.py b/src/supermemory/types/memory_included_document.py similarity index 75% rename from src/supermemory/memories/types/get_memories_response_included_document.py rename to src/supermemory/types/memory_included_document.py index 5164273..1dc9b0b 100644 --- a/src/supermemory/memories/types/get_memories_response_included_document.py +++ b/src/supermemory/types/memory_included_document.py @@ -3,12 +3,12 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from .get_memories_response_included_document_system import GetMemoriesResponseIncludedDocumentSystem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_document_system import MemoryIncludedDocumentSystem -class GetMemoriesResponseIncludedDocument(UncheckedBaseModel): +class MemoryIncludedDocument(UncheckedBaseModel): """ Source document; present when include has documents and one exists """ @@ -38,7 +38,7 @@ class GetMemoriesResponseIncludedDocument(UncheckedBaseModel): Generated summary of the source document """ - system: GetMemoriesResponseIncludedDocumentSystem = pydantic.Field() + system: MemoryIncludedDocumentSystem = pydantic.Field() """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_document_system.py b/src/supermemory/types/memory_included_document_system.py similarity index 82% rename from src/supermemory/memories/types/get_memories_response_included_document_system.py rename to src/supermemory/types/memory_included_document_system.py index c3a1c04..6f14e85 100644 --- a/src/supermemory/memories/types/get_memories_response_included_document_system.py +++ b/src/supermemory/types/memory_included_document_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedDocumentSystem(UncheckedBaseModel): +class MemoryIncludedDocumentSystem(UncheckedBaseModel): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/types/memory_included_related.py b/src/supermemory/types/memory_included_related.py new file mode 100644 index 0000000..ad9a01c --- /dev/null +++ b/src/supermemory/types/memory_included_related.py @@ -0,0 +1,40 @@ +# 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 +from .memory_included_related_children_item import MemoryIncludedRelatedChildrenItem +from .memory_included_related_parents_item import MemoryIncludedRelatedParentsItem +from .memory_included_related_siblings_item import MemoryIncludedRelatedSiblingsItem + + +class MemoryIncludedRelated(UncheckedBaseModel): + """ + Present when include has related + """ + + parents: typing.List[MemoryIncludedRelatedParentsItem] = pydantic.Field() + """ + Earlier versions this memory updates, nearest first + """ + + children: typing.List[MemoryIncludedRelatedChildrenItem] = pydantic.Field() + """ + Newer versions that update this memory, nearest first + """ + + siblings: typing.List[MemoryIncludedRelatedSiblingsItem] = pydantic.Field() + """ + Memories connected by extends or derives, nearest first + """ + + 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/types/get_memories_response_included_related_parents_item.py b/src/supermemory/types/memory_included_related_children_item.py similarity index 60% rename from src/supermemory/memories/types/get_memories_response_included_related_parents_item.py rename to src/supermemory/types/memory_included_related_children_item.py index 2a5d62c..58c32e6 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_parents_item.py +++ b/src/supermemory/types/memory_included_related_children_item.py @@ -3,18 +3,14 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_parents_item_document import ( - GetMemoriesResponseIncludedRelatedParentsItemDocument, -) -from .get_memories_response_included_related_parents_item_system import ( - GetMemoriesResponseIncludedRelatedParentsItemSystem, -) - - -class GetMemoriesResponseIncludedRelatedParentsItem(UncheckedBaseModel): +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_children_item_document import MemoryIncludedRelatedChildrenItemDocument +from .memory_included_related_children_item_system import MemoryIncludedRelatedChildrenItemSystem +from .memory_relation import MemoryRelation + + +class MemoryIncludedRelatedChildrenItem(UncheckedBaseModel): id: str = pydantic.Field() """ Related memory ID @@ -40,12 +36,12 @@ class GetMemoriesResponseIncludedRelatedParentsItem(UncheckedBaseModel): Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedParentsItemSystem = pydantic.Field() + system: MemoryIncludedRelatedChildrenItemSystem = pydantic.Field() """ Lifecycle details for the related memory """ - document: typing.Optional[GetMemoriesResponseIncludedRelatedParentsItemDocument] = pydantic.Field(default=None) + document: typing.Optional[MemoryIncludedRelatedChildrenItemDocument] = pydantic.Field(default=None) """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py b/src/supermemory/types/memory_included_related_children_item_document.py similarity index 71% rename from src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py rename to src/supermemory/types/memory_included_related_children_item_document.py index c85f362..31d0c40 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document.py +++ b/src/supermemory/types/memory_included_related_children_item_document.py @@ -3,14 +3,12 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from .get_memories_response_included_related_parents_item_document_system import ( - GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem, -) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_children_item_document_system import MemoryIncludedRelatedChildrenItemDocumentSystem -class GetMemoriesResponseIncludedRelatedParentsItemDocument(UncheckedBaseModel): +class MemoryIncludedRelatedChildrenItemDocument(UncheckedBaseModel): """ Source document; present when include has both related and documents """ @@ -40,7 +38,7 @@ class GetMemoriesResponseIncludedRelatedParentsItemDocument(UncheckedBaseModel): Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem = pydantic.Field() + system: MemoryIncludedRelatedChildrenItemDocumentSystem = pydantic.Field() """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py b/src/supermemory/types/memory_included_related_children_item_document_system.py similarity index 81% rename from src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py rename to src/supermemory/types/memory_included_related_children_item_document_system.py index 5574bb9..caae241 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_document_system.py +++ b/src/supermemory/types/memory_included_related_children_item_document_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedParentsItemDocumentSystem(UncheckedBaseModel): +class MemoryIncludedRelatedChildrenItemDocumentSystem(UncheckedBaseModel): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py b/src/supermemory/types/memory_included_related_children_item_system.py similarity index 76% rename from src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py rename to src/supermemory/types/memory_included_related_children_item_system.py index 3ec820b..f2d6400 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_parents_item_system.py +++ b/src/supermemory/types/memory_included_related_children_item_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedParentsItemSystem(UncheckedBaseModel): +class MemoryIncludedRelatedChildrenItemSystem(UncheckedBaseModel): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_children_item.py b/src/supermemory/types/memory_included_related_parents_item.py similarity index 60% rename from src/supermemory/memories/types/get_memories_response_included_related_children_item.py rename to src/supermemory/types/memory_included_related_parents_item.py index 22af6fd..ef6beb3 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_children_item.py +++ b/src/supermemory/types/memory_included_related_parents_item.py @@ -3,18 +3,14 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_children_item_document import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocument, -) -from .get_memories_response_included_related_children_item_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemSystem, -) - - -class GetMemoriesResponseIncludedRelatedChildrenItem(UncheckedBaseModel): +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_parents_item_document import MemoryIncludedRelatedParentsItemDocument +from .memory_included_related_parents_item_system import MemoryIncludedRelatedParentsItemSystem +from .memory_relation import MemoryRelation + + +class MemoryIncludedRelatedParentsItem(UncheckedBaseModel): id: str = pydantic.Field() """ Related memory ID @@ -40,12 +36,12 @@ class GetMemoriesResponseIncludedRelatedChildrenItem(UncheckedBaseModel): Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedChildrenItemSystem = pydantic.Field() + system: MemoryIncludedRelatedParentsItemSystem = pydantic.Field() """ Lifecycle details for the related memory """ - document: typing.Optional[GetMemoriesResponseIncludedRelatedChildrenItemDocument] = pydantic.Field(default=None) + document: typing.Optional[MemoryIncludedRelatedParentsItemDocument] = pydantic.Field(default=None) """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py b/src/supermemory/types/memory_included_related_parents_item_document.py similarity index 71% rename from src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py rename to src/supermemory/types/memory_included_related_parents_item_document.py index 068de0b..02065c0 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_children_item_document.py +++ b/src/supermemory/types/memory_included_related_parents_item_document.py @@ -3,14 +3,12 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from .get_memories_response_included_related_children_item_document_system import ( - GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem, -) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_parents_item_document_system import MemoryIncludedRelatedParentsItemDocumentSystem -class GetMemoriesResponseIncludedRelatedChildrenItemDocument(UncheckedBaseModel): +class MemoryIncludedRelatedParentsItemDocument(UncheckedBaseModel): """ Source document; present when include has both related and documents """ @@ -40,7 +38,7 @@ class GetMemoriesResponseIncludedRelatedChildrenItemDocument(UncheckedBaseModel) Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem = pydantic.Field() + system: MemoryIncludedRelatedParentsItemDocumentSystem = pydantic.Field() """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py b/src/supermemory/types/memory_included_related_parents_item_document_system.py similarity index 81% rename from src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py rename to src/supermemory/types/memory_included_related_parents_item_document_system.py index 1650e37..05bd17b 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document_system.py +++ b/src/supermemory/types/memory_included_related_parents_item_document_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem(UncheckedBaseModel): +class MemoryIncludedRelatedParentsItemDocumentSystem(UncheckedBaseModel): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py b/src/supermemory/types/memory_included_related_parents_item_system.py similarity index 76% rename from src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py rename to src/supermemory/types/memory_included_related_parents_item_system.py index 7eabdf6..c9bbb1a 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_system.py +++ b/src/supermemory/types/memory_included_related_parents_item_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedSiblingsItemSystem(UncheckedBaseModel): +class MemoryIncludedRelatedParentsItemSystem(UncheckedBaseModel): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py b/src/supermemory/types/memory_included_related_siblings_item.py similarity index 60% rename from src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py rename to src/supermemory/types/memory_included_related_siblings_item.py index 1e27021..fbaa9c0 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item.py +++ b/src/supermemory/types/memory_included_related_siblings_item.py @@ -3,18 +3,14 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from ...types.memory_relation import MemoryRelation -from .get_memories_response_included_related_siblings_item_document import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocument, -) -from .get_memories_response_included_related_siblings_item_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemSystem, -) - - -class GetMemoriesResponseIncludedRelatedSiblingsItem(UncheckedBaseModel): +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_siblings_item_document import MemoryIncludedRelatedSiblingsItemDocument +from .memory_included_related_siblings_item_system import MemoryIncludedRelatedSiblingsItemSystem +from .memory_relation import MemoryRelation + + +class MemoryIncludedRelatedSiblingsItem(UncheckedBaseModel): id: str = pydantic.Field() """ Related memory ID @@ -40,12 +36,12 @@ class GetMemoriesResponseIncludedRelatedSiblingsItem(UncheckedBaseModel): Public metadata associated with the related memory """ - system: GetMemoriesResponseIncludedRelatedSiblingsItemSystem = pydantic.Field() + system: MemoryIncludedRelatedSiblingsItemSystem = pydantic.Field() """ Lifecycle details for the related memory """ - document: typing.Optional[GetMemoriesResponseIncludedRelatedSiblingsItemDocument] = pydantic.Field(default=None) + document: typing.Optional[MemoryIncludedRelatedSiblingsItemDocument] = pydantic.Field(default=None) """ Source document; present when include has both related and documents """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py b/src/supermemory/types/memory_included_related_siblings_item_document.py similarity index 71% rename from src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py rename to src/supermemory/types/memory_included_related_siblings_item_document.py index 78d43f5..1070000 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_siblings_item_document.py +++ b/src/supermemory/types/memory_included_related_siblings_item_document.py @@ -3,14 +3,12 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from .get_memories_response_included_related_siblings_item_document_system import ( - GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem, -) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .memory_included_related_siblings_item_document_system import MemoryIncludedRelatedSiblingsItemDocumentSystem -class GetMemoriesResponseIncludedRelatedSiblingsItemDocument(UncheckedBaseModel): +class MemoryIncludedRelatedSiblingsItemDocument(UncheckedBaseModel): """ Source document; present when include has both related and documents """ @@ -40,7 +38,7 @@ class GetMemoriesResponseIncludedRelatedSiblingsItemDocument(UncheckedBaseModel) Generated summary of the source document """ - system: GetMemoriesResponseIncludedRelatedSiblingsItemDocumentSystem = pydantic.Field() + system: MemoryIncludedRelatedSiblingsItemDocumentSystem = pydantic.Field() """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py b/src/supermemory/types/memory_included_related_siblings_item_document_system.py similarity index 81% rename from src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py rename to src/supermemory/types/memory_included_related_siblings_item_document_system.py index f784385..751fca0 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_children_item_document_system.py +++ b/src/supermemory/types/memory_included_related_siblings_item_document_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedChildrenItemDocumentSystem(UncheckedBaseModel): +class MemoryIncludedRelatedSiblingsItemDocumentSystem(UncheckedBaseModel): """ Lifecycle timestamps maintained by Supermemory """ diff --git a/src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py b/src/supermemory/types/memory_included_related_siblings_item_system.py similarity index 76% rename from src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py rename to src/supermemory/types/memory_included_related_siblings_item_system.py index 18ecda1..63d1167 100644 --- a/src/supermemory/memories/types/get_memories_response_included_related_children_item_system.py +++ b/src/supermemory/types/memory_included_related_siblings_item_system.py @@ -4,12 +4,12 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel -class GetMemoriesResponseIncludedRelatedChildrenItemSystem(UncheckedBaseModel): +class MemoryIncludedRelatedSiblingsItemSystem(UncheckedBaseModel): """ Lifecycle details for the related memory """ diff --git a/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py b/src/supermemory/types/namespace.py similarity index 77% rename from src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py rename to src/supermemory/types/namespace.py index 2e094e2..d97b5ca 100644 --- a/src/supermemory/namespaces/types/list_namespaces_response_namespaces_item.py +++ b/src/supermemory/types/namespace.py @@ -4,13 +4,13 @@ import pydantic import typing_extensions -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.serialization import FieldMetadata -from ...core.unchecked_base_model import UncheckedBaseModel -from .list_namespaces_response_namespaces_item_system import ListNamespacesResponseNamespacesItemSystem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .namespace_system import NamespaceSystem -class ListNamespacesResponseNamespacesItem(UncheckedBaseModel): +class Namespace(UncheckedBaseModel): id: str = pydantic.Field() """ Internal identifier for the namespace @@ -44,7 +44,7 @@ class ListNamespacesResponseNamespacesItem(UncheckedBaseModel): Human-readable purpose or scope of the namespace """ - system: ListNamespacesResponseNamespacesItemSystem = pydantic.Field() + system: NamespaceSystem = pydantic.Field() """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/types/namespace_details.py b/src/supermemory/types/namespace_details.py index f072dd4..070eace 100644 --- a/src/supermemory/types/namespace_details.py +++ b/src/supermemory/types/namespace_details.py @@ -7,7 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .namespace_details_system import NamespaceDetailsSystem +from .namespace_system import NamespaceSystem class NamespaceDetails(UncheckedBaseModel): @@ -28,7 +28,7 @@ class NamespaceDetails(UncheckedBaseModel): Background that helps Supermemory interpret documents and form better memories in this namespace """ - system: NamespaceDetailsSystem = pydantic.Field() + system: NamespaceSystem = pydantic.Field() """ Namespace lifecycle timestamps """ diff --git a/src/supermemory/namespaces/types/list_namespaces_response.py b/src/supermemory/types/namespace_list.py similarity index 58% rename from src/supermemory/namespaces/types/list_namespaces_response.py rename to src/supermemory/types/namespace_list.py index 49ad06a..f37cc80 100644 --- a/src/supermemory/namespaces/types/list_namespaces_response.py +++ b/src/supermemory/types/namespace_list.py @@ -3,14 +3,14 @@ import typing import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...core.unchecked_base_model import UncheckedBaseModel -from ...types.pagination import Pagination -from .list_namespaces_response_namespaces_item import ListNamespacesResponseNamespacesItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .namespace import Namespace +from .pagination import Pagination -class ListNamespacesResponse(UncheckedBaseModel): - namespaces: typing.List[ListNamespacesResponseNamespacesItem] = pydantic.Field() +class NamespaceList(UncheckedBaseModel): + namespaces: typing.List[Namespace] = pydantic.Field() """ Namespaces on this page, newest first """ diff --git a/src/supermemory/types/namespace_details_system.py b/src/supermemory/types/namespace_system.py similarity index 88% rename from src/supermemory/types/namespace_details_system.py rename to src/supermemory/types/namespace_system.py index 0980099..6c1cf7a 100644 --- a/src/supermemory/types/namespace_details_system.py +++ b/src/supermemory/types/namespace_system.py @@ -10,7 +10,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class NamespaceDetailsSystem(UncheckedBaseModel): +class NamespaceSystem(UncheckedBaseModel): """ Namespace lifecycle timestamps """ @@ -27,10 +27,10 @@ class NamespaceDetailsSystem(UncheckedBaseModel): updated_at: typing_extensions.Annotated[ dt.datetime, FieldMetadata(alias="updatedAt"), - pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest settings update"), + pydantic.Field(alias="updatedAt", description="ISO 8601 timestamp of the latest namespace update"), ] """ - ISO 8601 timestamp of the latest settings update + ISO 8601 timestamp of the latest namespace update """ if IS_PYDANTIC_V2: diff --git a/src/supermemory/types/search_request_include.py b/src/supermemory/types/search_include.py similarity index 95% rename from src/supermemory/types/search_request_include.py rename to src/supermemory/types/search_include.py index 1d5e454..97a0c0e 100644 --- a/src/supermemory/types/search_request_include.py +++ b/src/supermemory/types/search_include.py @@ -7,7 +7,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class SearchRequestInclude(UncheckedBaseModel): +class SearchInclude(UncheckedBaseModel): """ Optional context to include alongside each matching result """ diff --git a/src/supermemory/types/search_mode.py b/src/supermemory/types/search_mode.py new file mode 100644 index 0000000..db609ce --- /dev/null +++ b/src/supermemory/types/search_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SearchMode = typing.Union[typing.Literal["hybrid", "memories", "chunks"], typing.Any] diff --git a/src/supermemory/types/search_request_search_mode.py b/src/supermemory/types/search_request_search_mode.py deleted file mode 100644 index c0a24b6..0000000 --- a/src/supermemory/types/search_request_search_mode.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SearchRequestSearchMode = typing.Union[typing.Literal["hybrid", "memories", "chunks"], typing.Any] diff --git a/src/supermemory/types/task_type.py b/src/supermemory/types/task_type.py new file mode 100644 index 0000000..4efaacc --- /dev/null +++ b/src/supermemory/types/task_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TaskType = typing.Union[typing.Literal["memory", "superrag"], typing.Any] From 17dc499f04d519e93906cdb0e3b5be14b4d2ceb9 Mon Sep 17 00:00:00 2001 From: Mahesh Sanikommu Date: Tue, 6 Oct 2026 00:59:39 -0700 Subject: [PATCH 3/3] release: 5.0.0rc3 Regenerated from the live spec after the v5 cleanup stack (mono#3410 to #3423) and the connector field alignment (mono#3413): include lists, body-only search and write options, paginated namespaces, count/status on deletes, memories.get, and connector authorization/system.status. rc2 was cut before these merged. --- pyproject.toml | 2 +- src/supermemory/core/client_wrapper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ba243b..51e27c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "5.0.0rc2" +version = "5.0.0rc3" description = "The official Python library for the Supermemory API" readme = "README.md" license = "Apache-2.0" diff --git a/src/supermemory/core/client_wrapper.py b/src/supermemory/core/client_wrapper.py index 4ed96e7..97a04cc 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.0rc2", + "User-Agent": "supermemory/5.0.0rc3", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",