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
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md).
25
25
26
26
```python
27
27
import os
28
-
fromsupermemory_newimport Supermemory
28
+
fromsupermemoryimport Supermemory
29
29
30
30
client = Supermemory(
31
31
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
@@ -49,7 +49,7 @@ Simply import `AsyncSupermemory` instead of `Supermemory` and use `await` with e
49
49
```python
50
50
import os
51
51
import asyncio
52
-
fromsupermemory_newimport AsyncSupermemory
52
+
fromsupermemoryimport AsyncSupermemory
53
53
54
54
client = AsyncSupermemory(
55
55
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
@@ -84,8 +84,8 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
84
84
```python
85
85
import os
86
86
import asyncio
87
-
fromsupermemory_newimport DefaultAioHttpClient
88
-
fromsupermemory_newimport AsyncSupermemory
87
+
fromsupermemoryimport DefaultAioHttpClient
88
+
fromsupermemoryimport AsyncSupermemory
89
89
90
90
91
91
asyncdefmain() -> None:
@@ -113,29 +113,29 @@ Typed requests and responses provide autocomplete and documentation within your
113
113
114
114
## Handling errors
115
115
116
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `supermemory_new.APIConnectionError` is raised.
116
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `supermemory.APIConnectionError` is raised.
117
117
118
118
When the API returns a non-success status code (that is, 4xx or 5xx
119
-
response), a subclass of `supermemory_new.APIStatusError` is raised, containing `status_code` and `response` properties.
119
+
response), a subclass of `supermemory.APIStatusError` is raised, containing `status_code` and `response` properties.
120
120
121
-
All errors inherit from `supermemory_new.APIError`.
121
+
All errors inherit from `supermemory.APIError`.
122
122
123
123
```python
124
-
importsupermemory_new
125
-
fromsupermemory_newimport Supermemory
124
+
importsupermemory
125
+
fromsupermemoryimport Supermemory
126
126
127
127
client = Supermemory()
128
128
129
129
try:
130
130
client.memories.add(
131
131
content="This is a detailed article about machine learning concepts...",
132
132
)
133
-
exceptsupermemory_new.APIConnectionError as e:
133
+
exceptsupermemory.APIConnectionError as e:
134
134
print("The server could not be reached")
135
135
print(e.__cause__) # an underlying Exception, likely raised within httpx.
136
-
exceptsupermemory_new.RateLimitError as e:
136
+
exceptsupermemory.RateLimitError as e:
137
137
print("A 429 status code was received; we should back off a bit.")
138
-
exceptsupermemory_new.APIStatusError as e:
138
+
exceptsupermemory.APIStatusError as e:
139
139
print("Another non-200-range status code was received")
140
140
print(e.status_code)
141
141
print(e.response)
@@ -163,7 +163,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
163
163
You can use the `max_retries` option to configure or disable retry settings:
164
164
165
165
```python
166
-
fromsupermemory_newimport Supermemory
166
+
fromsupermemoryimport Supermemory
167
167
168
168
# Configure the default for all requests:
169
169
client = Supermemory(
@@ -183,7 +183,7 @@ By default requests time out after 1 minute. You can configure this with a `time
183
183
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
184
184
185
185
```python
186
-
fromsupermemory_newimport Supermemory
186
+
fromsupermemoryimport Supermemory
187
187
188
188
# Configure the default for all requests:
189
189
client = Supermemory(
@@ -237,7 +237,7 @@ if response.my_field is None:
237
237
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
238
238
239
239
```py
240
-
fromsupermemory_newimport Supermemory
240
+
fromsupermemoryimport Supermemory
241
241
242
242
client = Supermemory()
243
243
response = client.memories.with_raw_response.add(
@@ -249,9 +249,9 @@ memory = response.parse() # get the object that `memories.add()` would have ret
249
249
print(memory.id)
250
250
```
251
251
252
-
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory_new/_response.py) object.
252
+
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object.
253
253
254
-
The async client returns an [`AsyncAPIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory_new/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
254
+
The async client returns an [`AsyncAPIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
255
255
256
256
#### `.with_streaming_response`
257
257
@@ -315,7 +315,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
339
339
340
340
```py
341
-
fromsupermemory_newimport Supermemory
341
+
fromsupermemoryimport Supermemory
342
342
343
343
with Supermemory() as client:
344
344
# make requests here
@@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
366
366
You can determine the version that is being used at runtime with:
0 commit comments