Skip to content

Commit 07aa728

Browse files
feat(api): api update
1 parent 27214be commit 07aa728

6 files changed

Lines changed: 215 additions & 17 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-c207a10df858199c6d25fe82831d18c2fbe4861495050be62d7d8cef3b918d84.yml
3-
openapi_spec_hash: d26ff44dda96d7aff0801873c1ce9534
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-25331f39259c2fda7a617655e01098b23d57e32d668de083fec03546689caa19.yml
3+
openapi_spec_hash: 3a56514128e9dbe7307d7adf338afbe5
44
config_hash: cde97ef3188581c5f4924c633ec33ddb

src/supermemory/resources/settings.py

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Dict, Union, Iterable, Optional
6+
from typing_extensions import overload
67

78
import httpx
89

@@ -46,6 +47,33 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
4647
"""
4748
return SettingsResourceWithStreamingResponse(self)
4849

50+
@overload
51+
def update(
52+
self,
53+
*,
54+
workspace_prompt: Optional[str],
55+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56+
# The extra values given here take precedence over values defined on the client or passed to this method.
57+
extra_headers: Headers | None = None,
58+
extra_query: Query | None = None,
59+
extra_body: Body | None = None,
60+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
61+
) -> SettingUpdateResponse:
62+
"""
63+
Update settings for an organization
64+
65+
Args:
66+
extra_headers: Send extra headers
67+
68+
extra_query: Add additional query parameters to the request
69+
70+
extra_body: Add additional JSON properties to the request
71+
72+
timeout: Override the client-level default timeout for this request, in seconds
73+
"""
74+
...
75+
76+
@overload
4977
def update(
5078
self,
5179
*,
@@ -65,7 +93,7 @@ def update(
6593
onedrive_client_id: Optional[str] | Omit = omit,
6694
onedrive_client_secret: Optional[str] | Omit = omit,
6795
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
68-
profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit,
96+
profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit,
6997
should_llm_filter: Optional[bool] | Omit = omit,
7098
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7199
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -88,10 +116,42 @@ def update(
88116
89117
timeout: Override the client-level default timeout for this request, in seconds
90118
"""
119+
...
120+
121+
def update(
122+
self,
123+
*,
124+
workspace_prompt: Optional[str] | Omit = omit,
125+
chunk_size: Optional[int] | Omit = omit,
126+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
127+
filter_prompt: Optional[str] | Omit = omit,
128+
github_client_id: Optional[str] | Omit = omit,
129+
github_client_secret: Optional[str] | Omit = omit,
130+
github_custom_key_enabled: Optional[bool] | Omit = omit,
131+
google_drive_client_id: Optional[str] | Omit = omit,
132+
google_drive_client_secret: Optional[str] | Omit = omit,
133+
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
134+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
135+
notion_client_id: Optional[str] | Omit = omit,
136+
notion_client_secret: Optional[str] | Omit = omit,
137+
notion_custom_key_enabled: Optional[bool] | Omit = omit,
138+
onedrive_client_id: Optional[str] | Omit = omit,
139+
onedrive_client_secret: Optional[str] | Omit = omit,
140+
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
141+
profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit,
142+
should_llm_filter: Optional[bool] | Omit = omit,
143+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144+
# The extra values given here take precedence over values defined on the client or passed to this method.
145+
extra_headers: Headers | None = None,
146+
extra_query: Query | None = None,
147+
extra_body: Body | None = None,
148+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
149+
) -> SettingUpdateResponse:
91150
return self._patch(
92151
"/v3/settings",
93152
body=maybe_transform(
94153
{
154+
"workspace_prompt": workspace_prompt,
95155
"chunk_size": chunk_size,
96156
"exclude_items": exclude_items,
97157
"filter_prompt": filter_prompt,
@@ -161,6 +221,33 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
161221
"""
162222
return AsyncSettingsResourceWithStreamingResponse(self)
163223

224+
@overload
225+
async def update(
226+
self,
227+
*,
228+
workspace_prompt: Optional[str],
229+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
230+
# The extra values given here take precedence over values defined on the client or passed to this method.
231+
extra_headers: Headers | None = None,
232+
extra_query: Query | None = None,
233+
extra_body: Body | None = None,
234+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
235+
) -> SettingUpdateResponse:
236+
"""
237+
Update settings for an organization
238+
239+
Args:
240+
extra_headers: Send extra headers
241+
242+
extra_query: Add additional query parameters to the request
243+
244+
extra_body: Add additional JSON properties to the request
245+
246+
timeout: Override the client-level default timeout for this request, in seconds
247+
"""
248+
...
249+
250+
@overload
164251
async def update(
165252
self,
166253
*,
@@ -180,7 +267,7 @@ async def update(
180267
onedrive_client_id: Optional[str] | Omit = omit,
181268
onedrive_client_secret: Optional[str] | Omit = omit,
182269
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
183-
profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit,
270+
profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit,
184271
should_llm_filter: Optional[bool] | Omit = omit,
185272
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
186273
# 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(
203290
204291
timeout: Override the client-level default timeout for this request, in seconds
205292
"""
293+
...
294+
295+
async def update(
296+
self,
297+
*,
298+
workspace_prompt: Optional[str] | Omit = omit,
299+
chunk_size: Optional[int] | Omit = omit,
300+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
301+
filter_prompt: Optional[str] | Omit = omit,
302+
github_client_id: Optional[str] | Omit = omit,
303+
github_client_secret: Optional[str] | Omit = omit,
304+
github_custom_key_enabled: Optional[bool] | Omit = omit,
305+
google_drive_client_id: Optional[str] | Omit = omit,
306+
google_drive_client_secret: Optional[str] | Omit = omit,
307+
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
308+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
309+
notion_client_id: Optional[str] | Omit = omit,
310+
notion_client_secret: Optional[str] | Omit = omit,
311+
notion_custom_key_enabled: Optional[bool] | Omit = omit,
312+
onedrive_client_id: Optional[str] | Omit = omit,
313+
onedrive_client_secret: Optional[str] | Omit = omit,
314+
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
315+
profile_buckets: Iterable[setting_update_params.Variant1ProfileBucket] | Omit = omit,
316+
should_llm_filter: Optional[bool] | Omit = omit,
317+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
318+
# The extra values given here take precedence over values defined on the client or passed to this method.
319+
extra_headers: Headers | None = None,
320+
extra_query: Query | None = None,
321+
extra_body: Body | None = None,
322+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
323+
) -> SettingUpdateResponse:
206324
return await self._patch(
207325
"/v3/settings",
208326
body=await async_maybe_transform(
209327
{
328+
"workspace_prompt": workspace_prompt,
210329
"chunk_size": chunk_size,
211330
"exclude_items": exclude_items,
212331
"filter_prompt": filter_prompt,

src/supermemory/types/setting_get_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ class SettingGetResponse(BaseModel):
6060
"""Profile bucket definitions"""
6161

6262
should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None)
63+
64+
workspace_prompt: Optional[str] = FieldInfo(alias="workspacePrompt", default=None)

src/supermemory/types/setting_update_params.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
from __future__ import annotations
44

55
from typing import Dict, Union, Iterable, Optional
6-
from typing_extensions import Required, Annotated, TypedDict
6+
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
77

88
from .._utils import PropertyInfo
99

10-
__all__ = ["SettingUpdateParams", "ProfileBucket"]
10+
__all__ = ["SettingUpdateParams", "Variant0", "Variant1", "Variant1ProfileBucket"]
1111

1212

13-
class SettingUpdateParams(TypedDict, total=False):
13+
class Variant0(TypedDict, total=False):
14+
workspace_prompt: Required[Annotated[Optional[str], PropertyInfo(alias="workspacePrompt")]]
15+
16+
17+
class Variant1(TypedDict, total=False):
1418
chunk_size: Annotated[Optional[int], PropertyInfo(alias="chunkSize")]
1519

1620
exclude_items: Annotated[
@@ -47,17 +51,20 @@ class SettingUpdateParams(TypedDict, total=False):
4751

4852
onedrive_custom_key_enabled: Annotated[Optional[bool], PropertyInfo(alias="onedriveCustomKeyEnabled")]
4953

50-
profile_buckets: Annotated[Iterable[ProfileBucket], PropertyInfo(alias="profileBuckets")]
54+
profile_buckets: Annotated[Iterable[Variant1ProfileBucket], PropertyInfo(alias="profileBuckets")]
5155
"""Profile bucket definitions"""
5256

5357
should_llm_filter: Annotated[Optional[bool], PropertyInfo(alias="shouldLLMFilter")]
5458

5559

56-
class ProfileBucket(TypedDict, total=False):
60+
class Variant1ProfileBucket(TypedDict, total=False):
5761
"""Definition of a single profile bucket"""
5862

5963
key: Required[str]
6064
"""Stable slug for the bucket, stored on each memory"""
6165

6266
description: str
6367
"""What belongs in this bucket — used to guide the ingestion classifier."""
68+
69+
70+
SettingUpdateParams: TypeAlias = Union[Variant0, Variant1]

src/supermemory/types/setting_update_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class Updated(BaseModel):
6161

6262
should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None)
6363

64+
workspace_prompt: Optional[str] = FieldInfo(alias="workspacePrompt", default=None)
65+
6466

6567
class SettingUpdateResponse(BaseModel):
6668
org_id: str = FieldInfo(alias="orgId")

tests/api_resources/test_settings.py

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,47 @@ class TestSettings:
1919

2020
@pytest.mark.skip(reason="Mock server tests are disabled")
2121
@parametrize
22-
def test_method_update(self, client: Supermemory) -> None:
22+
def test_method_update_overload_1(self, client: Supermemory) -> None:
23+
setting = client.settings.update(
24+
workspace_prompt="workspacePrompt",
25+
)
26+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
27+
28+
@pytest.mark.skip(reason="Mock server tests are disabled")
29+
@parametrize
30+
def test_raw_response_update_overload_1(self, client: Supermemory) -> None:
31+
response = client.settings.with_raw_response.update(
32+
workspace_prompt="workspacePrompt",
33+
)
34+
35+
assert response.is_closed is True
36+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
37+
setting = response.parse()
38+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
39+
40+
@pytest.mark.skip(reason="Mock server tests are disabled")
41+
@parametrize
42+
def test_streaming_response_update_overload_1(self, client: Supermemory) -> None:
43+
with client.settings.with_streaming_response.update(
44+
workspace_prompt="workspacePrompt",
45+
) as response:
46+
assert not response.is_closed
47+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
48+
49+
setting = response.parse()
50+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
51+
52+
assert cast(Any, response.is_closed) is True
53+
54+
@pytest.mark.skip(reason="Mock server tests are disabled")
55+
@parametrize
56+
def test_method_update_overload_2(self, client: Supermemory) -> None:
2357
setting = client.settings.update()
2458
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
2559

2660
@pytest.mark.skip(reason="Mock server tests are disabled")
2761
@parametrize
28-
def test_method_update_with_all_params(self, client: Supermemory) -> None:
62+
def test_method_update_with_all_params_overload_2(self, client: Supermemory) -> None:
2963
setting = client.settings.update(
3064
chunk_size=-2147483648,
3165
exclude_items="string",
@@ -55,7 +89,7 @@ def test_method_update_with_all_params(self, client: Supermemory) -> None:
5589

5690
@pytest.mark.skip(reason="Mock server tests are disabled")
5791
@parametrize
58-
def test_raw_response_update(self, client: Supermemory) -> None:
92+
def test_raw_response_update_overload_2(self, client: Supermemory) -> None:
5993
response = client.settings.with_raw_response.update()
6094

6195
assert response.is_closed is True
@@ -65,7 +99,7 @@ def test_raw_response_update(self, client: Supermemory) -> None:
6599

66100
@pytest.mark.skip(reason="Mock server tests are disabled")
67101
@parametrize
68-
def test_streaming_response_update(self, client: Supermemory) -> None:
102+
def test_streaming_response_update_overload_2(self, client: Supermemory) -> None:
69103
with client.settings.with_streaming_response.update() as response:
70104
assert not response.is_closed
71105
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -111,13 +145,47 @@ class TestAsyncSettings:
111145

112146
@pytest.mark.skip(reason="Mock server tests are disabled")
113147
@parametrize
114-
async def test_method_update(self, async_client: AsyncSupermemory) -> None:
148+
async def test_method_update_overload_1(self, async_client: AsyncSupermemory) -> None:
149+
setting = await async_client.settings.update(
150+
workspace_prompt="workspacePrompt",
151+
)
152+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
153+
154+
@pytest.mark.skip(reason="Mock server tests are disabled")
155+
@parametrize
156+
async def test_raw_response_update_overload_1(self, async_client: AsyncSupermemory) -> None:
157+
response = await async_client.settings.with_raw_response.update(
158+
workspace_prompt="workspacePrompt",
159+
)
160+
161+
assert response.is_closed is True
162+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
163+
setting = await response.parse()
164+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
165+
166+
@pytest.mark.skip(reason="Mock server tests are disabled")
167+
@parametrize
168+
async def test_streaming_response_update_overload_1(self, async_client: AsyncSupermemory) -> None:
169+
async with async_client.settings.with_streaming_response.update(
170+
workspace_prompt="workspacePrompt",
171+
) as response:
172+
assert not response.is_closed
173+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
174+
175+
setting = await response.parse()
176+
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
177+
178+
assert cast(Any, response.is_closed) is True
179+
180+
@pytest.mark.skip(reason="Mock server tests are disabled")
181+
@parametrize
182+
async def test_method_update_overload_2(self, async_client: AsyncSupermemory) -> None:
115183
setting = await async_client.settings.update()
116184
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
117185

118186
@pytest.mark.skip(reason="Mock server tests are disabled")
119187
@parametrize
120-
async def test_method_update_with_all_params(self, async_client: AsyncSupermemory) -> None:
188+
async def test_method_update_with_all_params_overload_2(self, async_client: AsyncSupermemory) -> None:
121189
setting = await async_client.settings.update(
122190
chunk_size=-2147483648,
123191
exclude_items="string",
@@ -147,7 +215,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncSupermemor
147215

148216
@pytest.mark.skip(reason="Mock server tests are disabled")
149217
@parametrize
150-
async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None:
218+
async def test_raw_response_update_overload_2(self, async_client: AsyncSupermemory) -> None:
151219
response = await async_client.settings.with_raw_response.update()
152220

153221
assert response.is_closed is True
@@ -157,7 +225,7 @@ async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None
157225

158226
@pytest.mark.skip(reason="Mock server tests are disabled")
159227
@parametrize
160-
async def test_streaming_response_update(self, async_client: AsyncSupermemory) -> None:
228+
async def test_streaming_response_update_overload_2(self, async_client: AsyncSupermemory) -> None:
161229
async with async_client.settings.with_streaming_response.update() as response:
162230
assert not response.is_closed
163231
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)