Skip to content

Commit 6b55b57

Browse files
feat(api): api update
1 parent 8f348f7 commit 6b55b57

10 files changed

Lines changed: 111 additions & 11 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-383b8840fcfa8d893c8d69da471a7a831e4c5c1092e0b6c14ae39d4b396b5f2a.yml
3-
openapi_spec_hash: e466a95b54e4d62b7cf4cbc69b432989
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-62ed5d466e259c8e4311abe68915161cd0a01d1cc6d9079945eb8a0ebf73f690.yml
3+
openapi_spec_hash: 9622631943e5355eb6923e0c2e12f772
44
config_hash: cde97ef3188581c5f4924c633ec33ddb

src/supermemory/_client.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import TYPE_CHECKING, Any, Dict, Union, Mapping
6+
from typing import TYPE_CHECKING, Any, Dict, List, Union, Mapping
77
from typing_extensions import Self, Literal, override
88

99
import httpx
@@ -334,7 +334,9 @@ def profile(
334334
self,
335335
*,
336336
container_tag: str,
337+
buckets: SequenceNotStr[str] | Omit = omit,
337338
filters: client_profile_params.Filters | Omit = omit,
339+
include: List[Literal["static", "dynamic", "buckets"]] | Omit = omit,
338340
q: str | Omit = omit,
339341
threshold: float | Omit = omit,
340342
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -351,9 +353,15 @@ def profile(
351353
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
352354
any other identifier you wish to use to filter memories.
353355
356+
buckets: Specific bucket keys to return. Omit to return all configured buckets. Only
357+
relevant when "buckets" is included.
358+
354359
filters: Optional metadata filters to apply to profile results and search results.
355360
Supports complex AND/OR queries with multiple conditions.
356361
362+
include: Profile sections to return. Omit to return all sections. Pass a subset to reduce
363+
payload — e.g. ["buckets"] skips static and dynamic entirely.
364+
357365
q: Optional search query to include search results in the response
358366
359367
threshold: Threshold for search results. Only results with a score above this threshold
@@ -372,7 +380,9 @@ def profile(
372380
body=maybe_transform(
373381
{
374382
"container_tag": container_tag,
383+
"buckets": buckets,
375384
"filters": filters,
385+
"include": include,
376386
"q": q,
377387
"threshold": threshold,
378388
},
@@ -681,7 +691,9 @@ async def profile(
681691
self,
682692
*,
683693
container_tag: str,
694+
buckets: SequenceNotStr[str] | Omit = omit,
684695
filters: client_profile_params.Filters | Omit = omit,
696+
include: List[Literal["static", "dynamic", "buckets"]] | Omit = omit,
685697
q: str | Omit = omit,
686698
threshold: float | Omit = omit,
687699
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -698,9 +710,15 @@ async def profile(
698710
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
699711
any other identifier you wish to use to filter memories.
700712
713+
buckets: Specific bucket keys to return. Omit to return all configured buckets. Only
714+
relevant when "buckets" is included.
715+
701716
filters: Optional metadata filters to apply to profile results and search results.
702717
Supports complex AND/OR queries with multiple conditions.
703718
719+
include: Profile sections to return. Omit to return all sections. Pass a subset to reduce
720+
payload — e.g. ["buckets"] skips static and dynamic entirely.
721+
704722
q: Optional search query to include search results in the response
705723
706724
threshold: Threshold for search results. Only results with a score above this threshold
@@ -719,7 +737,9 @@ async def profile(
719737
body=await async_maybe_transform(
720738
{
721739
"container_tag": container_tag,
740+
"buckets": buckets,
722741
"filters": filters,
742+
"include": include,
723743
"q": q,
724744
"threshold": threshold,
725745
},

src/supermemory/resources/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def update(
6565
onedrive_client_id: Optional[str] | Omit = omit,
6666
onedrive_client_secret: Optional[str] | Omit = omit,
6767
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
68+
profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit,
6869
should_llm_filter: Optional[bool] | Omit = omit,
6970
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7071
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -77,6 +78,8 @@ def update(
7778
Update settings for an organization
7879
7980
Args:
81+
profile_buckets: Profile bucket definitions
82+
8083
extra_headers: Send extra headers
8184
8285
extra_query: Add additional query parameters to the request
@@ -105,6 +108,7 @@ def update(
105108
"onedrive_client_id": onedrive_client_id,
106109
"onedrive_client_secret": onedrive_client_secret,
107110
"onedrive_custom_key_enabled": onedrive_custom_key_enabled,
111+
"profile_buckets": profile_buckets,
108112
"should_llm_filter": should_llm_filter,
109113
},
110114
setting_update_params.SettingUpdateParams,
@@ -176,6 +180,7 @@ async def update(
176180
onedrive_client_id: Optional[str] | Omit = omit,
177181
onedrive_client_secret: Optional[str] | Omit = omit,
178182
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
183+
profile_buckets: Iterable[setting_update_params.ProfileBucket] | Omit = omit,
179184
should_llm_filter: Optional[bool] | Omit = omit,
180185
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
181186
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -188,6 +193,8 @@ async def update(
188193
Update settings for an organization
189194
190195
Args:
196+
profile_buckets: Profile bucket definitions
197+
191198
extra_headers: Send extra headers
192199
193200
extra_query: Add additional query parameters to the request
@@ -216,6 +223,7 @@ async def update(
216223
"onedrive_client_id": onedrive_client_id,
217224
"onedrive_client_secret": onedrive_client_secret,
218225
"onedrive_custom_key_enabled": onedrive_custom_key_enabled,
226+
"profile_buckets": profile_buckets,
219227
"should_llm_filter": should_llm_filter,
220228
},
221229
setting_update_params.SettingUpdateParams,

src/supermemory/types/client_profile_params.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
5+
from typing import List, Union, Iterable
66
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

8+
from .._types import SequenceNotStr
89
from .._utils import PropertyInfo
910

1011
__all__ = [
@@ -335,12 +336,25 @@ class ClientProfileParams(TypedDict, total=False):
335336
to use to filter memories.
336337
"""
337338

339+
buckets: SequenceNotStr[str]
340+
"""Specific bucket keys to return.
341+
342+
Omit to return all configured buckets. Only relevant when "buckets" is included.
343+
"""
344+
338345
filters: Filters
339346
"""Optional metadata filters to apply to profile results and search results.
340347
341348
Supports complex AND/OR queries with multiple conditions.
342349
"""
343350

351+
include: List[Literal["static", "dynamic", "buckets"]]
352+
"""Profile sections to return.
353+
354+
Omit to return all sections. Pass a subset to reduce payload — e.g. ["buckets"]
355+
skips static and dynamic entirely.
356+
"""
357+
344358
q: str
345359
"""Optional search query to include search results in the response"""
346360

src/supermemory/types/profile_response.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44

55
from pydantic import Field as FieldInfo
66

@@ -10,10 +10,13 @@
1010

1111

1212
class Profile(BaseModel):
13-
dynamic: List[str]
13+
buckets: Optional[Dict[str, List[str]]] = None
14+
"""Per-bucket memory lists, keyed by bucket key"""
15+
16+
dynamic: Optional[List[str]] = None
1417
"""Dynamic profile information (recent memories)"""
1518

16-
static: List[str]
19+
static: Optional[List[str]] = None
1720
"""Static profile information that remains relevant long-term"""
1821

1922

src/supermemory/types/setting_get_response.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["SettingGetResponse"]
9+
__all__ = ["SettingGetResponse", "ProfileBucket"]
10+
11+
12+
class ProfileBucket(BaseModel):
13+
"""Definition of a single profile bucket"""
14+
15+
key: str
16+
"""Stable slug for the bucket, stored on each memory"""
17+
18+
description: Optional[str] = None
19+
"""What belongs in this bucket — used to guide the ingestion classifier."""
1020

1121

1222
class SettingGetResponse(BaseModel):
@@ -46,4 +56,7 @@ class SettingGetResponse(BaseModel):
4656

4757
onedrive_custom_key_enabled: Optional[bool] = FieldInfo(alias="onedriveCustomKeyEnabled", default=None)
4858

59+
profile_buckets: Optional[List[ProfileBucket]] = FieldInfo(alias="profileBuckets", default=None)
60+
"""Profile bucket definitions"""
61+
4962
should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None)

src/supermemory/types/setting_update_params.py

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

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

88
from .._utils import PropertyInfo
99

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

1212

1313
class SettingUpdateParams(TypedDict, total=False):
@@ -47,4 +47,17 @@ class SettingUpdateParams(TypedDict, total=False):
4747

4848
onedrive_custom_key_enabled: Annotated[Optional[bool], PropertyInfo(alias="onedriveCustomKeyEnabled")]
4949

50+
profile_buckets: Annotated[Iterable[ProfileBucket], PropertyInfo(alias="profileBuckets")]
51+
"""Profile bucket definitions"""
52+
5053
should_llm_filter: Annotated[Optional[bool], PropertyInfo(alias="shouldLLMFilter")]
54+
55+
56+
class ProfileBucket(TypedDict, total=False):
57+
"""Definition of a single profile bucket"""
58+
59+
key: Required[str]
60+
"""Stable slug for the bucket, stored on each memory"""
61+
62+
description: str
63+
"""What belongs in this bucket — used to guide the ingestion classifier."""

src/supermemory/types/setting_update_response.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["SettingUpdateResponse", "Updated"]
9+
__all__ = ["SettingUpdateResponse", "Updated", "UpdatedProfileBucket"]
10+
11+
12+
class UpdatedProfileBucket(BaseModel):
13+
"""Definition of a single profile bucket"""
14+
15+
key: str
16+
"""Stable slug for the bucket, stored on each memory"""
17+
18+
description: Optional[str] = None
19+
"""What belongs in this bucket — used to guide the ingestion classifier."""
1020

1121

1222
class Updated(BaseModel):
@@ -46,6 +56,9 @@ class Updated(BaseModel):
4656

4757
onedrive_custom_key_enabled: Optional[bool] = FieldInfo(alias="onedriveCustomKeyEnabled", default=None)
4858

59+
profile_buckets: Optional[List[UpdatedProfileBucket]] = FieldInfo(alias="profileBuckets", default=None)
60+
"""Profile bucket definitions"""
61+
4962
should_llm_filter: Optional[bool] = FieldInfo(alias="shouldLLMFilter", default=None)
5063

5164

tests/api_resources/test_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def test_method_profile(self, client: Supermemory) -> None:
8181
def test_method_profile_with_all_params(self, client: Supermemory) -> None:
8282
client_ = client.profile(
8383
container_tag="containerTag",
84+
buckets=["string"],
8485
filters={
8586
"or_": [
8687
{
@@ -93,6 +94,7 @@ def test_method_profile_with_all_params(self, client: Supermemory) -> None:
9394
}
9495
]
9596
},
97+
include=["static"],
9698
q="q",
9799
threshold=0,
98100
)
@@ -194,6 +196,7 @@ async def test_method_profile(self, async_client: AsyncSupermemory) -> None:
194196
async def test_method_profile_with_all_params(self, async_client: AsyncSupermemory) -> None:
195197
client = await async_client.profile(
196198
container_tag="containerTag",
199+
buckets=["string"],
197200
filters={
198201
"or_": [
199202
{
@@ -206,6 +209,7 @@ async def test_method_profile_with_all_params(self, async_client: AsyncSupermemo
206209
}
207210
]
208211
},
212+
include=["static"],
209213
q="q",
210214
threshold=0,
211215
)

tests/api_resources/test_settings.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def test_method_update_with_all_params(self, client: Supermemory) -> None:
4343
onedrive_client_id="onedriveClientId",
4444
onedrive_client_secret="onedriveClientSecret",
4545
onedrive_custom_key_enabled=True,
46+
profile_buckets=[
47+
{
48+
"key": "key",
49+
"description": "description",
50+
}
51+
],
4652
should_llm_filter=True,
4753
)
4854
assert_matches_type(SettingUpdateResponse, setting, path=["response"])
@@ -129,6 +135,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncSupermemor
129135
onedrive_client_id="onedriveClientId",
130136
onedrive_client_secret="onedriveClientSecret",
131137
onedrive_custom_key_enabled=True,
138+
profile_buckets=[
139+
{
140+
"key": "key",
141+
"description": "description",
142+
}
143+
],
132144
should_llm_filter=True,
133145
)
134146
assert_matches_type(SettingUpdateResponse, setting, path=["response"])

0 commit comments

Comments
 (0)