diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de279cc3..f154e528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: permissions: contents: read id-token: write - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/supermemory-new-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 093a7e5a..a5147c1d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0-alpha.28" + ".": "3.0.0-alpha.29" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2b3c8908..a23fff93 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-bc38a818a02d2611e24859c4fd59ce98a24499af22ac9d16fc93a3d1e0b3c94f.yml -openapi_spec_hash: e25323c2c0f792f2fafc664748774e46 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-de994787885a5ec28fb19f069715a257ea4e4f1bcff2b25c4b33e928779c6454.yml +openapi_spec_hash: 7b831b4614b8d9b8caddcaa096bf3817 config_hash: 9b9291a6c872b063900a46386729ba3c diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e3d4280..8e61cfb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 3.0.0-alpha.29 (2025-08-27) + +Full Changelog: [v3.0.0-alpha.28...v3.0.0-alpha.29](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.28...v3.0.0-alpha.29) + +### Features + +* **api:** api update ([5c48767](https://github.com/supermemoryai/python-sdk/commit/5c48767f77b0daf362be422e6d2d8843c15692b3)) +* **api:** api update ([8eb53ac](https://github.com/supermemoryai/python-sdk/commit/8eb53ac4b04fae2f656d82c2c36c01e6583a08e0)) +* **api:** api update ([9194990](https://github.com/supermemoryai/python-sdk/commit/9194990dfbe4e8b9a3fe145095ae65c1cab1b342)) +* **api:** api update ([be04a5c](https://github.com/supermemoryai/python-sdk/commit/be04a5cf50c9af30b04e43128a860a93305f401a)) + + +### Bug Fixes + +* avoid newer type syntax ([cd791b9](https://github.com/supermemoryai/python-sdk/commit/cd791b97c02fe5728e54482097c846557ab0d555)) + + +### Chores + +* **internal:** change ci workflow machines ([002a748](https://github.com/supermemoryai/python-sdk/commit/002a748ddf690fcaeab905c622fe598ddc0f6629)) +* **internal:** update pyright exclude list ([41a59ff](https://github.com/supermemoryai/python-sdk/commit/41a59ff7fb26bd419f747265c00a99ad750833d0)) + ## 3.0.0-alpha.28 (2025-08-24) Full Changelog: [v3.0.0-alpha.27...v3.0.0-alpha.28](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.27...v3.0.0-alpha.28) diff --git a/api.md b/api.md index eadef78d..c2ec94dd 100644 --- a/api.md +++ b/api.md @@ -60,6 +60,7 @@ from supermemory.types import ( ConnectionDeleteByProviderResponse, ConnectionGetByIDResponse, ConnectionGetByTagsResponse, + ConnectionImportResponse, ConnectionListDocumentsResponse, ) ``` @@ -72,5 +73,5 @@ Methods: - client.connections.delete_by_provider(provider, \*\*params) -> ConnectionDeleteByProviderResponse - client.connections.get_by_id(connection_id) -> ConnectionGetByIDResponse - client.connections.get_by_tags(provider, \*\*params) -> ConnectionGetByTagsResponse -- client.connections.import\_(provider, \*\*params) -> None +- client.connections.import\_(provider, \*\*params) -> str - client.connections.list_documents(provider, \*\*params) -> ConnectionListDocumentsResponse diff --git a/pyproject.toml b/pyproject.toml index a5f32103..bd51fb43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.0.0-alpha.28" +version = "3.0.0-alpha.29" description = "The official Python library for the supermemory API" dynamic = ["readme"] license = "Apache-2.0" @@ -148,6 +148,7 @@ exclude = [ "_dev", ".venv", ".nox", + ".git", ] reportImplicitOverride = true diff --git a/src/supermemory/_models.py b/src/supermemory/_models.py index b8387ce9..92f7c10b 100644 --- a/src/supermemory/_models.py +++ b/src/supermemory/_models.py @@ -304,7 +304,7 @@ def model_dump( exclude_none=exclude_none, ) - return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped @override def model_dump_json( diff --git a/src/supermemory/_version.py b/src/supermemory/_version.py index 06fa8e8c..83fc1e35 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.0.0-alpha.28" # x-release-please-version +__version__ = "3.0.0-alpha.29" # x-release-please-version diff --git a/src/supermemory/resources/connections.py b/src/supermemory/resources/connections.py index 45c96034..af94f406 100644 --- a/src/supermemory/resources/connections.py +++ b/src/supermemory/resources/connections.py @@ -15,7 +15,7 @@ connection_list_documents_params, connection_delete_by_provider_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -293,7 +293,7 @@ def import_( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: + ) -> str: """ Initiate a manual sync of connections @@ -310,14 +310,14 @@ def import_( """ if not provider: raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return self._post( f"/v3/connections/{provider}/import", body=maybe_transform({"container_tags": container_tags}, connection_import_params.ConnectionImportParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=str, ) def list_documents( @@ -618,7 +618,7 @@ async def import_( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: + ) -> str: """ Initiate a manual sync of connections @@ -635,7 +635,7 @@ async def import_( """ if not provider: raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return await self._post( f"/v3/connections/{provider}/import", body=await async_maybe_transform( @@ -644,7 +644,7 @@ async def import_( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=str, ) async def list_documents( diff --git a/src/supermemory/resources/memories.py b/src/supermemory/resources/memories.py index 5fdec015..2f07229c 100644 --- a/src/supermemory/resources/memories.py +++ b/src/supermemory/resources/memories.py @@ -126,6 +126,7 @@ def list( *, container_tags: List[str] | NotGiven = NOT_GIVEN, filters: str | NotGiven = NOT_GIVEN, + include_content: bool | NotGiven = NOT_GIVEN, limit: Union[str, float] | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: Union[str, float] | NotGiven = NOT_GIVEN, @@ -146,6 +147,9 @@ def list( filters: Optional filters to apply to the search + include_content: Whether to include the content field in the response. Warning: This can make + responses significantly larger. + limit: Number of items per page order: Sort order @@ -168,6 +172,7 @@ def list( { "container_tags": container_tags, "filters": filters, + "include_content": include_content, "limit": limit, "order": order, "page": page, @@ -462,6 +467,7 @@ async def list( *, container_tags: List[str] | NotGiven = NOT_GIVEN, filters: str | NotGiven = NOT_GIVEN, + include_content: bool | NotGiven = NOT_GIVEN, limit: Union[str, float] | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: Union[str, float] | NotGiven = NOT_GIVEN, @@ -482,6 +488,9 @@ async def list( filters: Optional filters to apply to the search + include_content: Whether to include the content field in the response. Warning: This can make + responses significantly larger. + limit: Number of items per page order: Sort order @@ -504,6 +513,7 @@ async def list( { "container_tags": container_tags, "filters": filters, + "include_content": include_content, "limit": limit, "order": order, "page": page, diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index e0ca3f8c..7224f980 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -24,6 +24,7 @@ from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams from .search_documents_response import SearchDocumentsResponse as SearchDocumentsResponse from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse +from .connection_import_response import ConnectionImportResponse as ConnectionImportResponse from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse from .connection_get_by_id_response import ConnectionGetByIDResponse as ConnectionGetByIDResponse from .connection_get_by_tags_params import ConnectionGetByTagsParams as ConnectionGetByTagsParams diff --git a/src/supermemory/types/connection_import_response.py b/src/supermemory/types/connection_import_response.py new file mode 100644 index 00000000..9e5445be --- /dev/null +++ b/src/supermemory/types/connection_import_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["ConnectionImportResponse"] + +ConnectionImportResponse: TypeAlias = str diff --git a/src/supermemory/types/memory_list_params.py b/src/supermemory/types/memory_list_params.py index 7e683d71..883ea8b9 100644 --- a/src/supermemory/types/memory_list_params.py +++ b/src/supermemory/types/memory_list_params.py @@ -21,6 +21,12 @@ class MemoryListParams(TypedDict, total=False): filters: str """Optional filters to apply to the search""" + include_content: Annotated[bool, PropertyInfo(alias="includeContent")] + """Whether to include the content field in the response. + + Warning: This can make responses significantly larger. + """ + limit: Union[str, float] """Number of items per page""" diff --git a/src/supermemory/types/memory_list_response.py b/src/supermemory/types/memory_list_response.py index 1f166784..d2fdcb6a 100644 --- a/src/supermemory/types/memory_list_response.py +++ b/src/supermemory/types/memory_list_response.py @@ -73,6 +73,9 @@ class Memory(BaseModel): to use to group memories. """ + content: Optional[str] = None + """Content of the memory (only included when includeContent=true)""" + class Pagination(BaseModel): current_page: float = FieldInfo(alias="currentPage") diff --git a/tests/api_resources/test_connections.py b/tests/api_resources/test_connections.py index 9b5daf31..70cf1bc1 100644 --- a/tests/api_resources/test_connections.py +++ b/tests/api_resources/test_connections.py @@ -271,7 +271,7 @@ def test_method_import(self, client: Supermemory) -> None: connection = client.connections.import_( provider="notion", ) - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -280,7 +280,7 @@ def test_method_import_with_all_params(self, client: Supermemory) -> None: provider="notion", container_tags=["user_123", "project_123"], ) - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -292,7 +292,7 @@ def test_raw_response_import(self, client: Supermemory) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -304,7 +304,7 @@ def test_streaming_response_import(self, client: Supermemory) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert connection is None + assert_matches_type(str, connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -603,7 +603,7 @@ async def test_method_import(self, async_client: AsyncSupermemory) -> None: connection = await async_client.connections.import_( provider="notion", ) - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -612,7 +612,7 @@ async def test_method_import_with_all_params(self, async_client: AsyncSupermemor provider="notion", container_tags=["user_123", "project_123"], ) - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -624,7 +624,7 @@ async def test_raw_response_import(self, async_client: AsyncSupermemory) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert connection is None + assert_matches_type(str, connection, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -636,7 +636,7 @@ async def test_streaming_response_import(self, async_client: AsyncSupermemory) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert connection is None + assert_matches_type(str, connection, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_memories.py b/tests/api_resources/test_memories.py index 2aec1fb9..7e02d96d 100644 --- a/tests/api_resources/test_memories.py +++ b/tests/api_resources/test_memories.py @@ -97,6 +97,7 @@ def test_method_list_with_all_params(self, client: Supermemory) -> None: memory = client.memories.list( container_tags=["user_123", "project_123"], filters='{"AND":[{"key":"group","negate":false,"value":"jira_users"},{"filterType":"numeric","key":"timestamp","negate":false,"numericOperator":">","value":"1742745777"}]}', + include_content=False, limit=10, order="desc", page=1, @@ -380,6 +381,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncSupermemory) memory = await async_client.memories.list( container_tags=["user_123", "project_123"], filters='{"AND":[{"key":"group","negate":false,"value":"jira_users"},{"filterType":"numeric","key":"timestamp","negate":false,"numericOperator":">","value":"1742745777"}]}', + include_content=False, limit=10, order="desc", page=1,