supermemory 0.1.0a1__tar.gz → 3.0.0a1__tar.gz
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.0a1/.release-please-manifest.json +3 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/CHANGELOG.md +37 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/PKG-INFO +24 -7
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/README.md +23 -6
- supermemory-3.0.0a1/api.md +66 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/pyproject.toml +1 -1
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/__init__.py +5 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_client.py +29 -29
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_files.py +1 -1
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_proxy.py +4 -1
- supermemory-3.0.0a1/src/supermemory/_utils/_resources_proxy.py +24 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_version.py +1 -1
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/resources/__init__.py +33 -33
- supermemory-0.1.0a1/src/supermemory/resources/connection.py → supermemory-3.0.0a1/src/supermemory/resources/connections.py +154 -61
- supermemory-0.1.0a1/src/supermemory/resources/memory.py → supermemory-3.0.0a1/src/supermemory/resources/memories.py +264 -88
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/resources/search.py +92 -50
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/resources/settings.py +58 -11
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/__init__.py +10 -2
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/connection_create_params.py +5 -2
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/connection_create_response.py +7 -1
- supermemory-3.0.0a1/src/supermemory/types/connection_get_response.py +21 -0
- supermemory-3.0.0a1/src/supermemory/types/connection_list_params.py +13 -0
- supermemory-3.0.0a1/src/supermemory/types/connection_list_response.py +25 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_add_params.py +18 -0
- supermemory-0.1.0a1/src/supermemory/types/memory_create_response.py → supermemory-3.0.0a1/src/supermemory/types/memory_add_response.py +2 -2
- supermemory-3.0.0a1/src/supermemory/types/memory_get_response.py +11 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_list_response.py +95 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_update_params.py +18 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_update_response.py +11 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_upload_file_params.py +13 -0
- supermemory-3.0.0a1/src/supermemory/types/memory_upload_file_response.py +11 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/search_execute_params.py +36 -6
- supermemory-3.0.0a1/src/supermemory/types/setting_get_response.py +11 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/setting_update_params.py +4 -12
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/setting_update_response.py +3 -11
- supermemory-3.0.0a1/tests/api_resources/test_connections.py +272 -0
- supermemory-0.1.0a1/tests/api_resources/test_memory.py → supermemory-3.0.0a1/tests/api_resources/test_memories.py +251 -55
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/api_resources/test_search.py +4 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/api_resources/test_settings.py +59 -15
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_client.py +27 -31
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_utils/test_proxy.py +11 -0
- supermemory-0.1.0a1/.release-please-manifest.json +0 -3
- supermemory-0.1.0a1/api.md +0 -56
- supermemory-0.1.0a1/src/supermemory/types/memory_create_params.py +0 -23
- supermemory-0.1.0a1/src/supermemory/types/memory_get_response.py +0 -27
- supermemory-0.1.0a1/src/supermemory/types/memory_list_response.py +0 -59
- supermemory-0.1.0a1/tests/api_resources/test_connection.py +0 -200
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/.gitignore +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/CONTRIBUTING.md +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/LICENSE +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/SECURITY.md +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/bin/check-release-environment +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/bin/publish-pypi +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/examples/.keep +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/mypy.ini +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/noxfile.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/release-please-config.json +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/requirements-dev.lock +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/requirements.lock +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_base_client.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_compat.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_constants.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_exceptions.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_models.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_qs.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_resource.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_response.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_streaming.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_types.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/__init__.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_logs.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_reflection.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_streams.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_sync.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_transform.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_typing.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/_utils/_utils.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/lib/.keep +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/py.typed +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/memory_delete_response.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/memory_list_params.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/src/supermemory/types/search_execute_response.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/__init__.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/api_resources/__init__.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/conftest.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/sample_file.txt +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_deepcopy.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_extract_files.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_files.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_models.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_qs.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_required_args.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_response.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_streaming.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_transform.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/test_utils/test_typing.py +0 -0
- {supermemory-0.1.0a1 → supermemory-3.0.0a1}/tests/utils.py +0 -0
@@ -1,5 +1,42 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.0.0-alpha.1 (2025-05-17)
|
4
|
+
|
5
|
+
Full Changelog: [v0.1.0-alpha.1...v3.0.0-alpha.1](https://github.com/supermemoryai/python-sdk/compare/v0.1.0-alpha.1...v3.0.0-alpha.1)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** api update ([aaf3546](https://github.com/supermemoryai/python-sdk/commit/aaf354623319d2e3f99031669a615d3af48c9dab))
|
10
|
+
* **api:** api update ([c0150ac](https://github.com/supermemoryai/python-sdk/commit/c0150acac7ccae7e89707909d9250028fc4d5251))
|
11
|
+
* **api:** api update ([063cf45](https://github.com/supermemoryai/python-sdk/commit/063cf45fced039b32de6f00fc4862a873d50451a))
|
12
|
+
* **api:** api update ([7a81e80](https://github.com/supermemoryai/python-sdk/commit/7a81e8027fd0c76041672c71345e18724e71c10f))
|
13
|
+
* **api:** api update ([722df63](https://github.com/supermemoryai/python-sdk/commit/722df6387d8fc3b38ee892d4382b19339a4b8165))
|
14
|
+
* **api:** api update ([4052bae](https://github.com/supermemoryai/python-sdk/commit/4052baeca12183552a9bda674e97310e77b93623))
|
15
|
+
* **api:** api update ([ed787b1](https://github.com/supermemoryai/python-sdk/commit/ed787b1abd49ebbc4e219f90bf71511306aafb2b))
|
16
|
+
* **api:** api update ([7c0db70](https://github.com/supermemoryai/python-sdk/commit/7c0db70ec61ccd64197c333592457b925782f1ce))
|
17
|
+
* **api:** api update ([844d56e](https://github.com/supermemoryai/python-sdk/commit/844d56ecd40cffb441c47050e5e820051d65af7e))
|
18
|
+
* **api:** api update ([fda6f9f](https://github.com/supermemoryai/python-sdk/commit/fda6f9f111dac7db4bba42779e967356b8615e3c))
|
19
|
+
* **api:** api update ([2403f1d](https://github.com/supermemoryai/python-sdk/commit/2403f1da4d83266ddf49ada0103c8f5d432bf966))
|
20
|
+
* **api:** manual updates ([3fd7de2](https://github.com/supermemoryai/python-sdk/commit/3fd7de29691be3303c91fd89189371a0ef7845dc))
|
21
|
+
* **api:** manual updates ([3e6314d](https://github.com/supermemoryai/python-sdk/commit/3e6314dba381eb65fe644941f2cca25dfcd93d3d))
|
22
|
+
* **api:** manual updates ([4a6b77a](https://github.com/supermemoryai/python-sdk/commit/4a6b77aa6cd55d7135e33cbfb1138d9b2d00d40a))
|
23
|
+
* **api:** manual updates ([5b0c810](https://github.com/supermemoryai/python-sdk/commit/5b0c81086db77a2ea5922d117f4e393475d2bd03))
|
24
|
+
* **api:** manual updates ([af34c01](https://github.com/supermemoryai/python-sdk/commit/af34c01553feba151893eea0f6a905078146424f))
|
25
|
+
* **api:** manual updates ([637811c](https://github.com/supermemoryai/python-sdk/commit/637811c4a31cfc9d258ca8562fee1cd38fb51320))
|
26
|
+
|
27
|
+
|
28
|
+
### Bug Fixes
|
29
|
+
|
30
|
+
* **package:** support direct resource imports ([aa29842](https://github.com/supermemoryai/python-sdk/commit/aa2984202e3ff68031618847bc5a438e5a42933f))
|
31
|
+
|
32
|
+
|
33
|
+
### Chores
|
34
|
+
|
35
|
+
* **ci:** fix installation instructions ([060e326](https://github.com/supermemoryai/python-sdk/commit/060e32620febdd50931ae4d6e692a527b36b99fe))
|
36
|
+
* **ci:** upload sdks to package manager ([a327d7d](https://github.com/supermemoryai/python-sdk/commit/a327d7ddd1836e1a15b30eb5fb33388fe2580229))
|
37
|
+
* **internal:** avoid errors for isinstance checks on proxies ([be6c667](https://github.com/supermemoryai/python-sdk/commit/be6c667dbff65c00fc7f3bd22e541b477c19ca08))
|
38
|
+
* **internal:** codegen related update ([c0d13e2](https://github.com/supermemoryai/python-sdk/commit/c0d13e254d08d459edc35def2c38774ce11fcd0d))
|
39
|
+
|
3
40
|
## 0.1.0-alpha.1 (2025-04-29)
|
4
41
|
|
5
42
|
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/supermemoryai/python-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: supermemory
|
3
|
-
Version: 0.
|
3
|
+
Version: 3.0.0a1
|
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
|
@@ -108,6 +108,23 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
108
108
|
|
109
109
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
110
110
|
|
111
|
+
## File uploads
|
112
|
+
|
113
|
+
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
114
|
+
|
115
|
+
```python
|
116
|
+
from pathlib import Path
|
117
|
+
from supermemory import Supermemory
|
118
|
+
|
119
|
+
client = Supermemory()
|
120
|
+
|
121
|
+
client.memories.upload_file(
|
122
|
+
file=Path("/path/to/file"),
|
123
|
+
)
|
124
|
+
```
|
125
|
+
|
126
|
+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
127
|
+
|
111
128
|
## Handling errors
|
112
129
|
|
113
130
|
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.
|
@@ -124,7 +141,7 @@ from supermemory import Supermemory
|
|
124
141
|
client = Supermemory()
|
125
142
|
|
126
143
|
try:
|
127
|
-
client.
|
144
|
+
client.memories.add(
|
128
145
|
content="This is a detailed article about machine learning concepts...",
|
129
146
|
)
|
130
147
|
except supermemory.APIConnectionError as e:
|
@@ -169,7 +186,7 @@ client = Supermemory(
|
|
169
186
|
)
|
170
187
|
|
171
188
|
# Or, configure per-request:
|
172
|
-
client.with_options(max_retries=5).
|
189
|
+
client.with_options(max_retries=5).memories.add(
|
173
190
|
content="This is a detailed article about machine learning concepts...",
|
174
191
|
)
|
175
192
|
```
|
@@ -194,7 +211,7 @@ client = Supermemory(
|
|
194
211
|
)
|
195
212
|
|
196
213
|
# Override per-request:
|
197
|
-
client.with_options(timeout=5.0).
|
214
|
+
client.with_options(timeout=5.0).memories.add(
|
198
215
|
content="This is a detailed article about machine learning concepts...",
|
199
216
|
)
|
200
217
|
```
|
@@ -237,12 +254,12 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
237
254
|
from supermemory import Supermemory
|
238
255
|
|
239
256
|
client = Supermemory()
|
240
|
-
response = client.
|
257
|
+
response = client.memories.with_raw_response.add(
|
241
258
|
content="This is a detailed article about machine learning concepts...",
|
242
259
|
)
|
243
260
|
print(response.headers.get('X-My-Header'))
|
244
261
|
|
245
|
-
memory = response.parse() # get the object that `
|
262
|
+
memory = response.parse() # get the object that `memories.add()` would have returned
|
246
263
|
print(memory.id)
|
247
264
|
```
|
248
265
|
|
@@ -257,7 +274,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
257
274
|
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.
|
258
275
|
|
259
276
|
```python
|
260
|
-
with client.
|
277
|
+
with client.memories.with_streaming_response.add(
|
261
278
|
content="This is a detailed article about machine learning concepts...",
|
262
279
|
) as response:
|
263
280
|
print(response.headers.get("X-My-Header"))
|
@@ -77,6 +77,23 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
77
77
|
|
78
78
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
79
79
|
|
80
|
+
## File uploads
|
81
|
+
|
82
|
+
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
83
|
+
|
84
|
+
```python
|
85
|
+
from pathlib import Path
|
86
|
+
from supermemory import Supermemory
|
87
|
+
|
88
|
+
client = Supermemory()
|
89
|
+
|
90
|
+
client.memories.upload_file(
|
91
|
+
file=Path("/path/to/file"),
|
92
|
+
)
|
93
|
+
```
|
94
|
+
|
95
|
+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
96
|
+
|
80
97
|
## Handling errors
|
81
98
|
|
82
99
|
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.
|
@@ -93,7 +110,7 @@ from supermemory import Supermemory
|
|
93
110
|
client = Supermemory()
|
94
111
|
|
95
112
|
try:
|
96
|
-
client.
|
113
|
+
client.memories.add(
|
97
114
|
content="This is a detailed article about machine learning concepts...",
|
98
115
|
)
|
99
116
|
except supermemory.APIConnectionError as e:
|
@@ -138,7 +155,7 @@ client = Supermemory(
|
|
138
155
|
)
|
139
156
|
|
140
157
|
# Or, configure per-request:
|
141
|
-
client.with_options(max_retries=5).
|
158
|
+
client.with_options(max_retries=5).memories.add(
|
142
159
|
content="This is a detailed article about machine learning concepts...",
|
143
160
|
)
|
144
161
|
```
|
@@ -163,7 +180,7 @@ client = Supermemory(
|
|
163
180
|
)
|
164
181
|
|
165
182
|
# Override per-request:
|
166
|
-
client.with_options(timeout=5.0).
|
183
|
+
client.with_options(timeout=5.0).memories.add(
|
167
184
|
content="This is a detailed article about machine learning concepts...",
|
168
185
|
)
|
169
186
|
```
|
@@ -206,12 +223,12 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
206
223
|
from supermemory import Supermemory
|
207
224
|
|
208
225
|
client = Supermemory()
|
209
|
-
response = client.
|
226
|
+
response = client.memories.with_raw_response.add(
|
210
227
|
content="This is a detailed article about machine learning concepts...",
|
211
228
|
)
|
212
229
|
print(response.headers.get('X-My-Header'))
|
213
230
|
|
214
|
-
memory = response.parse() # get the object that `
|
231
|
+
memory = response.parse() # get the object that `memories.add()` would have returned
|
215
232
|
print(memory.id)
|
216
233
|
```
|
217
234
|
|
@@ -226,7 +243,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
226
243
|
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.
|
227
244
|
|
228
245
|
```python
|
229
|
-
with client.
|
246
|
+
with client.memories.with_streaming_response.add(
|
230
247
|
content="This is a detailed article about machine learning concepts...",
|
231
248
|
) as response:
|
232
249
|
print(response.headers.get("X-My-Header"))
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Memories
|
2
|
+
|
3
|
+
Types:
|
4
|
+
|
5
|
+
```python
|
6
|
+
from supermemory.types import (
|
7
|
+
MemoryUpdateResponse,
|
8
|
+
MemoryListResponse,
|
9
|
+
MemoryDeleteResponse,
|
10
|
+
MemoryAddResponse,
|
11
|
+
MemoryGetResponse,
|
12
|
+
MemoryUploadFileResponse,
|
13
|
+
)
|
14
|
+
```
|
15
|
+
|
16
|
+
Methods:
|
17
|
+
|
18
|
+
- <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>
|
19
|
+
- <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>
|
20
|
+
- <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>
|
21
|
+
- <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>
|
22
|
+
- <code title="get /v3/memories/{id}">client.memories.<a href="./src/supermemory/resources/memories.py">get</a>(id) -> <a href="./src/supermemory/types/memory_get_response.py">MemoryGetResponse</a></code>
|
23
|
+
- <code title="post /v3/memories/file">client.memories.<a href="./src/supermemory/resources/memories.py">upload_file</a>(\*\*<a href="src/supermemory/types/memory_upload_file_params.py">params</a>) -> <a href="./src/supermemory/types/memory_upload_file_response.py">MemoryUploadFileResponse</a></code>
|
24
|
+
|
25
|
+
# Search
|
26
|
+
|
27
|
+
Types:
|
28
|
+
|
29
|
+
```python
|
30
|
+
from supermemory.types import SearchExecuteResponse
|
31
|
+
```
|
32
|
+
|
33
|
+
Methods:
|
34
|
+
|
35
|
+
- <code title="get /v3/search">client.search.<a href="./src/supermemory/resources/search.py">execute</a>(\*\*<a href="src/supermemory/types/search_execute_params.py">params</a>) -> <a href="./src/supermemory/types/search_execute_response.py">SearchExecuteResponse</a></code>
|
36
|
+
|
37
|
+
# Settings
|
38
|
+
|
39
|
+
Types:
|
40
|
+
|
41
|
+
```python
|
42
|
+
from supermemory.types import SettingUpdateResponse, SettingGetResponse
|
43
|
+
```
|
44
|
+
|
45
|
+
Methods:
|
46
|
+
|
47
|
+
- <code title="patch /v3/settings">client.settings.<a href="./src/supermemory/resources/settings.py">update</a>(\*\*<a href="src/supermemory/types/setting_update_params.py">params</a>) -> <a href="./src/supermemory/types/setting_update_response.py">SettingUpdateResponse</a></code>
|
48
|
+
- <code title="get /v3/settings">client.settings.<a href="./src/supermemory/resources/settings.py">get</a>() -> <a href="./src/supermemory/types/setting_get_response.py">SettingGetResponse</a></code>
|
49
|
+
|
50
|
+
# Connections
|
51
|
+
|
52
|
+
Types:
|
53
|
+
|
54
|
+
```python
|
55
|
+
from supermemory.types import (
|
56
|
+
ConnectionCreateResponse,
|
57
|
+
ConnectionListResponse,
|
58
|
+
ConnectionGetResponse,
|
59
|
+
)
|
60
|
+
```
|
61
|
+
|
62
|
+
Methods:
|
63
|
+
|
64
|
+
- <code title="post /v3/connections/{provider}">client.connections.<a href="./src/supermemory/resources/connections.py">create</a>(provider, \*\*<a href="src/supermemory/types/connection_create_params.py">params</a>) -> <a href="./src/supermemory/types/connection_create_response.py">ConnectionCreateResponse</a></code>
|
65
|
+
- <code title="get /v3/connections">client.connections.<a href="./src/supermemory/resources/connections.py">list</a>(\*\*<a href="src/supermemory/types/connection_list_params.py">params</a>) -> <a href="./src/supermemory/types/connection_list_response.py">ConnectionListResponse</a></code>
|
66
|
+
- <code title="get /v3/connections/{connectionId}">client.connections.<a href="./src/supermemory/resources/connections.py">get</a>(connection_id) -> <a href="./src/supermemory/types/connection_get_response.py">ConnectionGetResponse</a></code>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
import typing as _t
|
4
|
+
|
3
5
|
from . import types
|
4
6
|
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
5
7
|
from ._utils import file_from_path
|
@@ -78,6 +80,9 @@ __all__ = [
|
|
78
80
|
"DefaultAsyncHttpxClient",
|
79
81
|
]
|
80
82
|
|
83
|
+
if not _t.TYPE_CHECKING:
|
84
|
+
from ._utils._resources_proxy import resources as resources
|
85
|
+
|
81
86
|
_setup_logging()
|
82
87
|
|
83
88
|
# Update the __module__ attribute for exported symbols so that
|
@@ -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
|
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 (
|
@@ -43,10 +43,10 @@ __all__ = [
|
|
43
43
|
|
44
44
|
|
45
45
|
class Supermemory(SyncAPIClient):
|
46
|
-
|
47
|
-
memory: memory.MemoryResource
|
46
|
+
memories: memories.MemoriesResource
|
48
47
|
search: search.SearchResource
|
49
|
-
|
48
|
+
settings: settings.SettingsResource
|
49
|
+
connections: connections.ConnectionsResource
|
50
50
|
with_raw_response: SupermemoryWithRawResponse
|
51
51
|
with_streaming_response: SupermemoryWithStreamedResponse
|
52
52
|
|
@@ -91,7 +91,7 @@ class Supermemory(SyncAPIClient):
|
|
91
91
|
if base_url is None:
|
92
92
|
base_url = os.environ.get("SUPERMEMORY_BASE_URL")
|
93
93
|
if base_url is None:
|
94
|
-
base_url = f"https://
|
94
|
+
base_url = f"https://api.supermemory.ai/"
|
95
95
|
|
96
96
|
super().__init__(
|
97
97
|
version=__version__,
|
@@ -104,10 +104,10 @@ class Supermemory(SyncAPIClient):
|
|
104
104
|
_strict_response_validation=_strict_response_validation,
|
105
105
|
)
|
106
106
|
|
107
|
-
self.
|
108
|
-
self.memory = memory.MemoryResource(self)
|
107
|
+
self.memories = memories.MemoriesResource(self)
|
109
108
|
self.search = search.SearchResource(self)
|
110
|
-
self.
|
109
|
+
self.settings = settings.SettingsResource(self)
|
110
|
+
self.connections = connections.ConnectionsResource(self)
|
111
111
|
self.with_raw_response = SupermemoryWithRawResponse(self)
|
112
112
|
self.with_streaming_response = SupermemoryWithStreamedResponse(self)
|
113
113
|
|
@@ -120,7 +120,7 @@ class Supermemory(SyncAPIClient):
|
|
120
120
|
@override
|
121
121
|
def auth_headers(self) -> dict[str, str]:
|
122
122
|
api_key = self.api_key
|
123
|
-
return {"
|
123
|
+
return {"Authorization": f"Bearer {api_key}"}
|
124
124
|
|
125
125
|
@property
|
126
126
|
@override
|
@@ -217,10 +217,10 @@ class Supermemory(SyncAPIClient):
|
|
217
217
|
|
218
218
|
|
219
219
|
class AsyncSupermemory(AsyncAPIClient):
|
220
|
-
|
221
|
-
memory: memory.AsyncMemoryResource
|
220
|
+
memories: memories.AsyncMemoriesResource
|
222
221
|
search: search.AsyncSearchResource
|
223
|
-
|
222
|
+
settings: settings.AsyncSettingsResource
|
223
|
+
connections: connections.AsyncConnectionsResource
|
224
224
|
with_raw_response: AsyncSupermemoryWithRawResponse
|
225
225
|
with_streaming_response: AsyncSupermemoryWithStreamedResponse
|
226
226
|
|
@@ -265,7 +265,7 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
265
265
|
if base_url is None:
|
266
266
|
base_url = os.environ.get("SUPERMEMORY_BASE_URL")
|
267
267
|
if base_url is None:
|
268
|
-
base_url = f"https://
|
268
|
+
base_url = f"https://api.supermemory.ai/"
|
269
269
|
|
270
270
|
super().__init__(
|
271
271
|
version=__version__,
|
@@ -278,10 +278,10 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
278
278
|
_strict_response_validation=_strict_response_validation,
|
279
279
|
)
|
280
280
|
|
281
|
-
self.
|
282
|
-
self.memory = memory.AsyncMemoryResource(self)
|
281
|
+
self.memories = memories.AsyncMemoriesResource(self)
|
283
282
|
self.search = search.AsyncSearchResource(self)
|
284
|
-
self.
|
283
|
+
self.settings = settings.AsyncSettingsResource(self)
|
284
|
+
self.connections = connections.AsyncConnectionsResource(self)
|
285
285
|
self.with_raw_response = AsyncSupermemoryWithRawResponse(self)
|
286
286
|
self.with_streaming_response = AsyncSupermemoryWithStreamedResponse(self)
|
287
287
|
|
@@ -294,7 +294,7 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
294
294
|
@override
|
295
295
|
def auth_headers(self) -> dict[str, str]:
|
296
296
|
api_key = self.api_key
|
297
|
-
return {"
|
297
|
+
return {"Authorization": f"Bearer {api_key}"}
|
298
298
|
|
299
299
|
@property
|
300
300
|
@override
|
@@ -392,34 +392,34 @@ class AsyncSupermemory(AsyncAPIClient):
|
|
392
392
|
|
393
393
|
class SupermemoryWithRawResponse:
|
394
394
|
def __init__(self, client: Supermemory) -> None:
|
395
|
-
self.
|
396
|
-
self.memory = memory.MemoryResourceWithRawResponse(client.memory)
|
395
|
+
self.memories = memories.MemoriesResourceWithRawResponse(client.memories)
|
397
396
|
self.search = search.SearchResourceWithRawResponse(client.search)
|
398
|
-
self.
|
397
|
+
self.settings = settings.SettingsResourceWithRawResponse(client.settings)
|
398
|
+
self.connections = connections.ConnectionsResourceWithRawResponse(client.connections)
|
399
399
|
|
400
400
|
|
401
401
|
class AsyncSupermemoryWithRawResponse:
|
402
402
|
def __init__(self, client: AsyncSupermemory) -> None:
|
403
|
-
self.
|
404
|
-
self.memory = memory.AsyncMemoryResourceWithRawResponse(client.memory)
|
403
|
+
self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories)
|
405
404
|
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
|
406
|
-
self.
|
405
|
+
self.settings = settings.AsyncSettingsResourceWithRawResponse(client.settings)
|
406
|
+
self.connections = connections.AsyncConnectionsResourceWithRawResponse(client.connections)
|
407
407
|
|
408
408
|
|
409
409
|
class SupermemoryWithStreamedResponse:
|
410
410
|
def __init__(self, client: Supermemory) -> None:
|
411
|
-
self.
|
412
|
-
self.memory = memory.MemoryResourceWithStreamingResponse(client.memory)
|
411
|
+
self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories)
|
413
412
|
self.search = search.SearchResourceWithStreamingResponse(client.search)
|
414
|
-
self.
|
413
|
+
self.settings = settings.SettingsResourceWithStreamingResponse(client.settings)
|
414
|
+
self.connections = connections.ConnectionsResourceWithStreamingResponse(client.connections)
|
415
415
|
|
416
416
|
|
417
417
|
class AsyncSupermemoryWithStreamedResponse:
|
418
418
|
def __init__(self, client: AsyncSupermemory) -> None:
|
419
|
-
self.
|
420
|
-
self.memory = memory.AsyncMemoryResourceWithStreamingResponse(client.memory)
|
419
|
+
self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories)
|
421
420
|
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
|
422
|
-
self.
|
421
|
+
self.settings = settings.AsyncSettingsResourceWithStreamingResponse(client.settings)
|
422
|
+
self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections)
|
423
423
|
|
424
424
|
|
425
425
|
Client = Supermemory
|
@@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
|
|
34
34
|
if not is_file_content(obj):
|
35
35
|
prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
|
36
36
|
raise RuntimeError(
|
37
|
-
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead."
|
37
|
+
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/supermemoryai/python-sdk/tree/main#file-uploads"
|
38
38
|
) from None
|
39
39
|
|
40
40
|
|
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
|
|
46
46
|
@property # type: ignore
|
47
47
|
@override
|
48
48
|
def __class__(self) -> type: # pyright: ignore
|
49
|
-
|
49
|
+
try:
|
50
|
+
proxied = self.__get_proxied__()
|
51
|
+
except Exception:
|
52
|
+
return type(self)
|
50
53
|
if issubclass(type(proxied), LazyProxy):
|
51
54
|
return type(proxied)
|
52
55
|
return proxied.__class__
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import Any
|
4
|
+
from typing_extensions import override
|
5
|
+
|
6
|
+
from ._proxy import LazyProxy
|
7
|
+
|
8
|
+
|
9
|
+
class ResourcesProxy(LazyProxy[Any]):
|
10
|
+
"""A proxy for the `supermemory.resources` module.
|
11
|
+
|
12
|
+
This is used so that we can lazily import `supermemory.resources` only when
|
13
|
+
needed *and* so that users can just import `supermemory` and reference `supermemory.resources`
|
14
|
+
"""
|
15
|
+
|
16
|
+
@override
|
17
|
+
def __load__(self) -> Any:
|
18
|
+
import importlib
|
19
|
+
|
20
|
+
mod = importlib.import_module("supermemory.resources")
|
21
|
+
return mod
|
22
|
+
|
23
|
+
|
24
|
+
resources = ResourcesProxy().__as_proxied__()
|
@@ -1,13 +1,5 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
-
from .memory import (
|
4
|
-
MemoryResource,
|
5
|
-
AsyncMemoryResource,
|
6
|
-
MemoryResourceWithRawResponse,
|
7
|
-
AsyncMemoryResourceWithRawResponse,
|
8
|
-
MemoryResourceWithStreamingResponse,
|
9
|
-
AsyncMemoryResourceWithStreamingResponse,
|
10
|
-
)
|
11
3
|
from .search import (
|
12
4
|
SearchResource,
|
13
5
|
AsyncSearchResource,
|
@@ -16,6 +8,14 @@ from .search import (
|
|
16
8
|
SearchResourceWithStreamingResponse,
|
17
9
|
AsyncSearchResourceWithStreamingResponse,
|
18
10
|
)
|
11
|
+
from .memories import (
|
12
|
+
MemoriesResource,
|
13
|
+
AsyncMemoriesResource,
|
14
|
+
MemoriesResourceWithRawResponse,
|
15
|
+
AsyncMemoriesResourceWithRawResponse,
|
16
|
+
MemoriesResourceWithStreamingResponse,
|
17
|
+
AsyncMemoriesResourceWithStreamingResponse,
|
18
|
+
)
|
19
19
|
from .settings import (
|
20
20
|
SettingsResource,
|
21
21
|
AsyncSettingsResource,
|
@@ -24,38 +24,38 @@ from .settings import (
|
|
24
24
|
SettingsResourceWithStreamingResponse,
|
25
25
|
AsyncSettingsResourceWithStreamingResponse,
|
26
26
|
)
|
27
|
-
from .
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
from .connections import (
|
28
|
+
ConnectionsResource,
|
29
|
+
AsyncConnectionsResource,
|
30
|
+
ConnectionsResourceWithRawResponse,
|
31
|
+
AsyncConnectionsResourceWithRawResponse,
|
32
|
+
ConnectionsResourceWithStreamingResponse,
|
33
|
+
AsyncConnectionsResourceWithStreamingResponse,
|
34
34
|
)
|
35
35
|
|
36
36
|
__all__ = [
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"MemoryResource",
|
44
|
-
"AsyncMemoryResource",
|
45
|
-
"MemoryResourceWithRawResponse",
|
46
|
-
"AsyncMemoryResourceWithRawResponse",
|
47
|
-
"MemoryResourceWithStreamingResponse",
|
48
|
-
"AsyncMemoryResourceWithStreamingResponse",
|
37
|
+
"MemoriesResource",
|
38
|
+
"AsyncMemoriesResource",
|
39
|
+
"MemoriesResourceWithRawResponse",
|
40
|
+
"AsyncMemoriesResourceWithRawResponse",
|
41
|
+
"MemoriesResourceWithStreamingResponse",
|
42
|
+
"AsyncMemoriesResourceWithStreamingResponse",
|
49
43
|
"SearchResource",
|
50
44
|
"AsyncSearchResource",
|
51
45
|
"SearchResourceWithRawResponse",
|
52
46
|
"AsyncSearchResourceWithRawResponse",
|
53
47
|
"SearchResourceWithStreamingResponse",
|
54
48
|
"AsyncSearchResourceWithStreamingResponse",
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"
|
49
|
+
"SettingsResource",
|
50
|
+
"AsyncSettingsResource",
|
51
|
+
"SettingsResourceWithRawResponse",
|
52
|
+
"AsyncSettingsResourceWithRawResponse",
|
53
|
+
"SettingsResourceWithStreamingResponse",
|
54
|
+
"AsyncSettingsResourceWithStreamingResponse",
|
55
|
+
"ConnectionsResource",
|
56
|
+
"AsyncConnectionsResource",
|
57
|
+
"ConnectionsResourceWithRawResponse",
|
58
|
+
"AsyncConnectionsResourceWithRawResponse",
|
59
|
+
"ConnectionsResourceWithStreamingResponse",
|
60
|
+
"AsyncConnectionsResourceWithStreamingResponse",
|
61
61
|
]
|