Skip to content

Commit 7a81e80

Browse files
feat(api): api update
1 parent 820350b commit 7a81e80

File tree

8 files changed

+7
-272
lines changed

8 files changed

+7
-272
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-0293efeddbd48f43b5336c0d87e7862d61de0ad5b5da8c3c17f93da5d8a8edca.yml
3-
openapi_spec_hash: e94bf330ad1fa4adeea8533abed19be8
4-
config_hash: 26d0d4c1d69982549448a1e030e54663
1+
configured_endpoints: 10
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-3fa2583744becce1e91ec5ad18f45d2cf17778def3a8f70537a15b08c746c2fb.yml
3+
openapi_spec_hash: bf3c5827e7ddb8b32435aeb671fe7845
4+
config_hash: c8c1f2b0d63387d621f0cf066ae3379f

api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Types:
44

55
```python
66
from supermemory.types import (
7-
MemoryUpdateResponse,
87
MemoryListResponse,
98
MemoryDeleteResponse,
109
MemoryAddResponse,
@@ -14,7 +13,6 @@ from supermemory.types import (
1413

1514
Methods:
1615

17-
- <code title="patch /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">update</a>(id, \*\*<a href="src/supermemory/types/memory_update_params.py">params</a>) -> <a href="./src/supermemory/types/memory_update_response.py">MemoryUpdateResponse</a></code>
1816
- <code title="get /v3/memories">client.memories.<a href="./src/supermemory/resources/memories.py">list</a>(\*\*<a href="src/supermemory/types/memory_list_params.py">params</a>) -> <a href="./src/supermemory/types/memory_list_response.py">MemoryListResponse</a></code>
1917
- <code title="delete /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">delete</a>(id) -> <a href="./src/supermemory/types/memory_delete_response.py">MemoryDeleteResponse</a></code>
2018
- <code title="post /v3/memories">client.memories.<a href="./src/supermemory/resources/memories.py">add</a>(\*\*<a href="src/supermemory/types/memory_add_params.py">params</a>) -> <a href="./src/supermemory/types/memory_add_response.py">MemoryAddResponse</a></code>

src/supermemory/resources/memories.py

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import httpx
99

10-
from ..types import memory_add_params, memory_list_params, memory_update_params
10+
from ..types import memory_add_params, memory_list_params
1111
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1212
from .._utils import maybe_transform, async_maybe_transform
1313
from .._compat import cached_property
@@ -23,7 +23,6 @@
2323
from ..types.memory_get_response import MemoryGetResponse
2424
from ..types.memory_list_response import MemoryListResponse
2525
from ..types.memory_delete_response import MemoryDeleteResponse
26-
from ..types.memory_update_response import MemoryUpdateResponse
2726

2827
__all__ = ["MemoriesResource", "AsyncMemoriesResource"]
2928

@@ -48,50 +47,6 @@ def with_streaming_response(self) -> MemoriesResourceWithStreamingResponse:
4847
"""
4948
return MemoriesResourceWithStreamingResponse(self)
5049

51-
def update(
52-
self,
53-
id: str,
54-
*,
55-
content: str,
56-
container_tags: List[str] | NotGiven = NOT_GIVEN,
57-
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
58-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
59-
# The extra values given here take precedence over values defined on the client or passed to this method.
60-
extra_headers: Headers | None = None,
61-
extra_query: Query | None = None,
62-
extra_body: Body | None = None,
63-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64-
) -> MemoryUpdateResponse:
65-
"""
66-
Update a memory with any content type (text, url, file, etc.) and metadata
67-
68-
Args:
69-
extra_headers: Send extra headers
70-
71-
extra_query: Add additional query parameters to the request
72-
73-
extra_body: Add additional JSON properties to the request
74-
75-
timeout: Override the client-level default timeout for this request, in seconds
76-
"""
77-
if not id:
78-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
79-
return self._patch(
80-
f"/v3/memories/{id}",
81-
body=maybe_transform(
82-
{
83-
"content": content,
84-
"container_tags": container_tags,
85-
"metadata": metadata,
86-
},
87-
memory_update_params.MemoryUpdateParams,
88-
),
89-
options=make_request_options(
90-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
91-
),
92-
cast_to=MemoryUpdateResponse,
93-
)
94-
9550
def list(
9651
self,
9752
*,
@@ -278,50 +233,6 @@ def with_streaming_response(self) -> AsyncMemoriesResourceWithStreamingResponse:
278233
"""
279234
return AsyncMemoriesResourceWithStreamingResponse(self)
280235

281-
async def update(
282-
self,
283-
id: str,
284-
*,
285-
content: str,
286-
container_tags: List[str] | NotGiven = NOT_GIVEN,
287-
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
288-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
289-
# The extra values given here take precedence over values defined on the client or passed to this method.
290-
extra_headers: Headers | None = None,
291-
extra_query: Query | None = None,
292-
extra_body: Body | None = None,
293-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
294-
) -> MemoryUpdateResponse:
295-
"""
296-
Update a memory with any content type (text, url, file, etc.) and metadata
297-
298-
Args:
299-
extra_headers: Send extra headers
300-
301-
extra_query: Add additional query parameters to the request
302-
303-
extra_body: Add additional JSON properties to the request
304-
305-
timeout: Override the client-level default timeout for this request, in seconds
306-
"""
307-
if not id:
308-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
309-
return await self._patch(
310-
f"/v3/memories/{id}",
311-
body=await async_maybe_transform(
312-
{
313-
"content": content,
314-
"container_tags": container_tags,
315-
"metadata": metadata,
316-
},
317-
memory_update_params.MemoryUpdateParams,
318-
),
319-
options=make_request_options(
320-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
321-
),
322-
cast_to=MemoryUpdateResponse,
323-
)
324-
325236
async def list(
326237
self,
327238
*,
@@ -492,9 +403,6 @@ class MemoriesResourceWithRawResponse:
492403
def __init__(self, memories: MemoriesResource) -> None:
493404
self._memories = memories
494405

495-
self.update = to_raw_response_wrapper(
496-
memories.update,
497-
)
498406
self.list = to_raw_response_wrapper(
499407
memories.list,
500408
)
@@ -513,9 +421,6 @@ class AsyncMemoriesResourceWithRawResponse:
513421
def __init__(self, memories: AsyncMemoriesResource) -> None:
514422
self._memories = memories
515423

516-
self.update = async_to_raw_response_wrapper(
517-
memories.update,
518-
)
519424
self.list = async_to_raw_response_wrapper(
520425
memories.list,
521426
)
@@ -534,9 +439,6 @@ class MemoriesResourceWithStreamingResponse:
534439
def __init__(self, memories: MemoriesResource) -> None:
535440
self._memories = memories
536441

537-
self.update = to_streamed_response_wrapper(
538-
memories.update,
539-
)
540442
self.list = to_streamed_response_wrapper(
541443
memories.list,
542444
)
@@ -555,9 +457,6 @@ class AsyncMemoriesResourceWithStreamingResponse:
555457
def __init__(self, memories: AsyncMemoriesResource) -> None:
556458
self._memories = memories
557459

558-
self.update = async_to_streamed_response_wrapper(
559-
memories.update,
560-
)
561460
self.list = async_to_streamed_response_wrapper(
562461
memories.list,
563462
)

src/supermemory/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
from .memory_add_response import MemoryAddResponse as MemoryAddResponse
88
from .memory_get_response import MemoryGetResponse as MemoryGetResponse
99
from .memory_list_response import MemoryListResponse as MemoryListResponse
10-
from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
1110
from .setting_get_response import SettingGetResponse as SettingGetResponse
1211
from .search_execute_params import SearchExecuteParams as SearchExecuteParams
1312
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
1413
from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
15-
from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
1614
from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse
1715
from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
1816
from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse

src/supermemory/types/connection_create_response.py

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

99

1010
class ConnectionCreateResponse(BaseModel):
11-
id: str
12-
13-
auth_link: str = FieldInfo(alias="authLink")
14-
1511
expires_in: str = FieldInfo(alias="expiresIn")
12+
13+
magic_link: str = FieldInfo(alias="magicLink")

src/supermemory/types/memory_update_params.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/supermemory/types/memory_update_response.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/api_resources/test_memories.py

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
MemoryGetResponse,
1515
MemoryListResponse,
1616
MemoryDeleteResponse,
17-
MemoryUpdateResponse,
1817
)
1918

2019
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,70 +22,6 @@
2322
class TestMemories:
2423
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
2524

26-
@pytest.mark.skip()
27-
@parametrize
28-
def test_method_update(self, client: Supermemory) -> None:
29-
memory = client.memories.update(
30-
id="id",
31-
content="This is a detailed article about machine learning concepts...",
32-
)
33-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
34-
35-
@pytest.mark.skip()
36-
@parametrize
37-
def test_method_update_with_all_params(self, client: Supermemory) -> None:
38-
memory = client.memories.update(
39-
id="id",
40-
content="This is a detailed article about machine learning concepts...",
41-
container_tags=["string"],
42-
metadata={
43-
"source": "web",
44-
"category": "technology",
45-
"tag_1": "ai",
46-
"tag_2": "machine-learning",
47-
"readingTime": 5,
48-
"isPublic": True,
49-
},
50-
)
51-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
52-
53-
@pytest.mark.skip()
54-
@parametrize
55-
def test_raw_response_update(self, client: Supermemory) -> None:
56-
response = client.memories.with_raw_response.update(
57-
id="id",
58-
content="This is a detailed article about machine learning concepts...",
59-
)
60-
61-
assert response.is_closed is True
62-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
63-
memory = response.parse()
64-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
65-
66-
@pytest.mark.skip()
67-
@parametrize
68-
def test_streaming_response_update(self, client: Supermemory) -> None:
69-
with client.memories.with_streaming_response.update(
70-
id="id",
71-
content="This is a detailed article about machine learning concepts...",
72-
) as response:
73-
assert not response.is_closed
74-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
75-
76-
memory = response.parse()
77-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
78-
79-
assert cast(Any, response.is_closed) is True
80-
81-
@pytest.mark.skip()
82-
@parametrize
83-
def test_path_params_update(self, client: Supermemory) -> None:
84-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
85-
client.memories.with_raw_response.update(
86-
id="",
87-
content="This is a detailed article about machine learning concepts...",
88-
)
89-
9025
@pytest.mark.skip()
9126
@parametrize
9227
def test_method_list(self, client: Supermemory) -> None:
@@ -266,70 +201,6 @@ def test_path_params_get(self, client: Supermemory) -> None:
266201
class TestAsyncMemories:
267202
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
268203

269-
@pytest.mark.skip()
270-
@parametrize
271-
async def test_method_update(self, async_client: AsyncSupermemory) -> None:
272-
memory = await async_client.memories.update(
273-
id="id",
274-
content="This is a detailed article about machine learning concepts...",
275-
)
276-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
277-
278-
@pytest.mark.skip()
279-
@parametrize
280-
async def test_method_update_with_all_params(self, async_client: AsyncSupermemory) -> None:
281-
memory = await async_client.memories.update(
282-
id="id",
283-
content="This is a detailed article about machine learning concepts...",
284-
container_tags=["string"],
285-
metadata={
286-
"source": "web",
287-
"category": "technology",
288-
"tag_1": "ai",
289-
"tag_2": "machine-learning",
290-
"readingTime": 5,
291-
"isPublic": True,
292-
},
293-
)
294-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
295-
296-
@pytest.mark.skip()
297-
@parametrize
298-
async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None:
299-
response = await async_client.memories.with_raw_response.update(
300-
id="id",
301-
content="This is a detailed article about machine learning concepts...",
302-
)
303-
304-
assert response.is_closed is True
305-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
306-
memory = await response.parse()
307-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
308-
309-
@pytest.mark.skip()
310-
@parametrize
311-
async def test_streaming_response_update(self, async_client: AsyncSupermemory) -> None:
312-
async with async_client.memories.with_streaming_response.update(
313-
id="id",
314-
content="This is a detailed article about machine learning concepts...",
315-
) as response:
316-
assert not response.is_closed
317-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
318-
319-
memory = await response.parse()
320-
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
321-
322-
assert cast(Any, response.is_closed) is True
323-
324-
@pytest.mark.skip()
325-
@parametrize
326-
async def test_path_params_update(self, async_client: AsyncSupermemory) -> None:
327-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
328-
await async_client.memories.with_raw_response.update(
329-
id="",
330-
content="This is a detailed article about machine learning concepts...",
331-
)
332-
333204
@pytest.mark.skip()
334205
@parametrize
335206
async def test_method_list(self, async_client: AsyncSupermemory) -> None:

0 commit comments

Comments
 (0)