Skip to content

Commit 3e6314d

Browse files
feat(api): manual updates
1 parent 4a6b77a commit 3e6314d

File tree

5 files changed

+23
-39
lines changed

5 files changed

+23
-39
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: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-9f6d4050800c7cde90cbc3d1b59c782955e3cc1f73790c13a1924a000e09ec14.yml
3-
openapi_spec_hash: 92739eccad02248cc2bf07874e299fec
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-0293efeddbd48f43b5336c0d87e7862d61de0ad5b5da8c3c17f93da5d8a8edca.yml
3+
openapi_spec_hash: e94bf330ad1fa4adeea8533abed19be8
44
config_hash: 3a000ea344f2f52c50cf06452fcf52ca

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from supermemory.types import (
1414

1515
Methods:
1616

17-
- <code title="patch /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">update</a>(path_id, \*\*<a href="src/supermemory/types/memory_update_params.py">params</a>) -> <a href="./src/supermemory/types/memory_update_response.py">MemoryUpdateResponse</a></code>
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>
1818
- <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>
1919
- <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>
2020
- <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: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ def with_streaming_response(self) -> MemoriesResourceWithStreamingResponse:
5050

5151
def update(
5252
self,
53-
path_id: str,
53+
id: str,
5454
*,
55-
body_id: str,
5655
content: str,
5756
container_tags: List[str] | NotGiven = NOT_GIVEN,
5857
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
@@ -75,13 +74,12 @@ def update(
7574
7675
timeout: Override the client-level default timeout for this request, in seconds
7776
"""
78-
if not path_id:
79-
raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}")
77+
if not id:
78+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
8079
return self._patch(
81-
f"/v3/memories/{path_id}",
80+
f"/v3/memories/{id}",
8281
body=maybe_transform(
8382
{
84-
"body_id": body_id,
8583
"content": content,
8684
"container_tags": container_tags,
8785
"metadata": metadata,
@@ -282,9 +280,8 @@ def with_streaming_response(self) -> AsyncMemoriesResourceWithStreamingResponse:
282280

283281
async def update(
284282
self,
285-
path_id: str,
283+
id: str,
286284
*,
287-
body_id: str,
288285
content: str,
289286
container_tags: List[str] | NotGiven = NOT_GIVEN,
290287
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
@@ -307,13 +304,12 @@ async def update(
307304
308305
timeout: Override the client-level default timeout for this request, in seconds
309306
"""
310-
if not path_id:
311-
raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}")
307+
if not id:
308+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
312309
return await self._patch(
313-
f"/v3/memories/{path_id}",
310+
f"/v3/memories/{id}",
314311
body=await async_maybe_transform(
315312
{
316-
"body_id": body_id,
317313
"content": content,
318314
"container_tags": container_tags,
319315
"metadata": metadata,

src/supermemory/types/memory_update_params.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212

1313
class MemoryUpdateParams(TypedDict, total=False):
14-
body_id: Required[Annotated[str, PropertyInfo(alias="id")]]
15-
1614
content: Required[str]
1715

1816
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]

tests/api_resources/test_memories.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class TestMemories:
2727
@parametrize
2828
def test_method_update(self, client: Supermemory) -> None:
2929
memory = client.memories.update(
30-
path_id="id",
31-
body_id="acxV5LHMEsG2hMSNb4umbn",
30+
id="id",
3231
content="This is a detailed article about machine learning concepts...",
3332
)
3433
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
@@ -37,8 +36,7 @@ def test_method_update(self, client: Supermemory) -> None:
3736
@parametrize
3837
def test_method_update_with_all_params(self, client: Supermemory) -> None:
3938
memory = client.memories.update(
40-
path_id="id",
41-
body_id="acxV5LHMEsG2hMSNb4umbn",
39+
id="id",
4240
content="This is a detailed article about machine learning concepts...",
4341
container_tags=["string"],
4442
metadata={
@@ -56,8 +54,7 @@ def test_method_update_with_all_params(self, client: Supermemory) -> None:
5654
@parametrize
5755
def test_raw_response_update(self, client: Supermemory) -> None:
5856
response = client.memories.with_raw_response.update(
59-
path_id="id",
60-
body_id="acxV5LHMEsG2hMSNb4umbn",
57+
id="id",
6158
content="This is a detailed article about machine learning concepts...",
6259
)
6360

@@ -70,8 +67,7 @@ def test_raw_response_update(self, client: Supermemory) -> None:
7067
@parametrize
7168
def test_streaming_response_update(self, client: Supermemory) -> None:
7269
with client.memories.with_streaming_response.update(
73-
path_id="id",
74-
body_id="acxV5LHMEsG2hMSNb4umbn",
70+
id="id",
7571
content="This is a detailed article about machine learning concepts...",
7672
) as response:
7773
assert not response.is_closed
@@ -85,10 +81,9 @@ def test_streaming_response_update(self, client: Supermemory) -> None:
8581
@pytest.mark.skip()
8682
@parametrize
8783
def test_path_params_update(self, client: Supermemory) -> None:
88-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_id` but received ''"):
84+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
8985
client.memories.with_raw_response.update(
90-
path_id="",
91-
body_id="acxV5LHMEsG2hMSNb4umbn",
86+
id="",
9287
content="This is a detailed article about machine learning concepts...",
9388
)
9489

@@ -275,8 +270,7 @@ class TestAsyncMemories:
275270
@parametrize
276271
async def test_method_update(self, async_client: AsyncSupermemory) -> None:
277272
memory = await async_client.memories.update(
278-
path_id="id",
279-
body_id="acxV5LHMEsG2hMSNb4umbn",
273+
id="id",
280274
content="This is a detailed article about machine learning concepts...",
281275
)
282276
assert_matches_type(MemoryUpdateResponse, memory, path=["response"])
@@ -285,8 +279,7 @@ async def test_method_update(self, async_client: AsyncSupermemory) -> None:
285279
@parametrize
286280
async def test_method_update_with_all_params(self, async_client: AsyncSupermemory) -> None:
287281
memory = await async_client.memories.update(
288-
path_id="id",
289-
body_id="acxV5LHMEsG2hMSNb4umbn",
282+
id="id",
290283
content="This is a detailed article about machine learning concepts...",
291284
container_tags=["string"],
292285
metadata={
@@ -304,8 +297,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncSupermemor
304297
@parametrize
305298
async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None:
306299
response = await async_client.memories.with_raw_response.update(
307-
path_id="id",
308-
body_id="acxV5LHMEsG2hMSNb4umbn",
300+
id="id",
309301
content="This is a detailed article about machine learning concepts...",
310302
)
311303

@@ -318,8 +310,7 @@ async def test_raw_response_update(self, async_client: AsyncSupermemory) -> None
318310
@parametrize
319311
async def test_streaming_response_update(self, async_client: AsyncSupermemory) -> None:
320312
async with async_client.memories.with_streaming_response.update(
321-
path_id="id",
322-
body_id="acxV5LHMEsG2hMSNb4umbn",
313+
id="id",
323314
content="This is a detailed article about machine learning concepts...",
324315
) as response:
325316
assert not response.is_closed
@@ -333,10 +324,9 @@ async def test_streaming_response_update(self, async_client: AsyncSupermemory) -
333324
@pytest.mark.skip()
334325
@parametrize
335326
async def test_path_params_update(self, async_client: AsyncSupermemory) -> None:
336-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_id` but received ''"):
327+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
337328
await async_client.memories.with_raw_response.update(
338-
path_id="",
339-
body_id="acxV5LHMEsG2hMSNb4umbn",
329+
id="",
340330
content="This is a detailed article about machine learning concepts...",
341331
)
342332

0 commit comments

Comments
 (0)