Skip to content

Commit b614732

Browse files
feat(api): api update
1 parent 3e32da8 commit b614732

File tree

9 files changed

+67
-121
lines changed

9 files changed

+67
-121
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: 16
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-1a2a84a9cc99c25a9d726bc9300a72871f9469e3ceacebd5e71fd37e87891318.yml
3-
openapi_spec_hash: e71e86a645bc47a86664080c8697b8db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-09da5c3ffd6340714c6cb0068dc6b708becce683de2ea324d03f402cf5113b16.yml
3+
openapi_spec_hash: 7f6021bcb2388695b04edb0575904421
44
config_hash: be10c837d5319a33f30809a3ec223caf

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ from supermemory import Supermemory
127127
client = Supermemory()
128128

129129
try:
130-
client.memories.add(
131-
content="This is a detailed article about machine learning concepts...",
132-
)
130+
client.memories.add()
133131
except supermemory.APIConnectionError as e:
134132
print("The server could not be reached")
135133
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -172,9 +170,7 @@ client = Supermemory(
172170
)
173171

174172
# Or, configure per-request:
175-
client.with_options(max_retries=5).memories.add(
176-
content="This is a detailed article about machine learning concepts...",
177-
)
173+
client.with_options(max_retries=5).memories.add()
178174
```
179175

180176
### Timeouts
@@ -197,9 +193,7 @@ client = Supermemory(
197193
)
198194

199195
# Override per-request:
200-
client.with_options(timeout=5.0).memories.add(
201-
content="This is a detailed article about machine learning concepts...",
202-
)
196+
client.with_options(timeout=5.0).memories.add()
203197
```
204198

205199
On timeout, an `APITimeoutError` is thrown.
@@ -240,9 +234,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
240234
from supermemory import Supermemory
241235

242236
client = Supermemory()
243-
response = client.memories.with_raw_response.add(
244-
content="This is a detailed article about machine learning concepts...",
245-
)
237+
response = client.memories.with_raw_response.add()
246238
print(response.headers.get('X-My-Header'))
247239

248240
memory = response.parse() # get the object that `memories.add()` would have returned
@@ -260,9 +252,7 @@ The above interface eagerly reads the full response body when you make the reque
260252
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
261253

