diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bcab5a6..2e4d290 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.59.0" + ".": "3.60.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b8afe25..e383ff5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-4bec4aac7a4fd11299c105dd60bc086c0aaf51d5cd0f63075efefa56bc19a67f.yml -openapi_spec_hash: f87b9769f91d448f4eb797c37ef4d061 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-d7845a9c7875d892f8d627e0ef60ac61fb28f2520de5eca2063818fd78af431b.yml +openapi_spec_hash: 1827547045c4ef804428e8feeb66e170 config_hash: cde97ef3188581c5f4924c633ec33ddb diff --git a/CHANGELOG.md b/CHANGELOG.md index bdc872d..906a744 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.60.0 (2026-09-01) + +Full Changelog: [v3.59.0...v3.60.0](https://github.com/supermemoryai/python-sdk/compare/v3.59.0...v3.60.0) + +### Features + +* **api:** api update ([8531a88](https://github.com/supermemoryai/python-sdk/commit/8531a888ad97a9279708ee9bf0bf370aa8198f2f)) + ## 3.59.0 (2026-08-14) Full Changelog: [v3.58.0...v3.59.0](https://github.com/supermemoryai/python-sdk/compare/v3.58.0...v3.59.0) diff --git a/api.md b/api.md index 2b72f5d..db480fd 100644 --- a/api.md +++ b/api.md @@ -50,7 +50,7 @@ Methods: - client.documents.batch_add(\*\*params) -> DocumentBatchAddResponse - client.documents.delete_bulk(\*\*params) -> DocumentDeleteBulkResponse - client.documents.get(id) -> DocumentGetResponse -- client.documents.list_processing() -> DocumentListProcessingResponse +- client.documents.list_processing(\*\*params) -> DocumentListProcessingResponse - client.documents.upload_file(\*\*params) -> DocumentUploadFileResponse # Search diff --git a/pyproject.toml b/pyproject.toml index f5c444e..832cce3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.59.0" +version = "3.60.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 85202d3..39a3bb2 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.59.0" # x-release-please-version +__version__ = "3.60.0" # x-release-please-version diff --git a/src/supermemory/resources/documents.py b/src/supermemory/resources/documents.py index 10a0e40..996021e 100644 --- a/src/supermemory/resources/documents.py +++ b/src/supermemory/resources/documents.py @@ -14,6 +14,7 @@ document_batch_add_params, document_delete_bulk_params, document_upload_file_params, + document_list_processing_params, ) from .._files import deepcopy_with_paths from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, SequenceNotStr, omit, not_given @@ -538,6 +539,10 @@ def get( def list_processing( self, *, + container_tags: str | Omit = omit, + limit: Union[str, float] | Omit = omit, + page: Union[str, float] | Omit = omit, + view: Literal["active", "all"] | 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. extra_headers: Headers | None = None, @@ -545,11 +550,45 @@ def list_processing( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentListProcessingResponse: - """Get documents that are currently being processed""" + """Get documents that are currently being processed. + + Default `view=active` is the + live in-flight queue. `view=all` also includes failed and stuck documents. + + Args: + container_tags: Comma-separated container tags to filter by + + limit: Number of items per page. Used with `view=all`. + + page: Page number to fetch. Used with `view=all`. + + view: `active` returns in-flight documents updated in the last 4 hours. `all` also + includes failed and stuck documents. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._get( "/v3/documents/processing", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "container_tags": container_tags, + "limit": limit, + "page": page, + "view": view, + }, + document_list_processing_params.DocumentListProcessingParams, + ), ), cast_to=DocumentListProcessingResponse, ) @@ -1167,6 +1206,10 @@ async def get( async def list_processing( self, *, + container_tags: str | Omit = omit, + limit: Union[str, float] | Omit = omit, + page: Union[str, float] | Omit = omit, + view: Literal["active", "all"] | 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. extra_headers: Headers | None = None, @@ -1174,11 +1217,45 @@ async def list_processing( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentListProcessingResponse: - """Get documents that are currently being processed""" + """Get documents that are currently being processed. + + Default `view=active` is the + live in-flight queue. `view=all` also includes failed and stuck documents. + + Args: + container_tags: Comma-separated container tags to filter by + + limit: Number of items per page. Used with `view=all`. + + page: Page number to fetch. Used with `view=all`. + + view: `active` returns in-flight documents updated in the last 4 hours. `all` also + includes failed and stuck documents. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._get( "/v3/documents/processing", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "container_tags": container_tags, + "limit": limit, + "page": page, + "view": view, + }, + document_list_processing_params.DocumentListProcessingParams, + ), ), cast_to=DocumentListProcessingResponse, ) diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index 695b777..9fcde7c 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -46,6 +46,7 @@ from .memory_update_memory_response import MemoryUpdateMemoryResponse as MemoryUpdateMemoryResponse from .connection_delete_by_id_params import ConnectionDeleteByIDParams as ConnectionDeleteByIDParams from .connection_get_by_tag_response import ConnectionGetByTagResponse as ConnectionGetByTagResponse +from .document_list_processing_params import DocumentListProcessingParams as DocumentListProcessingParams from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams from .document_list_processing_response import DocumentListProcessingResponse as DocumentListProcessingResponse diff --git a/src/supermemory/types/document_list_processing_params.py b/src/supermemory/types/document_list_processing_params.py new file mode 100644 index 0000000..95139a5 --- /dev/null +++ b/src/supermemory/types/document_list_processing_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["DocumentListProcessingParams"] + + +class DocumentListProcessingParams(TypedDict, total=False): + container_tags: Annotated[str, PropertyInfo(alias="containerTags")] + """Comma-separated container tags to filter by""" + + limit: Union[str, float] + """Number of items per page. Used with `view=all`.""" + + page: Union[str, float] + """Page number to fetch. Used with `view=all`.""" + + view: Literal["active", "all"] + """`active` returns in-flight documents updated in the last 4 hours. + + `all` also includes failed and stuck documents. + """ diff --git a/src/supermemory/types/document_list_processing_response.py b/src/supermemory/types/document_list_processing_response.py index 32e99dc..ec32149 100644 --- a/src/supermemory/types/document_list_processing_response.py +++ b/src/supermemory/types/document_list_processing_response.py @@ -7,7 +7,7 @@ from .._models import BaseModel -__all__ = ["DocumentListProcessingResponse", "Document"] +__all__ = ["DocumentListProcessingResponse", "Document", "Pagination"] class Document(BaseModel): @@ -76,6 +76,27 @@ class Document(BaseModel): to use to group documents. """ + error_code: Optional[str] = FieldInfo(alias="errorCode", default=None) + """Stable error code when processing failed, if available""" + + error_message: Optional[str] = FieldInfo(alias="errorMessage", default=None) + """Human-readable processing error, if available""" + + stuck: Optional[bool] = None + """True when the document is not done/failed and has not been updated for 4 hours""" + + +class Pagination(BaseModel): + """Present when `view=all`""" + + current_page: float = FieldInfo(alias="currentPage") + + total_items: float = FieldInfo(alias="totalItems") + + total_pages: float = FieldInfo(alias="totalPages") + + limit: Optional[float] = None + class DocumentListProcessingResponse(BaseModel): """List of documents currently being processed""" @@ -84,3 +105,6 @@ class DocumentListProcessingResponse(BaseModel): total_count: float = FieldInfo(alias="totalCount") """Total number of processing documents""" + + pagination: Optional[Pagination] = None + """Present when `view=all`""" diff --git a/tests/api_resources/test_documents.py b/tests/api_resources/test_documents.py index 2c9e36e..cf5e869 100644 --- a/tests/api_resources/test_documents.py +++ b/tests/api_resources/test_documents.py @@ -423,6 +423,17 @@ def test_method_list_processing(self, client: Supermemory) -> None: document = client.documents.list_processing() assert_matches_type(DocumentListProcessingResponse, document, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_processing_with_all_params(self, client: Supermemory) -> None: + document = client.documents.list_processing( + container_tags="user_123,sm_project_default", + limit="50", + page="1", + view="all", + ) + assert_matches_type(DocumentListProcessingResponse, document, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_processing(self, client: Supermemory) -> None: @@ -902,6 +913,17 @@ async def test_method_list_processing(self, async_client: AsyncSupermemory) -> N document = await async_client.documents.list_processing() assert_matches_type(DocumentListProcessingResponse, document, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_processing_with_all_params(self, async_client: AsyncSupermemory) -> None: + document = await async_client.documents.list_processing( + container_tags="user_123,sm_project_default", + limit="50", + page="1", + view="all", + ) + assert_matches_type(DocumentListProcessingResponse, document, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_processing(self, async_client: AsyncSupermemory) -> None: