supermemory 3.0.0a2__py3-none-any.whl → 3.0.0a20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {supermemory-3.0.0a2.dist-info → supermemory-3.0.0a20.dist-info}/METADATA +32 -32
- supermemory-3.0.0a20.dist-info/RECORD +60 -0
- {supermemory → supermemory_new}/__init__.py +2 -2
- {supermemory → supermemory_new}/_base_client.py +1 -1
- {supermemory → supermemory_new}/_client.py +11 -3
- {supermemory → supermemory_new}/_response.py +4 -4
- {supermemory → supermemory_new}/_types.py +1 -1
- {supermemory → supermemory_new}/_utils/_logs.py +2 -2
- {supermemory → supermemory_new}/_utils/_resources_proxy.py +4 -4
- supermemory_new/_version.py +4 -0
- {supermemory → supermemory_new}/resources/__init__.py +14 -0
- supermemory_new/resources/connections.py +728 -0
- {supermemory → supermemory_new}/resources/memories.py +135 -1
- supermemory_new/resources/search.py +300 -0
- supermemory_new/types/__init__.py +30 -0
- supermemory_new/types/connection_delete_by_provider_params.py +15 -0
- supermemory_new/types/connection_delete_by_provider_response.py +11 -0
- supermemory/types/connection_get_response.py → supermemory_new/types/connection_get_by_id_response.py +2 -2
- supermemory_new/types/connection_get_by_tags_params.py +15 -0
- supermemory_new/types/connection_get_by_tags_response.py +25 -0
- supermemory_new/types/connection_import_params.py +15 -0
- supermemory_new/types/connection_list_documents_params.py +15 -0
- supermemory_new/types/connection_list_documents_response.py +29 -0
- supermemory_new/types/connection_list_params.py +15 -0
- supermemory_new/types/connection_list_response.py +29 -0
- supermemory_new/types/memory_list_params.py +34 -0
- supermemory_new/types/memory_list_response.py +91 -0
- supermemory_new/types/search_execute_params.py +93 -0
- supermemory_new/types/search_execute_response.py +55 -0
- supermemory/_version.py +0 -4
- supermemory/resources/connections.py +0 -273
- supermemory/types/__init__.py +0 -15
- supermemory-3.0.0a2.dist-info/RECORD +0 -46
- {supermemory-3.0.0a2.dist-info → supermemory-3.0.0a20.dist-info}/WHEEL +0 -0
- {supermemory-3.0.0a2.dist-info → supermemory-3.0.0a20.dist-info}/licenses/LICENSE +0 -0
- {supermemory → supermemory_new}/_compat.py +0 -0
- {supermemory → supermemory_new}/_constants.py +0 -0
- {supermemory → supermemory_new}/_exceptions.py +0 -0
- {supermemory → supermemory_new}/_files.py +0 -0
- {supermemory → supermemory_new}/_models.py +0 -0
- {supermemory → supermemory_new}/_qs.py +0 -0
- {supermemory → supermemory_new}/_resource.py +0 -0
- {supermemory → supermemory_new}/_streaming.py +0 -0
- {supermemory → supermemory_new}/_utils/__init__.py +0 -0
- {supermemory → supermemory_new}/_utils/_proxy.py +0 -0
- {supermemory → supermemory_new}/_utils/_reflection.py +0 -0
- {supermemory → supermemory_new}/_utils/_streams.py +0 -0
- {supermemory → supermemory_new}/_utils/_sync.py +0 -0
- {supermemory → supermemory_new}/_utils/_transform.py +0 -0
- {supermemory → supermemory_new}/_utils/_typing.py +0 -0
- {supermemory → supermemory_new}/_utils/_utils.py +0 -0
- {supermemory → supermemory_new}/lib/.keep +0 -0
- {supermemory → supermemory_new}/py.typed +0 -0
- {supermemory → supermemory_new}/resources/settings.py +0 -0
- {supermemory → supermemory_new}/types/connection_create_params.py +0 -0
- {supermemory → supermemory_new}/types/connection_create_response.py +0 -0
- {supermemory → supermemory_new}/types/memory_add_params.py +0 -0
- {supermemory → supermemory_new}/types/memory_add_response.py +0 -0
- {supermemory → supermemory_new}/types/memory_get_response.py +0 -0
- {supermemory → supermemory_new}/types/memory_update_params.py +0 -0
- {supermemory → supermemory_new}/types/memory_update_response.py +0 -0
- {supermemory → supermemory_new}/types/setting_get_response.py +0 -0
- {supermemory → supermemory_new}/types/setting_update_params.py +0 -0
- {supermemory → supermemory_new}/types/setting_update_response.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: supermemory
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.0.0a20
|
4
4
|
Summary: The official Python library for the supermemory API
|
5
5
|
Project-URL: Homepage, https://github.com/supermemoryai/python-sdk
|
6
6
|
Project-URL: Repository, https://github.com/supermemoryai/python-sdk
|
@@ -44,7 +44,7 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
44
44
|
|
45
45
|
## Documentation
|
46
46
|
|
47
|
-
The REST API documentation can be found on [docs.supermemory.
|
47
|
+
The REST API documentation can be found on [docs.supermemory.ai](https://docs.supermemory.ai). The full API of this library can be found in [api.md](https://github.com/supermemoryai/python-sdk/tree/main/api.md).
|
48
48
|
|
49
49
|
## Installation
|
50
50
|
|
@@ -59,16 +59,16 @@ The full API of this library can be found in [api.md](https://github.com/superme
|
|
59
59
|
|
60
60
|
```python
|
61
61
|
import os
|
62
|
-
from
|
62
|
+
from supermemory_new import Supermemory
|
63
63
|
|
64
64
|
client = Supermemory(
|
65
65
|
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
|
66
66
|
)
|
67
67
|
|
68
|
-
response = client.
|
69
|
-
|
68
|
+
response = client.search.execute(
|
69
|
+
q="documents related to python",
|
70
70
|
)
|
71
|
-
print(response.
|
71
|
+
print(response.results)
|
72
72
|
```
|
73
73
|
|
74
74
|
While you can provide an `api_key` keyword argument,
|
@@ -83,7 +83,7 @@ Simply import `AsyncSupermemory` instead of `Supermemory` and use `await` with e
|
|
83
83
|
```python
|
84
84
|
import os
|
85
85
|
import asyncio
|
86
|
-
from
|
86
|
+
from supermemory_new import AsyncSupermemory
|
87
87
|
|
88
88
|
client = AsyncSupermemory(
|
89
89
|
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
|
@@ -91,10 +91,10 @@ client = AsyncSupermemory(
|
|
91
91
|
|
92
92
|
|
93
93
|
async def main() -> None:
|
94
|
-
response = await client.
|
95
|
-
|
94
|
+
response = await client.search.execute(
|
95
|
+
q="documents related to python",
|
96
96
|
)
|
97
|
-
print(response.
|
97
|
+
print(response.results)
|
98
98
|
|
99
99
|
|
100
100
|
asyncio.run(main())
|
@@ -118,8 +118,8 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
|
|
118
118
|
```python
|
119
119
|
import os
|
120
120
|
import asyncio
|
121
|
-
from
|
122
|
-
from
|
121
|
+
from supermemory_new import DefaultAioHttpClient
|
122
|
+
from supermemory_new import AsyncSupermemory
|
123
123
|
|
124
124
|
|
125
125
|
async def main() -> None:
|
@@ -127,10 +127,10 @@ async def main() -> None:
|
|
127
127
|
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
|
128
128
|
http_client=DefaultAioHttpClient(),
|
129
129
|
) as client:
|
130
|
-
response = await client.
|
131
|
-
|
130
|
+
response = await client.search.execute(
|
131
|
+
q="documents related to python",
|
132
132
|
)
|
133
|
-
print(response.
|
133
|
+
print(response.results)
|
134
134
|
|
135
135
|
|
136
136
|
asyncio.run(main())
|
@@ -147,16 +147,16 @@ Typed requests and responses provide autocomplete and documentation within your
|
|
147
147
|
|
148
148
|
## Handling errors
|
149
149
|
|
150
|
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `
|
150
|
+
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.
|
151
151
|
|
152
152
|
When the API returns a non-success status code (that is, 4xx or 5xx
|
153
|
-
response), a subclass of `
|
153
|
+
response), a subclass of `supermemory_new.APIStatusError` is raised, containing `status_code` and `response` properties.
|
154
154
|
|
155
|
-
All errors inherit from `
|
155
|
+
All errors inherit from `supermemory_new.APIError`.
|
156
156
|
|
157
157
|
```python
|
158
|
-
import
|
159
|
-
from
|
158
|
+
import supermemory_new
|
159
|
+
from supermemory_new import Supermemory
|
160
160
|
|
161
161
|
client = Supermemory()
|
162
162
|
|
@@ -164,12 +164,12 @@ try:
|
|
164
164
|
client.memories.add(
|
165
165
|
content="This is a detailed article about machine learning concepts...",
|
166
166
|
)
|
167
|
-
except
|
167
|
+
except supermemory_new.APIConnectionError as e:
|
168
168
|
print("The server could not be reached")
|
169
169
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
170
|
-
except
|
170
|
+
except supermemory_new.RateLimitError as e:
|
171
171
|
print("A 429 status code was received; we should back off a bit.")
|
172
|
-
except
|
172
|
+
except supermemory_new.APIStatusError as e:
|
173
173
|
print("Another non-200-range status code was received")
|
174
174
|
print(e.status_code)
|
175
175
|
print(e.response)
|
@@ -197,7 +197,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
197
197
|
You can use the `max_retries` option to configure or disable retry settings:
|
198
198
|
|
199
199
|
```python
|
200
|
-
from
|
200
|
+
from supermemory_new import Supermemory
|
201
201
|
|
202
202
|
# Configure the default for all requests:
|
203
203
|
client = Supermemory(
|
@@ -217,7 +217,7 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
217
217
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
218
218
|
|
219
219
|
```python
|
220
|
-
from
|
220
|
+
from supermemory_new import Supermemory
|
221
221
|
|
222
222
|
# Configure the default for all requests:
|
223
223
|
client = Supermemory(
|
@@ -271,7 +271,7 @@ if response.my_field is None:
|
|
271
271
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
272
272
|
|
273
273
|
```py
|
274
|
-
from
|
274
|
+
from supermemory_new import Supermemory
|
275
275
|
|
276
276
|
client = Supermemory()
|
277
277
|
response = client.memories.with_raw_response.add(
|
@@ -283,9 +283,9 @@ memory = response.parse() # get the object that `memories.add()` would have ret
|
|
283
283
|
print(memory.id)
|
284
284
|
```
|
285
285
|
|
286
|
-
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/
|
286
|
+
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory_new/_response.py) object.
|
287
287
|
|
288
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/
|
288
|
+
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.
|
289
289
|
|
290
290
|
#### `.with_streaming_response`
|
291
291
|
|
@@ -349,7 +349,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
349
349
|
|
350
350
|
```python
|
351
351
|
import httpx
|
352
|
-
from
|
352
|
+
from supermemory_new import Supermemory, DefaultHttpxClient
|
353
353
|
|
354
354
|
client = Supermemory(
|
355
355
|
# Or use the `SUPERMEMORY_BASE_URL` env var
|
@@ -372,7 +372,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
372
372
|
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.
|
373
373
|
|
374
374
|
```py
|
375
|
-
from
|
375
|
+
from supermemory_new import Supermemory
|
376
376
|
|
377
377
|
with Supermemory() as client:
|
378
378
|
# make requests here
|
@@ -400,8 +400,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
|
|
400
400
|
You can determine the version that is being used at runtime with:
|
401
401
|
|
402
402
|
```py
|
403
|
-
import
|
404
|
-
print(
|
403
|
+
import supermemory_new
|
404
|
+
print(supermemory_new.__version__)
|
405
405
|
```
|
406
406
|
|
407
407
|
## Requirements
|
@@ -0,0 +1,60 @@
|
|
1
|
+
supermemory_new/__init__.py,sha256=vJ_zHRctUVIuetfD7Izx4xJtWX2I2x7KWJCTNEUsGhE,2676
|
2
|
+
supermemory_new/_base_client.py,sha256=ac4Ewh_mPPBZRqodxI0Vi0XKADdpJnOD8XTvMi0zUMg,66724
|
3
|
+
supermemory_new/_client.py,sha256=2KcNz77blgIaQddenKFBrWXUqBG7IlP4vGuVYTix5bk,16890
|
4
|
+
supermemory_new/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
|
+
supermemory_new/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
6
|
+
supermemory_new/_exceptions.py,sha256=5nnX7W8L_eA6LkX3SBl7csJy5d9QEcDqRVuwDq8wVh8,3230
|
7
|
+
supermemory_new/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
|
8
|
+
supermemory_new/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
|
9
|
+
supermemory_new/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
10
|
+
supermemory_new/_resource.py,sha256=_wuaB1exMy-l-qqdJJdTv15hH5qBSN2Rj9CFwjXTZJU,1130
|
11
|
+
supermemory_new/_response.py,sha256=eeakb78kSNha9ybvYHYWEaIQnY4vqWoUjyUUrHJG8gM,28864
|
12
|
+
supermemory_new/_streaming.py,sha256=MGbosxSTqq0_JG52hvH2Z-Mr_Y95ws5UdFw77_iYukc,10120
|
13
|
+
supermemory_new/_types.py,sha256=fNeozFqUS0Y6kr4ZCiV-Lxl0s9ltl-l6IkETfdQx3NA,6206
|
14
|
+
supermemory_new/_version.py,sha256=kHG5r-DeMG96TLnqPqO3CR5SUtE6BquTLtWX0p_5j-M,176
|
15
|
+
supermemory_new/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
supermemory_new/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
|
+
supermemory_new/_utils/_logs.py,sha256=lzHhWp9VDelSwSGNWIkqO8CB4mBOYVjcCSZ7VFIIE3s,797
|
18
|
+
supermemory_new/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
|
19
|
+
supermemory_new/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
20
|
+
supermemory_new/_utils/_resources_proxy.py,sha256=kkXrtsLnl0X9xKNKuOovectHX8J0x8aU30kPlCtVWDE,634
|
21
|
+
supermemory_new/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
22
|
+
supermemory_new/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
23
|
+
supermemory_new/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
|
24
|
+
supermemory_new/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
|
25
|
+
supermemory_new/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
|
26
|
+
supermemory_new/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
27
|
+
supermemory_new/resources/__init__.py,sha256=c1dal-ngMY7gwIf9PDPapYx6rHi670pREX5t3_d6298,2019
|
28
|
+
supermemory_new/resources/connections.py,sha256=fEE_dmDdAXQNud-sF317c-JRDl3wkR2wZOF5-8pWbGQ,29973
|
29
|
+
supermemory_new/resources/memories.py,sha256=CfPV7qua5Rn-Yhf-UbaNpoSctQK1o86IJqoDzSTRcUo,26349
|
30
|
+
supermemory_new/resources/search.py,sha256=9JIv99mPiAlWCEZ41QxAzN4bteCwyo6UCEL3Our-flo,12546
|
31
|
+
supermemory_new/resources/settings.py,sha256=hzijwhQ9U_W5zDRbDjW27QdQU4CwqLkPRWkcALYSCok,12175
|
32
|
+
supermemory_new/types/__init__.py,sha256=gOnWZ-msfXi1URKxYOHN2P57rjnCUCDHbpqaISjjuq0,2244
|
33
|
+
supermemory_new/types/connection_create_params.py,sha256=bYYKu3ns60PX6Mt34UQUpYwThB3SBZsKn5tW0c46DUM,630
|
34
|
+
supermemory_new/types/connection_create_response.py,sha256=i4sb0DSRs7wVVd8xDBOtr7vw-YbaeZ7MydlQLYvlvJs,468
|
35
|
+
supermemory_new/types/connection_delete_by_provider_params.py,sha256=VnVud6ADbvdYY37BqZ8T-s3wC4xuvbiztge96OuzigM,528
|
36
|
+
supermemory_new/types/connection_delete_by_provider_response.py,sha256=PgMQuSIhVFSF2LVa0FBei2bj3gyVRB7FyOi_-M-Rugc,255
|
37
|
+
supermemory_new/types/connection_get_by_id_response.py,sha256=IDJYDLxiuun1XiOdEnENe78zQIbM6YJy2IW3X7mStAA,614
|
38
|
+
supermemory_new/types/connection_get_by_tags_params.py,sha256=kPQfi7nrM3DbarVx8_Nlq20hVEqelPmfouizAZ6NHDY,504
|
39
|
+
supermemory_new/types/connection_get_by_tags_response.py,sha256=JLmGSgNS46arQgz8ohIPn8kphfG8HB5eMu7GPdJFqzI,618
|
40
|
+
supermemory_new/types/connection_import_params.py,sha256=HbMAE6vjmhpJk4shqa9d78hxh_q3J6hdST8GUKGEopM,488
|
41
|
+
supermemory_new/types/connection_list_documents_params.py,sha256=pXMe7sDpqSwBVjPsY2qyTep6rlnfnzE150WdY0-CnOU,500
|
42
|
+
supermemory_new/types/connection_list_documents_response.py,sha256=0IdHufx0yErjfmoXYeY0KJ2QID9C-_58joyGEuu8gd4,682
|
43
|
+
supermemory_new/types/connection_list_params.py,sha256=E0thiUUlyGHeLmb-iAbat1vl8BOqaqCOPDjtYolKkng,482
|
44
|
+
supermemory_new/types/connection_list_response.py,sha256=ZwrRv6zICkn4-M-92ZgDZ2NiVHAEAJZKLZEcu_h_gO4,759
|
45
|
+
supermemory_new/types/memory_add_params.py,sha256=QG_aD0YXTJ8aSzwlKkv18nkrzl3asUakfFfR65mk9ss,1528
|
46
|
+
supermemory_new/types/memory_add_response.py,sha256=5lim8sVXM7WzG8tUuKORHEe2lJc6yVWvyjylzNsLGjw,219
|
47
|
+
supermemory_new/types/memory_get_response.py,sha256=sSCvX54IIoaVuifygi0IxiwHMKNNIGgg8eJJ-xu37BI,2850
|
48
|
+
supermemory_new/types/memory_list_params.py,sha256=nE4fnYdubdjbGy5-7BxmSms6owZZIbv8PegZxRRzwjA,914
|
49
|
+
supermemory_new/types/memory_list_response.py,sha256=Lq2ChggQ1YCFQLi2M9u61hxRwGf2ib3p9_X8mywJF78,2620
|
50
|
+
supermemory_new/types/memory_update_params.py,sha256=swEIF-CfcxWGzsiT8O_AbtzkyujMiafZpbi2GEXPuuw,1534
|
51
|
+
supermemory_new/types/memory_update_response.py,sha256=fvfO9lGM8xv2EUOQfOSxqig6fx6-ykq7syW69er_2ng,225
|
52
|
+
supermemory_new/types/search_execute_params.py,sha256=8JRtcQ7G1TmG9JW-f1XwNmvT1llM6FsPx0kkQN1Ellw,3130
|
53
|
+
supermemory_new/types/search_execute_response.py,sha256=iyKh6SHeInl8BYIlvPVWXhfHBjrO6AgWt-1E76Dk8xw,1295
|
54
|
+
supermemory_new/types/setting_get_response.py,sha256=_CWSr9_-0alw57qSQOaMm-e_FsdXmxIRYhcmTMpdado,1789
|
55
|
+
supermemory_new/types/setting_update_params.py,sha256=EWbqdSsoTJohQ1nbEbBdAvtR5co_hh7huH6XZ-t7MRM,1854
|
56
|
+
supermemory_new/types/setting_update_response.py,sha256=Evd1U6QQDYyhD_hpKqS9k7ctvh0GNX4GHPdwBChVB44,1947
|
57
|
+
supermemory-3.0.0a20.dist-info/METADATA,sha256=twVHyE1RZWtNM8_26LWKyNLxF4Bq9Wro3OWKwA7ggak,14348
|
58
|
+
supermemory-3.0.0a20.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
59
|
+
supermemory-3.0.0a20.dist-info/licenses/LICENSE,sha256=M2NcpYEBpakciOULpWzo-xO2Lincf74gGwfaU00Sct0,11341
|
60
|
+
supermemory-3.0.0a20.dist-info/RECORD,,
|
@@ -89,12 +89,12 @@ _setup_logging()
|
|
89
89
|
# Update the __module__ attribute for exported symbols so that
|
90
90
|
# error messages point to this module instead of the module
|
91
91
|
# it was originally defined in, e.g.
|
92
|
-
#
|
92
|
+
# supermemory_new._exceptions.NotFoundError -> supermemory_new.NotFoundError
|
93
93
|
__locals = locals()
|
94
94
|
for __name in __all__:
|
95
95
|
if not __name.startswith("__"):
|
96
96
|
try:
|
97
|
-
__locals[__name].__module__ = "
|
97
|
+
__locals[__name].__module__ = "supermemory_new"
|
98
98
|
except (TypeError, AttributeError):
|
99
99
|
# Some of our exported symbols are builtins which we can't set attributes for.
|
100
100
|
pass
|
@@ -389,7 +389,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
389
389
|
|
390
390
|
if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
|
391
391
|
raise TypeError(
|
392
|
-
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `
|
392
|
+
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `supermemory_new.DEFAULT_MAX_RETRIES`"
|
393
393
|
)
|
394
394
|
|
395
395
|
def _enforce_trailing_slash(self, url: URL) -> URL:
|
@@ -21,7 +21,7 @@ from ._types import (
|
|
21
21
|
)
|
22
22
|
from ._utils import is_given, get_async_library
|
23
23
|
from ._version import __version__
|
24
|
-
from .resources import memories, settings, connections
|
24
|
+
from .resources import search, memories, settings, connections
|
25
25
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
26
26
|
from ._exceptions import APIStatusError, SupermemoryError
|
27
27
|
from ._base_client import (
|
@@ -44,6 +44,7 @@ __all__ = [
|
|
44
44
|
|
45
45
|
class Supermemory(SyncAPIClient):
|
46
46
|
memories: memories.MemoriesResource
|
47
|
+
search: search.SearchResource
|
47
48
|
settings: settings.SettingsResource
|
48
49
|
connections: connections.ConnectionsResource
|
49
50
|
with_raw_response: SupermemoryWithRawResponse
|
@@ -90,7 +91,7 @@ class Supermemory(SyncAPIClient):
|
|
90
91
|
if base_url is None:
|
91
92
|
base_url = os.environ.get("SUPERMEMORY_BASE_URL")
|
92
93
|
if base_url is None:
|
93
|
-
base_url = f"https://api.supermemory.ai
|
94
|
+
base_url = f"https://api.supermemory.ai"
|
94
95
|
|
95
96
|
super().__init__(
|
96
97
|
version=__version__,
|
@@ -104,6 +105,7 @@ class Supermemory(SyncAPIClient):
|
|
104
105
|
)
|
105
106
|
|
106
107
|
self.memories = memories.MemoriesResource(self)
|
108
|
+
self.search = search.SearchResource(self)
|
107
109
|
self.settings = settings.SettingsResource(self)
|
108
110
|
self.connections = connections.ConnectionsResource(self)
|
109
111
|
self.with_raw_response = SupermemoryWithRawResponse(self)
|
@@ -216,6 +218,7 @@ class Supermemory(SyncAPIClient):
|
|
216
218
|
|
217
219
|
class AsyncSupermemory(AsyncAPIClient):
|
218
220
|
memories: memories.AsyncMemoriesResource
|
221
|
+
search: search.AsyncSearchResource
|
219
222
|
settings: settings.AsyncSettingsResource
|
220
223
|
connections: connections.AsyncConnectionsResource
|
221
224
|
with_raw_response: AsyncSupermemoryWithRawResponse
|
@@ -262,7 +265,7 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
262
265
|
if base_url is None:
|
263
266
|
base_url = os.environ.get("SUPERMEMORY_BASE_URL")
|
264
267
|
if base_url is None:
|
265
|
-
base_url = f"https://api.supermemory.ai
|
268
|
+
base_url = f"https://api.supermemory.ai"
|
266
269
|
|
267
270
|
super().__init__(
|
268
271
|
version=__version__,
|
@@ -276,6 +279,7 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
276
279
|
)
|
277
280
|
|
278
281
|
self.memories = memories.AsyncMemoriesResource(self)
|
282
|
+
self.search = search.AsyncSearchResource(self)
|
279
283
|
self.settings = settings.AsyncSettingsResource(self)
|
280
284
|
self.connections = connections.AsyncConnectionsResource(self)
|
281
285
|
self.with_raw_response = AsyncSupermemoryWithRawResponse(self)
|
@@ -389,6 +393,7 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
389
393
|
class SupermemoryWithRawResponse:
|
390
394
|
def __init__(self, client: Supermemory) -> None:
|
391
395
|
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
|
396
|
+
self.search = search.SearchResourceWithRawResponse(client.search)
|
392
397
|
self.settings = settings.SettingsResourceWithRawResponse(client.settings)
|
393
398
|
self.connections = connections.ConnectionsResourceWithRawResponse(client.connections)
|
394
399
|
|
@@ -396,6 +401,7 @@ class SupermemoryWithRawResponse:
|
|
396
401
|
class AsyncSupermemoryWithRawResponse:
|
397
402
|
def __init__(self, client: AsyncSupermemory) -> None:
|
398
403
|
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
|
404
|
+
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
|
399
405
|
self.settings = settings.AsyncSettingsResourceWithRawResponse(client.settings)
|
400
406
|
self.connections = connections.AsyncConnectionsResourceWithRawResponse(client.connections)
|
401
407
|
|
@@ -403,6 +409,7 @@ class AsyncSupermemoryWithRawResponse:
|
|
403
409
|
class SupermemoryWithStreamedResponse:
|
404
410
|
def __init__(self, client: Supermemory) -> None:
|
405
411
|
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
|
412
|
+
self.search = search.SearchResourceWithStreamingResponse(client.search)
|
406
413
|
self.settings = settings.SettingsResourceWithStreamingResponse(client.settings)
|
407
414
|
self.connections = connections.ConnectionsResourceWithStreamingResponse(client.connections)
|
408
415
|
|
@@ -410,6 +417,7 @@ class SupermemoryWithStreamedResponse:
|
|
410
417
|
class AsyncSupermemoryWithStreamedResponse:
|
411
418
|
def __init__(self, client: AsyncSupermemory) -> None:
|
412
419
|
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
|
420
|
+
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
|
413
421
|
self.settings = settings.AsyncSettingsResourceWithStreamingResponse(client.settings)
|
414
422
|
self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections)
|
415
423
|
|
@@ -218,7 +218,7 @@ class BaseAPIResponse(Generic[R]):
|
|
218
218
|
and issubclass(origin, pydantic.BaseModel)
|
219
219
|
):
|
220
220
|
raise TypeError(
|
221
|
-
"Pydantic models must subclass our base model type, e.g. `from
|
221
|
+
"Pydantic models must subclass our base model type, e.g. `from supermemory_new import BaseModel`"
|
222
222
|
)
|
223
223
|
|
224
224
|
if (
|
@@ -285,7 +285,7 @@ class APIResponse(BaseAPIResponse[R]):
|
|
285
285
|
the `to` argument, e.g.
|
286
286
|
|
287
287
|
```py
|
288
|
-
from
|
288
|
+
from supermemory_new import BaseModel
|
289
289
|
|
290
290
|
|
291
291
|
class MyModel(BaseModel):
|
@@ -387,7 +387,7 @@ class AsyncAPIResponse(BaseAPIResponse[R]):
|
|
387
387
|
the `to` argument, e.g.
|
388
388
|
|
389
389
|
```py
|
390
|
-
from
|
390
|
+
from supermemory_new import BaseModel
|
391
391
|
|
392
392
|
|
393
393
|
class MyModel(BaseModel):
|
@@ -558,7 +558,7 @@ class AsyncStreamedBinaryAPIResponse(AsyncAPIResponse[bytes]):
|
|
558
558
|
class MissingStreamClassError(TypeError):
|
559
559
|
def __init__(self) -> None:
|
560
560
|
super().__init__(
|
561
|
-
"The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `
|
561
|
+
"The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `supermemory_new._streaming` for reference",
|
562
562
|
)
|
563
563
|
|
564
564
|
|
@@ -81,7 +81,7 @@ HttpxRequestFiles = Union[Mapping[str, HttpxFileTypes], Sequence[Tuple[str, Http
|
|
81
81
|
# This unfortunately means that you will either have
|
82
82
|
# to import this type and pass it explicitly:
|
83
83
|
#
|
84
|
-
# from
|
84
|
+
# from supermemory_new import NoneType
|
85
85
|
# client.get('/foo', cast_to=NoneType)
|
86
86
|
#
|
87
87
|
# or build it yourself:
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import os
|
2
2
|
import logging
|
3
3
|
|
4
|
-
logger: logging.Logger = logging.getLogger("
|
4
|
+
logger: logging.Logger = logging.getLogger("supermemory_new")
|
5
5
|
httpx_logger: logging.Logger = logging.getLogger("httpx")
|
6
6
|
|
7
7
|
|
8
8
|
def _basic_config() -> None:
|
9
|
-
# e.g. [2023-10-05 14:12:26 -
|
9
|
+
# e.g. [2023-10-05 14:12:26 - supermemory_new._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK"
|
10
10
|
logging.basicConfig(
|
11
11
|
format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s",
|
12
12
|
datefmt="%Y-%m-%d %H:%M:%S",
|
@@ -7,17 +7,17 @@ from ._proxy import LazyProxy
|
|
7
7
|
|
8
8
|
|
9
9
|
class ResourcesProxy(LazyProxy[Any]):
|
10
|
-
"""A proxy for the `
|
10
|
+
"""A proxy for the `supermemory_new.resources` module.
|
11
11
|
|
12
|
-
This is used so that we can lazily import `
|
13
|
-
needed *and* so that users can just import `
|
12
|
+
This is used so that we can lazily import `supermemory_new.resources` only when
|
13
|
+
needed *and* so that users can just import `supermemory_new` and reference `supermemory_new.resources`
|
14
14
|
"""
|
15
15
|
|
16
16
|
@override
|
17
17
|
def __load__(self) -> Any:
|
18
18
|
import importlib
|
19
19
|
|
20
|
-
mod = importlib.import_module("
|
20
|
+
mod = importlib.import_module("supermemory_new.resources")
|
21
21
|
return mod
|
22
22
|
|
23
23
|
|
@@ -1,5 +1,13 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
from .search import (
|
4
|
+
SearchResource,
|
5
|
+
AsyncSearchResource,
|
6
|
+
SearchResourceWithRawResponse,
|
7
|
+
AsyncSearchResourceWithRawResponse,
|
8
|
+
SearchResourceWithStreamingResponse,
|
9
|
+
AsyncSearchResourceWithStreamingResponse,
|
10
|
+
)
|
3
11
|
from .memories import (
|
4
12
|
MemoriesResource,
|
5
13
|
AsyncMemoriesResource,
|
@@ -32,6 +40,12 @@ __all__ = [
|
|
32
40
|
"AsyncMemoriesResourceWithRawResponse",
|
33
41
|
"MemoriesResourceWithStreamingResponse",
|
34
42
|
"AsyncMemoriesResourceWithStreamingResponse",
|
43
|
+
"SearchResource",
|
44
|
+
"AsyncSearchResource",
|
45
|
+
"SearchResourceWithRawResponse",
|
46
|
+
"AsyncSearchResourceWithRawResponse",
|
47
|
+
"SearchResourceWithStreamingResponse",
|
48
|
+
"AsyncSearchResourceWithStreamingResponse",
|
35
49
|
"SettingsResource",
|
36
50
|
"AsyncSettingsResource",
|
37
51
|
"SettingsResourceWithRawResponse",
|