You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ from supermemory import Supermemory
160
160
client = Supermemory()
161
161
162
162
try:
163
-
client.memories.add(
163
+
client.add(
164
164
content="content",
165
165
)
166
166
except supermemory.APIConnectionError as e:
@@ -205,7 +205,7 @@ client = Supermemory(
205
205
)
206
206
207
207
# Or, configure per-request:
208
-
client.with_options(max_retries=5).memories.add(
208
+
client.with_options(max_retries=5).add(
209
209
content="content",
210
210
)
211
211
```
@@ -230,7 +230,7 @@ client = Supermemory(
230
230
)
231
231
232
232
# Override per-request:
233
-
client.with_options(timeout=5.0).memories.add(
233
+
client.with_options(timeout=5.0).add(
234
234
content="content",
235
235
)
236
236
```
@@ -273,13 +273,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
273
273
from supermemory import Supermemory
274
274
275
275
client = Supermemory()
276
-
response = client.memories.with_raw_response.add(
276
+
response = client.with_raw_response.add(
277
277
content="content",
278
278
)
279
279
print(response.headers.get('X-My-Header'))
280
280
281
-
memory= response.parse() # get the object that `memories.add()` would have returned
282
-
print(memory.id)
281
+
client= response.parse() # get the object that `add()` would have returned
282
+
print(client.id)
283
283
```
284
284
285
285
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object.
@@ -293,7 +293,7 @@ The above interface eagerly reads the full response body when you make the reque
293
293
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.
0 commit comments