262254
```python
263-
with client.memories.with_streaming_response.add(
264-
content="This is a detailed article about machine learning concepts...",
265-
) as response:
255+
with client.memories.with_streaming_response.add() as response:
266256
print(response.headers.get("X-My-Header"))
267257

268258
for line in response.iter_lines():

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ httpx==0.28.1
5656
# via httpx-aiohttp
5757
# via respx
5858
# via supermemory
59-
httpx-aiohttp==0.1.6
59+
httpx-aiohttp==0.1.8
6060
# via supermemory
6161
idna==3.4
6262
# via anyio

requirements.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ httpcore==1.0.2
4343
httpx==0.28.1
4444
# via httpx-aiohttp
4545
# via supermemory
46-
httpx-aiohttp==0.1.6
46+
httpx-aiohttp==0.1.8
4747
# via supermemory
4848
idna==3.4
4949
# via anyio

src/supermemory/resources/memories.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def update(
5151
self,
5252
id: str,
5353
*,
54-
content: str,
5554
container_tags: List[str] | NotGiven = NOT_GIVEN,
55+
content: str | NotGiven = NOT_GIVEN,
5656
custom_id: str | NotGiven = NOT_GIVEN,
5757
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
5858
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -66,6 +66,9 @@ def update(
6666
Update a memory with any content type (text, url, file, etc.) and metadata
6767
6868
Args:
69+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
70+
user, a project ID, or any other identifier you wish to use to group memories.
71+
6972
content: The content to extract and process into a memory. This can be a URL to a
7073
website, a PDF, an image, or a video.
7174
@@ -75,9 +78,6 @@ def update(
7578
7679
We automatically detect the content type from the url's response format.
7780
78-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
79-
user, a project ID, or any other identifier you wish to use to group memories.
80-
8181
custom_id: Optional custom ID of the memory. This could be an ID from your database that
8282
will uniquely identify this memory.
8383
@@ -101,8 +101,8 @@ def update(
101101
f"/v3/memories/{id}",
102102
body=maybe_transform(
103103
{
104-
"content": content,
105104
"container_tags": container_tags,
105+
"content": content,
106106
"custom_id": custom_id,
107107
"metadata": metadata,
108108
},
@@ -211,8 +211,8 @@ def delete(
211211
def add(
212212
self,
213213
*,
214-
content: str,
215214
container_tags: List[str] | NotGiven = NOT_GIVEN,
215+
content: str | NotGiven = NOT_GIVEN,
216216
custom_id: str | NotGiven = NOT_GIVEN,
217217
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
218218
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -226,6 +226,9 @@ def add(
226226
Add a memory with any content type (text, url, file, etc.) and metadata
227227
228228
Args:
229+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
230+
user, a project ID, or any other identifier you wish to use to group memories.
231+
229232
content: The content to extract and process into a memory. This can be a URL to a
230233
website, a PDF, an image, or a video.
231234
@@ -235,9 +238,6 @@ def add(
235238
236239
We automatically detect the content type from the url's response format.
237240
238-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
239-
user, a project ID, or any other identifier you wish to use to group memories.
240-
241241
custom_id: Optional custom ID of the memory. This could be an ID from your database that
242242
will uniquely identify this memory.
243243
@@ -259,8 +259,8 @@ def add(
259259
"/v3/memories",
260260
body=maybe_transform(
261261
{
262-
"content": content,
263262
"container_tags": container_tags,
263+
"content": content,
264264
"custom_id": custom_id,
265265
"metadata": metadata,
266266
},
@@ -330,8 +330,8 @@ async def update(
330330
self,
331331
id: str,
332332
*,
333-
content: str,
334333
container_tags: List[str] | NotGiven = NOT_GIVEN,
334+
content: str | NotGiven = NOT_GIVEN,
335335
custom_id: str | NotGiven = NOT_GIVEN,
336336
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
337337
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -345,6 +345,9 @@ async def update(
345345
Update a memory with any content type (text, url, file, etc.) and metadata
346346
347347
Args:
348+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
349+
user, a project ID, or any other identifier you wish to use to group memories.
350+
348351
content: The content to extract and process into a memory. This can be a URL to a
349352
website, a PDF, an image, or a video.
350353
@@ -354,9 +357,6 @@ async def update(
354357
355358
We automatically detect the content type from the url's response format.
356359
357-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
358-
user, a project ID, or any other identifier you wish to use to group memories.
359-
360360
custom_id: Optional custom ID of the memory. This could be an ID from your database that
361361
will uniquely identify this memory.
362362
@@ -380,8 +380,8 @@ async def update(
380380
f"/v3/memories/{id}",
381381
body=await async_maybe_transform(
382382
{
383-
"content": content,
384383
"container_tags": container_tags,
384+
"content": content,
385385
"custom_id": custom_id,
386386
"metadata": metadata,
387387
},
@@ -490,8 +490,8 @@ async def delete(
490490
async def add(
491491
self,
492492
*,
493-
content: str,
494493
container_tags: List[str] | NotGiven = NOT_GIVEN,
494+
content: str | NotGiven = NOT_GIVEN,
495495
custom_id: str | NotGiven = NOT_GIVEN,
496496
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
497497
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -505,6 +505,9 @@ async def add(
505505
Add a memory with any content type (text, url, file, etc.) and metadata
506506
507507
Args:
508+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
509+
user, a project ID, or any other identifier you wish to use to group memories.
510+
508511
content: The content to extract and process into a memory. This can be a URL to a
509512
website, a PDF, an image, or a video.
510513
@@ -514,9 +517,6 @@ async def add(
514517
515518
We automatically detect the content type from the url's response format.
516519
517-
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
518-
user, a project ID, or any other identifier you wish to use to group memories.
519-
520520
custom_id: Optional custom ID of the memory. This could be an ID from your database that
521521
will uniquely identify this memory.
522522
@@ -538,8 +538,8 @@ async def add(
538538
"/v3/memories",
539539
body=await async_maybe_transform(
540540
{
541-
"content": content,
542541
"container_tags": container_tags,
542+
"content": content,
543543
"custom_id": custom_id,
544544
"metadata": metadata,
545545
},

src/supermemory/types/memory_add_params.py

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

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

88
from .._utils import PropertyInfo
99

1010
__all__ = ["MemoryAddParams"]
1111

1212

1313
class MemoryAddParams(TypedDict, total=False):
14-
content: Required[str]
14+
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
15+
"""Optional tags this memory should be containerized by.
16+
17+
This can be an ID for your user, a project ID, or any other identifier you wish
18+
to use to group memories.
19+
"""
20+
21+
content: str
1522
"""The content to extract and process into a memory.
1623
1724
This can be a URL to a website, a PDF, an image, or a video.
@@ -23,13 +30,6 @@ class MemoryAddParams(TypedDict, total=False):
2330
We automatically detect the content type from the url's response format.
2431
"""
2532

26-
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
27-
"""Optional tags this memory should be containerized by.
28-
29-
This can be an ID for your user, a project ID, or any other identifier you wish
30-
to use to group memories.
31-
"""
32-
3333
custom_id: Annotated[str, PropertyInfo(alias="customId")]
3434
"""Optional custom ID of the memory.
3535

src/supermemory/types/memory_update_params.py

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

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

88
from .._utils import PropertyInfo
99

1010
__all__ = ["MemoryUpdateParams"]
1111

1212

1313
class MemoryUpdateParams(TypedDict, total=False):
14-
content: Required[str]
14+
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
15+
"""Optional tags this memory should be containerized by.
16+
17+
This can be an ID for your user, a project ID, or any other identifier you wish
18+
to use to group memories.
19+
"""
20+
21+
content: str
1522
"""The content to extract and process into a memory.
1623
1724
This can be a URL to a website, a PDF, an image, or a video.
@@ -23,13 +30,6 @@ class MemoryUpdateParams(TypedDict, total=False):
2330
We automatically detect the content type from the url's response format.
2431
"""
2532

26-
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
27-
"""Optional tags this memory should be containerized by.
28-
29-
This can be an ID for your user, a project ID, or any other identifier you wish
30-
to use to group memories.
31-
"""
32-
3333
custom_id: Annotated[str, PropertyInfo(alias="customId")]
3434
"""Optional custom ID of the memory.
3535

0 commit comments

Comments
 (0)