diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6673dd7..bc1874a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.52.0" + ".": "3.53.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 4163b4f..950c937 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-c891498aa1f63de961e1b30d81ab6b0491f95e54e4019cbe23a026acef537de0.yml -openapi_spec_hash: c58db94b33108879f8b96e56ff893974 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-cf7d69026df2cbada6513c26d504ea6e80ca02f898db76d1380f70132fcfb51b.yml +openapi_spec_hash: 8572004105e03a670954ef78b900663d config_hash: cde97ef3188581c5f4924c633ec33ddb diff --git a/CHANGELOG.md b/CHANGELOG.md index 83ac570..e2119ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 3.53.0 (2026-07-23) + +Full Changelog: [v3.52.0...v3.53.0](https://github.com/supermemoryai/python-sdk/compare/v3.52.0...v3.53.0) + +### Features + +* **api:** api update ([d2ba42d](https://github.com/supermemoryai/python-sdk/commit/d2ba42d4d58bbc3b0eb9d8e03297a61f823eacca)) +* **api:** api update ([570a8dc](https://github.com/supermemoryai/python-sdk/commit/570a8dc4904654a3ee1aa26c76fc5fe410ac51f8)) + ## 3.52.0 (2026-07-21) Full Changelog: [v3.51.0...v3.52.0](https://github.com/supermemoryai/python-sdk/compare/v3.51.0...v3.52.0) diff --git a/pyproject.toml b/pyproject.toml index 534b3a5..b158d2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.52.0" +version = "3.53.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 e22969f..5798c43 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.52.0" # x-release-please-version +__version__ = "3.53.0" # x-release-please-version diff --git a/src/supermemory/resources/settings.py b/src/supermemory/resources/settings.py index d191459..c7eebcf 100644 --- a/src/supermemory/resources/settings.py +++ b/src/supermemory/resources/settings.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Dict, Union, Iterable, Optional +from typing_extensions import overload import httpx @@ -46,6 +47,33 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: """ return SettingsResourceWithStreamingResponse(self) + @overload + def update( + self, + *, + workspace_prompt: Optional[str], + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SettingUpdateResponse: + """ + Update settings for an organization + + Args: + 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 + """ + ... + + @overload def update( self, *, @@ -65,7 +93,7 @@ def update( onedrive_client_id: Optional[str] | Omit = omit, onedrive_client_secret: Optional[str] | Omit = omit, onedrive_custom_key_enabled: Optional[bool] | Omit = omit, - profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit, + profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit, should_llm_filter: Optional[bool] | 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. @@ -88,10 +116,42 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + def update( + self, + *, + workspace_prompt: Optional[str] | Omit = omit, + chunk_size: Optional[int] | Omit = omit, + exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit, + filter_prompt: Optional[str] | Omit = omit, + github_client_id: Optional[str] | Omit = omit, + github_client_secret: Optional[str] | Omit = omit, + github_custom_key_enabled: Optional[bool] | Omit = omit, + google_drive_client_id: Optional[str] | Omit = omit, + google_drive_client_secret: Optional[str] | Omit = omit, + google_drive_custom_key_enabled: Optional[bool] | Omit = omit, + include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit, + notion_client_id: Optional[str] | Omit = omit, + notion_client_secret: Optional[str] | Omit = omit, + notion_custom_key_enabled: Optional[bool] | Omit = omit, + onedrive_client_id: Optional[str] | Omit = omit, + onedrive_client_secret: Optional[str] | Omit = omit, + onedrive_custom_key_enabled: Optional[bool] | Omit = omit, + profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit, + should_llm_filter: Optional[bool] | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SettingUpdateResponse: return self._patch( "/v3/settings", body=maybe_transform( { + "workspace_prompt": workspace_prompt, "chunk_size": chunk_size, "exclude_items": exclude_items, "filter_prompt": filter_prompt, @@ -161,6 +221,33 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: """ return AsyncSettingsResourceWithStreamingResponse(self) + @overload + async def update( + self, + *, + workspace_prompt: Optional[str], + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SettingUpdateResponse: + """ + Update settings for an organization + + Args: + 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 + """ + ... + + @overload async def update( self, *, @@ -180,7 +267,7 @@ async def update( onedrive_client_id: Optional[str] | Omit = omit, onedrive_client_secret: Optional[str] | Omit = omit, onedrive_custom_key_enabled: Optional[bool] | Omit = omit, - profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit, + profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit, should_llm_filter: Optional[bool] | 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. @@ -203,10 +290,42 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + async def update( + self, + *, + workspace_prompt: Optional[str] | Omit = omit, + chunk_size: Optional[int] | Omit = omit, + exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit, + filter_prompt: Optional[str] | Omit = omit, + github_client_id: Optional[str] | Omit = omit, + github_client_secret: Optional[str] | Omit = omit, + github_custom_key_enabled: Optional[bool] | Omit = omit, + google_drive_client_id: Optional[str] | Omit = omit, + google_drive_client_secret: Optional[str] | Omit = omit, + google_drive_custom_key_enabled: Optional[bool] | Omit = omit, + include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit, + notion_client_id: Optional[str] | Omit = omit, + notion_client_secret: Optional[str] | Omit = omit, + notion_custom_key_enabled: Optional[bool] | Omit = omit, + onedrive_client_id: Optional[str] | Omit = omit, + onedrive_client_secret: Optional[str] | Omit = omit, + onedrive_custom_key_enabled: Optional[bool] | Omit = omit, + profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit, + should_llm_filter: Optional[bool] | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SettingUpdateResponse: return await self._patch( "/v3/settings", body=await async_maybe_transform( { + "workspace_prompt": workspace_prompt, "chunk_size": chunk_size, "exclude_items": exclude_items, "filter_prompt": filter_prompt, diff --git a/src/supermemory/types/connection_get_by_id_response.py b/src/supermemory/types/connection_get_by_id_response.py index 74f2d7b..2ddef43 100644 --- a/src/supermemory/types/connection_get_by_id_response.py +++ b/src/supermemory/types/connection_get_by_id_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -16,6 +17,10 @@ class LastSyncRun(BaseModel): error: Optional[str] = None + error_code: Optional[ + Literal["auth_expired", "rate_limited", "plan_required", "provider_unavailable", "internal"] + ] = FieldInfo(alias="errorCode", default=None) + started_at: Optional[str] = FieldInfo(alias="startedAt", default=None) diff --git a/src/supermemory/types/connection_get_by_tag_response.py b/src/supermemory/types/connection_get_by_tag_response.py index 4fb6d4f..161cac0 100644 --- a/src/supermemory/types/connection_get_by_tag_response.py +++ b/src/supermemory/types/connection_get_by_tag_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -16,6 +17,10 @@ class LastSyncRun(BaseModel): error: Optional[str] = None + error_code: Optional[ + Literal["auth_expired", "rate_limited", "plan_required", "provider_unavailable", "internal"] + ] = FieldInfo(alias="errorCode", default=None) + started_at: Optional[str] = FieldInfo(alias="startedAt", default=None) diff --git a/src/supermemory/types/connection_list_response.py b/src/supermemory/types/connection_list_response.py index 19c9aec..f946b5d 100644 --- a/src/supermemory/types/connection_list_response.py +++ b/src/supermemory/types/connection_list_response.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional -from typing_extensions import TypeAlias +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -17,6 +17,10 @@ class ConnectionListResponseItemLastSyncRun(BaseModel): error: Optional[str] = None + error_code: Optional[ + Literal["auth_expired", "rate_limited", "plan_required", "provider_unavailable", "internal"] + ] = FieldInfo(alias="errorCode", default=None) + started_at: Optional[str] = FieldInfo(alias="startedAt", default=None) diff --git a/src/supermemory/types/setting_get_response.py b/src/supermemory/types/setting_get_response.py index f558944..985411b 100644 --- a/src/supermemory/types/setting_get_response.py +++ b/src/supermemory/types/setting_get_response.py @@ -60,3 +60,5 @@ class SettingGetResponse(BaseModel): """Profile bucket definitions""" should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None) + + workspace_prompt: Optional[str] = FieldInfo(alias="workspacePrompt", default=None) diff --git a/src/supermemory/types/setting_update_params.py b/src/supermemory/types/setting_update_params.py index 5e9d2c9..da4b820 100644 --- a/src/supermemory/types/setting_update_params.py +++ b/src/supermemory/types/setting_update_params.py @@ -3,14 +3,18 @@ from __future__ import annotations from typing import Dict, Union, Iterable, Optional -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["SettingUpdateParams", "ProfileBucket"] +__all__ = ["SettingUpdateParams", "Variant0", "Variant1", "Variant1ProfileBucket"] -class SettingUpdateParams(TypedDict, total=False): +class Variant0(TypedDict, total=False): + workspace_prompt: Required[Annotated[Optional[str], PropertyInfo(alias="workspacePrompt")]] + + +class Variant1(TypedDict, total=False): chunk_size: Annotated[Optional[int], PropertyInfo(alias="chunkSize")] exclude_items: Annotated[ @@ -47,13 +51,13 @@ class SettingUpdateParams(TypedDict, total=False): onedrive_custom_key_enabled: Annotated[Optional[bool], PropertyInfo(alias="onedriveCustomKeyEnabled")] - profile_buckets: Annotated[Iterable[ProfileBucket], PropertyInfo(alias="profileBuckets")] + profile_buckets: Annotated[Iterable[Variant1ProfileBucket], PropertyInfo(alias="profileBuckets")] """Profile bucket definitions""" should_llm_filter: Annotated[Optional[bool], PropertyInfo(alias="shouldLLMFilter")] -class ProfileBucket(TypedDict, total=False): +class Variant1ProfileBucket(TypedDict, total=False): """Definition of a single profile bucket""" key: Required[str] @@ -61,3 +65,6 @@ class ProfileBucket(TypedDict, total=False): description: str """What belongs in this bucket — used to guide the ingestion classifier.""" + + +SettingUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/supermemory/types/setting_update_response.py b/src/supermemory/types/setting_update_response.py index 11f8080..40e6e09 100644 --- a/src/supermemory/types/setting_update_response.py +++ b/src/supermemory/types/setting_update_response.py @@ -61,6 +61,8 @@ class Updated(BaseModel): should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None) + workspace_prompt: Optional[str] = FieldInfo(alias="workspacePrompt", default=None) + class SettingUpdateResponse(BaseModel): org_id: str = FieldInfo(alias="orgId") diff --git a/tests/api_resources/test_settings.py b/tests/api_resources/test_settings.py index ce41b4f..fa16498 100644 --- a/tests/api_resources/test_settings.py +++ b/tests/api_resources/test_settings.py @@ -19,13 +19,47 @@ class TestSettings: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_method_update(self, client: Supermemory) -> None: + def test_method_update_overload_1(self, client: Supermemory) -> None: + setting = client.settings.update( + workspace_prompt="workspacePrompt", + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_update_overload_1(self, client: Supermemory) -> None: + response = client.settings.with_raw_response.update( + workspace_prompt="workspacePrompt", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_update_overload_1(self, client: Supermemory) -> None: + with client.settings.with_streaming_response.update( + workspace_prompt="workspacePrompt", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_overload_2(self, client: Supermemory) -> None: setting = client.settings.update() assert_matches_type(SettingUpdateResponse, setting, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_method_update_with_all_params(self, client: Supermemory) -> None: + def test_method_update_with_all_params_overload_2(self, client: Supermemory) -> None: setting = client.settings.update( chunk_size=-2147483648, exclude_items="string", @@ -55,7 +89,7 @@ def test_method_update_with_all_params(self, client: Supermemory) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_raw_response_update(self, client: Supermemory) -> None: + def test_raw_response_update_overload_2(self, client: Supermemory) -> None: response = client.settings.with_raw_response.update() assert response.is_closed is True @@ -65,7 +99,7 @@ def test_raw_response_update(self, client: Supermemory) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_streaming_response_update(self, client: Supermemory) -> None: + def test_streaming_response_update_overload_2(self, client: Supermemory) -> None: with client.settings.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,13 +145,47 @@ class TestAsyncSettings: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_method_update(self, async_client: AsyncSupermemory) -> None: + async def test_method_update_overload_1(self, async_client: AsyncSupermemory) -> None: + setting = await async_client.settings.update( + workspace_prompt="workspacePrompt", + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncSupermemory) -> None: + response = await async_client.settings.with_raw_response.update( + workspace_prompt="workspacePrompt", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncSupermemory) -> None: + async with async_client.settings.with_streaming_response.update( + workspace_prompt="workspacePrompt", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncSupermemory) -> None: setting = await async_client.settings.update() assert_matches_type(SettingUpdateResponse, setting, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncSupermemory) -> None: + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncSupermemory) -> None: setting = await async_client.settings.update( chunk_size=-2147483648, exclude_items="string", @@ -147,7 +215,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncSupermemor @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncSupermemory) -> None: response = await async_client.settings.with_raw_response.update() assert response.is_closed is True @@ -157,7 +225,7 @@ async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_streaming_response_update(self, async_client: AsyncSupermemory) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncSupermemory) -> None: async with async_client.settings.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"