Skip to content

Commit 2d9b26c

Browse files
feat(api): api update
1 parent c7e0c2c commit 2d9b26c

File tree

5 files changed

+134
-83
lines changed

5 files changed

+134
-83
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: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-c56ce3c876eec0737db8394bd6235bff8dc42314b6460f3365c06945749d8714.yml
3-
openapi_spec_hash: 9e633a8fe5c71fa8bd5cbc34073b7c52
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-1e11561ed34d9eb33445d7ef7b0f808d197d18862913ef09cfe6b26b8ccfd722.yml
3+
openapi_spec_hash: d6049696f057b0d0d81e25aca16b88a7
44
config_hash: 8477e3ee6fd596ab6ac911d052e4de79

src/supermemory/resources/memories.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing import Dict, List, Union
67
from typing_extensions import Literal
78

@@ -114,6 +115,7 @@ def update(
114115
cast_to=MemoryUpdateResponse,
115116
)
116117

118+
@typing_extensions.deprecated("deprecated")
117119
def list(
118120
self,
119121
*,
@@ -396,6 +398,7 @@ async def update(
396398
cast_to=MemoryUpdateResponse,
397399
)
398400

401+
@typing_extensions.deprecated("deprecated")
399402
async def list(
400403
self,
401404
*,
@@ -598,8 +601,10 @@ def __init__(self, memories: MemoriesResource) -> None:
598601
self.update = to_raw_response_wrapper(
599602
memories.update,
600603
)
601-
self.list = to_raw_response_wrapper(
602-
memories.list,
604+
self.list = ( # pyright: ignore[reportDeprecated]
605+
to_raw_response_wrapper(
606+
memories.list # pyright: ignore[reportDeprecated],
607+
)
603608
)
604609
self.delete = to_raw_response_wrapper(
605610
memories.delete,
@@ -619,8 +624,10 @@ def __init__(self, memories: AsyncMemoriesResource) -> None:
619624
self.update = async_to_raw_response_wrapper(
620625
memories.update,
621626
)
622-
self.list = async_to_raw_response_wrapper(
623-
memories.list,
627+
self.list = ( # pyright: ignore[reportDeprecated]
628+
async_to_raw_response_wrapper(
629+
memories.list # pyright: ignore[reportDeprecated],
630+
)
624631
)
625632
self.delete = async_to_raw_response_wrapper(
626633
memories.delete,
@@ -640,8 +647,10 @@ def __init__(self, memories: MemoriesResource) -> None:
640647
self.update = to_streamed_response_wrapper(
641648
memories.update,
642649
)
643-
self.list = to_streamed_response_wrapper(
644-
memories.list,
650+
self.list = ( # pyright: ignore[reportDeprecated]
651+
to_streamed_response_wrapper(
652+
memories.list # pyright: ignore[reportDeprecated],
653+
)
645654
)
646655
self.delete = to_streamed_response_wrapper(
647656
memories.delete,
@@ -661,8 +670,10 @@ def __init__(self, memories: AsyncMemoriesResource) -> None:
661670
self.update = async_to_streamed_response_wrapper(
662671
memories.update,
663672
)
664-
self.list = async_to_streamed_response_wrapper(
665-
memories.list,
673+
self.list = ( # pyright: ignore[reportDeprecated]
674+
async_to_streamed_response_wrapper(
675+
memories.list # pyright: ignore[reportDeprecated],
676+
)
666677
)
667678
self.delete = async_to_streamed_response_wrapper(
668679
memories.delete,

src/supermemory/resources/search.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
6+
57
import httpx
68

79
from ..types import search_execute_params
@@ -41,6 +43,7 @@ def with_streaming_response(self) -> SearchResourceWithStreamingResponse:
4143
"""
4244
return SearchResourceWithStreamingResponse(self)
4345

46+
@typing_extensions.deprecated("deprecated")
4447
def execute(
4548
self,
4649
*,
@@ -109,6 +112,7 @@ def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse:
109112
"""
110113
return AsyncSearchResourceWithStreamingResponse(self)
111114

115+
@typing_extensions.deprecated("deprecated")
112116
async def execute(
113117
self,
114118
*,
@@ -161,33 +165,41 @@ class SearchResourceWithRawResponse:
161165
def __init__(self, search: SearchResource) -> None:
162166
self._search = search
163167

164-
self.execute = to_raw_response_wrapper(
165-
search.execute,
168+
self.execute = ( # pyright: ignore[reportDeprecated]
169+
to_raw_response_wrapper(
170+
search.execute # pyright: ignore[reportDeprecated],
171+
)
166172
)
167173

168174

169175
class AsyncSearchResourceWithRawResponse:
170176
def __init__(self, search: AsyncSearchResource) -> None:
171177
self._search = search
172178

173-
self.execute = async_to_raw_response_wrapper(
174-
search.execute,
179+
self.execute = ( # pyright: ignore[reportDeprecated]
180+
async_to_raw_response_wrapper(
181+
search.execute # pyright: ignore[reportDeprecated],
182+
)
175183
)
176184

177185

178186
class SearchResourceWithStreamingResponse:
179187
def __init__(self, search: SearchResource) -> None:
180188
self._search = search
181189

182-
self.execute = to_streamed_response_wrapper(
183-
search.execute,
190+
self.execute = ( # pyright: ignore[reportDeprecated]
191+
to_streamed_response_wrapper(
192+
search.execute # pyright: ignore[reportDeprecated],
193+
)
184194
)
185195

186196

187197
class AsyncSearchResourceWithStreamingResponse:
188198
def __init__(self, search: AsyncSearchResource) -> None:
189199
self._search = search
190200

191-
self.execute = async_to_streamed_response_wrapper(
192-
search.execute,
201+
self.execute = ( # pyright: ignore[reportDeprecated]
202+
async_to_streamed_response_wrapper(
203+
search.execute # pyright: ignore[reportDeprecated],
204+
)
193205
)

tests/api_resources/test_memories.py

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
MemoryUpdateResponse,
1717
)
1818

19+
# pyright: reportDeprecated=false
20+
1921
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
2022

2123

@@ -90,26 +92,31 @@ def test_path_params_update(self, client: Supermemory) -> None:
9092
@pytest.mark.skip()
9193
@parametrize
9294
def test_method_list(self, client: Supermemory) -> None:
93-
memory = client.memories.list()
95+
with pytest.warns(DeprecationWarning):
96+
memory = client.memories.list()
97+
9498
assert_matches_type(MemoryListResponse, memory, path=["response"])
9599

96100
@pytest.mark.skip()
97101
@parametrize
98102
def test_method_list_with_all_params(self, client: Supermemory) -> None:
99-
memory = client.memories.list(
100-
container_tags=["user_123", "project_123"],
101-
filters='{"AND":[{"key":"group","value":"jira_users","negate":false},{"filterType":"numeric","key":"timestamp","value":"1742745777","negate":false,"numericOperator":">"}]}',
102-
limit="10",
103-
order="desc",
104-
page="1",
105-
sort="createdAt",
106-
)
103+
with pytest.warns(DeprecationWarning):
104+
memory = client.memories.list(
105+
container_tags=["user_123", "project_123"],
106+
filters='{"AND":[{"key":"group","value":"jira_users","negate":false},{"filterType":"numeric","key":"timestamp","value":"1742745777","negate":false,"numericOperator":">"}]}',
107+
limit="10",
108+
order="desc",
109+
page="1",
110+
sort="createdAt",
111+
)
112+
107113
assert_matches_type(MemoryListResponse, memory, path=["response"])
108114

109115
@pytest.mark.skip()
110116
@parametrize
111117
def test_raw_response_list(self, client: Supermemory) -> None:
112-
response = client.memories.with_raw_response.list()
118+
with pytest.warns(DeprecationWarning):
119+
response = client.memories.with_raw_response.list()
113120

114121
assert response.is_closed is True
115122
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -119,12 +126,13 @@ def test_raw_response_list(self, client: Supermemory) -> None:
119126
@pytest.mark.skip()
120127
@parametrize
121128
def test_streaming_response_list(self, client: Supermemory) -> None:
122-
with client.memories.with_streaming_response.list() as response:
123-
assert not response.is_closed
124-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
129+
with pytest.warns(DeprecationWarning):
130+
with client.memories.with_streaming_response.list() as response:
131+
assert not response.is_closed
132+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
125133

126-
memory = response.parse()
127-
assert_matches_type(MemoryListResponse, memory, path=["response"])
134+
memory = response.parse()
135+
assert_matches_type(MemoryListResponse, memory, path=["response"])
128136

129137
assert cast(Any, response.is_closed) is True
130138

@@ -336,26 +344,31 @@ async def test_path_params_update(self, async_client: AsyncSupermemory) -> None:
336344
@pytest.mark.skip()
337345
@parametrize
338346
async def test_method_list(self, async_client: AsyncSupermemory) -> None:
339-
memory = await async_client.memories.list()
347+
with pytest.warns(DeprecationWarning):
348+
memory = await async_client.memories.list()
349+
340350
assert_matches_type(MemoryListResponse, memory, path=["response"])
341351

342352
@pytest.mark.skip()
343353
@parametrize
344354
async def test_method_list_with_all_params(self, async_client: AsyncSupermemory) -> None:
345-
memory = await async_client.memories.list(
346-
container_tags=["user_123", "project_123"],
347-
filters='{"AND":[{"key":"group","value":"jira_users","negate":false},{"filterType":"numeric","key":"timestamp","value":"1742745777","negate":false,"numericOperator":">"}]}',
348-
limit="10",
349-
order="desc",
350-
page="1",
351-
sort="createdAt",
352-
)
355+
with pytest.warns(DeprecationWarning):
356+
memory = await async_client.memories.list(
357+
container_tags=["user_123", "project_123"],
358+
filters='{"AND":[{"key":"group","value":"jira_users","negate":false},{"filterType":"numeric","key":"timestamp","value":"1742745777","negate":false,"numericOperator":">"}]}',
359+
limit="10",
360+
order="desc",
361+
page="1",
362+
sort="createdAt",
363+
)
364+
353365
assert_matches_type(MemoryListResponse, memory, path=["response"])
354366

355367
@pytest.mark.skip()
356368
@parametrize
357369
async def test_raw_response_list(self, async_client: AsyncSupermemory) -> None:
358-
response = await async_client.memories.with_raw_response.list()
370+
with pytest.warns(DeprecationWarning):
371+
response = await async_client.memories.with_raw_response.list()
359372

360373
assert response.is_closed is True
361374
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -365,12 +378,13 @@ async def test_raw_response_list(self, async_client: AsyncSupermemory) -> None:
365378
@pytest.mark.skip()
366379
@parametrize
367380
async def test_streaming_response_list(self, async_client: AsyncSupermemory) -> None:
368-
async with async_client.memories.with_streaming_response.list() as response:
369-
assert not response.is_closed
370-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
381+
with pytest.warns(DeprecationWarning):
382+
async with async_client.memories.with_streaming_response.list() as response:
383+
assert not response.is_closed
384+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
371385

372-
memory = await response.parse()
373-
assert_matches_type(MemoryListResponse, memory, path=["response"])
386+
memory = await response.parse()
387+
assert_matches_type(MemoryListResponse, memory, path=["response"])
374388

375389
assert cast(Any, response.is_closed) is True
376390

0 commit comments

Comments
 (0)