Skip to content

Commit b43b51b

Browse files
stainless-app[bot]Dhravya
authored andcommitted
feat(api): api update
1 parent e2c4830 commit b43b51b

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

.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%2Fsupermemory-new-00c63196a0d368b4f32efcf1bbd2d594fdc8a42a0c0a58a8e316a3ab03ac10a6.yml
3-
openapi_spec_hash: 012afff66351582e55dfd692397f2a23
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-b1d58ccf9003b376f42b961813f18a80e7de4872ed328a846645a7b2a0c68551.yml
3+
openapi_spec_hash: 4750dcce77e6b76b240f058d9ecd06ad
44
config_hash: a69d5c502ffbfb11a2c8ec61ca5823e9

src/supermemory/_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def profile(
294294
self,
295295
*,
296296
container_tag: str,
297+
threshold: float,
297298
q: str | Omit = omit,
298299
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
299300
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -309,6 +310,9 @@ def profile(
309310
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
310311
any other identifier you wish to use to filter memories.
311312
313+
threshold: Threshold for search results. Only results with a score above this threshold
314+
will be included.
315+
312316
q: Optional search query to include search results in the response
313317
314318
extra_headers: Send extra headers
@@ -324,6 +328,7 @@ def profile(
324328
body=maybe_transform(
325329
{
326330
"container_tag": container_tag,
331+
"threshold": threshold,
327332
"q": q,
328333
},
329334
client_profile_params.ClientProfileParams,
@@ -592,6 +597,7 @@ async def profile(
592597
self,
593598
*,
594599
container_tag: str,
600+
threshold: float,
595601
q: str | Omit = omit,
596602
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
597603
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -607,6 +613,9 @@ async def profile(
607613
container_tag: Tag to filter the profile by. This can be an ID for your user, a project ID, or
608614
any other identifier you wish to use to filter memories.
609615
616+
threshold: Threshold for search results. Only results with a score above this threshold
617+
will be included.
618+
610619
q: Optional search query to include search results in the response
611620
612621
extra_headers: Send extra headers
@@ -622,6 +631,7 @@ async def profile(
622631
body=await async_maybe_transform(
623632
{
624633
"container_tag": container_tag,
634+
"threshold": threshold,
625635
"q": q,
626636
},
627637
client_profile_params.ClientProfileParams,

src/supermemory/types/client_profile_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@ class ClientProfileParams(TypedDict, total=False):
1717
to use to filter memories.
1818
"""
1919

20+
threshold: Required[float]
21+
"""Threshold for search results.
22+
23+
Only results with a score above this threshold will be included.
24+
"""
25+
2026
q: str
2127
"""Optional search query to include search results in the response"""

tests/api_resources/test_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def test_streaming_response_add(self, client: Supermemory) -> None:
6868
def test_method_profile(self, client: Supermemory) -> None:
6969
client_ = client.profile(
7070
container_tag="containerTag",
71+
threshold=0,
7172
)
7273
assert_matches_type(ProfileResponse, client_, path=["response"])
7374

@@ -76,6 +77,7 @@ def test_method_profile(self, client: Supermemory) -> None:
7677
def test_method_profile_with_all_params(self, client: Supermemory) -> None:
7778
client_ = client.profile(
7879
container_tag="containerTag",
80+
threshold=0,
7981
q="q",
8082
)
8183
assert_matches_type(ProfileResponse, client_, path=["response"])
@@ -85,6 +87,7 @@ def test_method_profile_with_all_params(self, client: Supermemory) -> None:
8587
def test_raw_response_profile(self, client: Supermemory) -> None:
8688
response = client.with_raw_response.profile(
8789
container_tag="containerTag",
90+
threshold=0,
8891
)
8992

9093
assert response.is_closed is True
@@ -97,6 +100,7 @@ def test_raw_response_profile(self, client: Supermemory) -> None:
97100
def test_streaming_response_profile(self, client: Supermemory) -> None:
98101
with client.with_streaming_response.profile(
99102
container_tag="containerTag",
103+
threshold=0,
100104
) as response:
101105
assert not response.is_closed
102106
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -163,6 +167,7 @@ async def test_streaming_response_add(self, async_client: AsyncSupermemory) -> N
163167
async def test_method_profile(self, async_client: AsyncSupermemory) -> None:
164168
client = await async_client.profile(
165169
container_tag="containerTag",
170+
threshold=0,
166171
)
167172
assert_matches_type(ProfileResponse, client, path=["response"])
168173

@@ -171,6 +176,7 @@ async def test_method_profile(self, async_client: AsyncSupermemory) -> None:
171176
async def test_method_profile_with_all_params(self, async_client: AsyncSupermemory) -> None:
172177
client = await async_client.profile(
173178
container_tag="containerTag",
179+
threshold=0,
174180
q="q",
175181
)
176182
assert_matches_type(ProfileResponse, client, path=["response"])
@@ -180,6 +186,7 @@ async def test_method_profile_with_all_params(self, async_client: AsyncSupermemo
180186
async def test_raw_response_profile(self, async_client: AsyncSupermemory) -> None:
181187
response = await async_client.with_raw_response.profile(
182188
container_tag="containerTag",
189+
threshold=0,
183190
)
184191

185192
assert response.is_closed is True
@@ -192,6 +199,7 @@ async def test_raw_response_profile(self, async_client: AsyncSupermemory) -> Non
192199
async def test_streaming_response_profile(self, async_client: AsyncSupermemory) -> None:
193200
async with async_client.with_streaming_response.profile(
194201
container_tag="containerTag",
202+
threshold=0,
195203
) as response:
196204
assert not response.is_closed
197205
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)