From fd86dc5ee1a83000113c7dcc8ba678af94d825bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 03:09:31 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/resources/documents.py | 12 ++++++++++++ src/supermemory/resources/memories.py | 12 ++++++++++++ src/supermemory/types/document_upload_file_params.py | 7 +++++++ src/supermemory/types/memory_upload_file_params.py | 7 +++++++ tests/api_resources/test_documents.py | 2 ++ tests/api_resources/test_memories.py | 2 ++ 7 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2de19c18..b195b45e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-f35c8c3182ef17698350347936848877f3ed8a8af8fcfdc3471506309ff0b9ce.yml -openapi_spec_hash: f58c1f9350390517a31e0f241245adc3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-0606bdf6929173c39cecc0ce0da252d509a38fbc98e7b8ddd64bdee5812625b9.yml +openapi_spec_hash: c6c376e6d59b3c01e38559a2a74b075e config_hash: 5deef1e3a49e3a7816348fbf7ba259bf diff --git a/src/supermemory/resources/documents.py b/src/supermemory/resources/documents.py index ac9c4ad0..c63120a7 100644 --- a/src/supermemory/resources/documents.py +++ b/src/supermemory/resources/documents.py @@ -356,6 +356,7 @@ def upload_file( file: FileTypes, container_tags: str | Omit = omit, file_type: str | Omit = omit, + metadata: str | Omit = omit, mime_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -378,6 +379,10 @@ def upload_file( text, pdf, tweet, google_doc, google_slide, google_sheet, image, video, notion_doc, webpage, onedrive + metadata: Optional metadata for the document as a JSON string. This is used to store + additional information about the document. Keys must be strings and values can + be strings, numbers, or booleans. + mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm') @@ -394,6 +399,7 @@ def upload_file( "file": file, "container_tags": container_tags, "file_type": file_type, + "metadata": metadata, "mime_type": mime_type, } ) @@ -741,6 +747,7 @@ async def upload_file( file: FileTypes, container_tags: str | Omit = omit, file_type: str | Omit = omit, + metadata: str | Omit = omit, mime_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -763,6 +770,10 @@ async def upload_file( text, pdf, tweet, google_doc, google_slide, google_sheet, image, video, notion_doc, webpage, onedrive + metadata: Optional metadata for the document as a JSON string. This is used to store + additional information about the document. Keys must be strings and values can + be strings, numbers, or booleans. + mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm') @@ -779,6 +790,7 @@ async def upload_file( "file": file, "container_tags": container_tags, "file_type": file_type, + "metadata": metadata, "mime_type": mime_type, } ) diff --git a/src/supermemory/resources/memories.py b/src/supermemory/resources/memories.py index 36689baf..8a7cd5d2 100644 --- a/src/supermemory/resources/memories.py +++ b/src/supermemory/resources/memories.py @@ -356,6 +356,7 @@ def upload_file( file: FileTypes, container_tags: str | Omit = omit, file_type: str | Omit = omit, + metadata: str | Omit = omit, mime_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -378,6 +379,10 @@ def upload_file( text, pdf, tweet, google_doc, google_slide, google_sheet, image, video, notion_doc, webpage, onedrive + metadata: Optional metadata for the document as a JSON string. This is used to store + additional information about the document. Keys must be strings and values can + be strings, numbers, or booleans. + mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm') @@ -394,6 +399,7 @@ def upload_file( "file": file, "container_tags": container_tags, "file_type": file_type, + "metadata": metadata, "mime_type": mime_type, } ) @@ -741,6 +747,7 @@ async def upload_file( file: FileTypes, container_tags: str | Omit = omit, file_type: str | Omit = omit, + metadata: str | Omit = omit, mime_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -763,6 +770,10 @@ async def upload_file( text, pdf, tweet, google_doc, google_slide, google_sheet, image, video, notion_doc, webpage, onedrive + metadata: Optional metadata for the document as a JSON string. This is used to store + additional information about the document. Keys must be strings and values can + be strings, numbers, or booleans. + mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm') @@ -779,6 +790,7 @@ async def upload_file( "file": file, "container_tags": container_tags, "file_type": file_type, + "metadata": metadata, "mime_type": mime_type, } ) diff --git a/src/supermemory/types/document_upload_file_params.py b/src/supermemory/types/document_upload_file_params.py index 95c97d2d..f311bc69 100644 --- a/src/supermemory/types/document_upload_file_params.py +++ b/src/supermemory/types/document_upload_file_params.py @@ -28,6 +28,13 @@ class DocumentUploadFileParams(TypedDict, total=False): video, notion_doc, webpage, onedrive """ + metadata: str + """Optional metadata for the document as a JSON string. + + This is used to store additional information about the document. Keys must be + strings and values can be strings, numbers, or booleans. + """ + mime_type: Annotated[str, PropertyInfo(alias="mimeType")] """Required when fileType is 'image' or 'video'. diff --git a/src/supermemory/types/memory_upload_file_params.py b/src/supermemory/types/memory_upload_file_params.py index 6e8a07aa..d979f973 100644 --- a/src/supermemory/types/memory_upload_file_params.py +++ b/src/supermemory/types/memory_upload_file_params.py @@ -28,6 +28,13 @@ class MemoryUploadFileParams(TypedDict, total=False): video, notion_doc, webpage, onedrive """ + metadata: str + """Optional metadata for the document as a JSON string. + + This is used to store additional information about the document. Keys must be + strings and values can be strings, numbers, or booleans. + """ + mime_type: Annotated[str, PropertyInfo(alias="mimeType")] """Required when fileType is 'image' or 'video'. diff --git a/tests/api_resources/test_documents.py b/tests/api_resources/test_documents.py index c192d7e2..0e693e7a 100644 --- a/tests/api_resources/test_documents.py +++ b/tests/api_resources/test_documents.py @@ -300,6 +300,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None: file=b"raw file contents", container_tags='["user_123", "project_123"]', file_type="image", + metadata='{"category": "technology", "isPublic": true, "readingTime": 5}', mime_type="image/png", ) assert_matches_type(DocumentUploadFileResponse, document, path=["response"]) @@ -613,6 +614,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper file=b"raw file contents", container_tags='["user_123", "project_123"]', file_type="image", + metadata='{"category": "technology", "isPublic": true, "readingTime": 5}', mime_type="image/png", ) assert_matches_type(DocumentUploadFileResponse, document, path=["response"]) diff --git a/tests/api_resources/test_memories.py b/tests/api_resources/test_memories.py index 2effb9a2..9d7f3848 100644 --- a/tests/api_resources/test_memories.py +++ b/tests/api_resources/test_memories.py @@ -300,6 +300,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None: file=b"raw file contents", container_tags='["user_123", "project_123"]', file_type="image", + metadata='{"category": "technology", "isPublic": true, "readingTime": 5}', mime_type="image/png", ) assert_matches_type(MemoryUploadFileResponse, memory, path=["response"]) @@ -613,6 +614,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper file=b"raw file contents", container_tags='["user_123", "project_123"]', file_type="image", + metadata='{"category": "technology", "isPublic": true, "readingTime": 5}', mime_type="image/png", ) assert_matches_type(MemoryUploadFileResponse, memory, path=["response"]) From 6ca65f3baf1e14ddd3223518678ae93417479160 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 03:09:55 +0000 Subject: [PATCH 2/2] release: 3.3.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/supermemory/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1f73031b..ff1c7af5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.2.0" + ".": "3.3.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c9a48ef0..6d86b82c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.3.0 (2025-09-21) + +Full Changelog: [v3.2.0...v3.3.0](https://github.com/supermemoryai/python-sdk/compare/v3.2.0...v3.3.0) + +### Features + +* **api:** api update ([fd86dc5](https://github.com/supermemoryai/python-sdk/commit/fd86dc5ee1a83000113c7dcc8ba678af94d825bd)) + ## 3.2.0 (2025-09-21) Full Changelog: [v3.1.0...v3.2.0](https://github.com/supermemoryai/python-sdk/compare/v3.1.0...v3.2.0) diff --git a/pyproject.toml b/pyproject.toml index 4123ee2f..8819108b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.2.0" +version = "3.3.0" description = "The official Python library for the supermemory API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/supermemory/_version.py b/src/supermemory/_version.py index b3b1703c..61a58fe6 100644 --- a/src/supermemory/_version.py +++ b/src/supermemory/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "supermemory" -__version__ = "3.2.0" # x-release-please-version +__version__ = "3.3.0" # x-release-please-version