supermemory 3.0.0a22__tar.gz → 3.0.0a23__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.
Potentially problematic release.
This version of supermemory might be problematic. Click here for more details.
- supermemory-3.0.0a23/.release-please-manifest.json +3 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/CHANGELOG.md +23 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/PKG-INFO +11 -20
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/README.md +8 -18
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/pyproject.toml +3 -2
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/requirements-dev.lock +3 -3
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/requirements.lock +3 -3
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_base_client.py +9 -2
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_models.py +8 -5
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_version.py +1 -1
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/resources/memories.py +20 -20
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_add_params.py +9 -9
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_get_response.py +9 -3
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_update_params.py +9 -9
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/api_resources/test_memories.py +10 -30
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_client.py +12 -36
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_models.py +45 -0
- supermemory-3.0.0a22/.release-please-manifest.json +0 -3
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/.gitignore +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/CONTRIBUTING.md +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/LICENSE +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/SECURITY.md +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/api.md +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/bin/check-release-environment +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/bin/publish-pypi +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/examples/.keep +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/mypy.ini +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/noxfile.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/release-please-config.json +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_client.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_compat.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_constants.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_exceptions.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_files.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_qs.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_resource.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_streaming.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_types.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_logs.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_proxy.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_reflection.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_resources_proxy.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_streams.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_sync.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_transform.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_typing.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/_utils/_utils.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/lib/.keep +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/py.typed +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/resources/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/resources/connections.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/resources/search.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/resources/settings.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_create_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_create_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_delete_by_id_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_delete_by_provider_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_delete_by_provider_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_get_by_id_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_get_by_tags_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_get_by_tags_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_import_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_list_documents_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_list_documents_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_list_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/connection_list_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_add_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_list_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_list_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/memory_update_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/search_execute_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/search_execute_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/setting_get_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/setting_update_params.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory/types/setting_update_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/src/supermemory_new/lib/.keep +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/api_resources/__init__.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/api_resources/test_connections.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/api_resources/test_search.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/api_resources/test_settings.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/conftest.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/sample_file.txt +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_deepcopy.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_extract_files.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_files.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_qs.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_required_args.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_response.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_streaming.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_transform.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_utils/test_proxy.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/test_utils/test_typing.py +0 -0
- {supermemory-3.0.0a22 → supermemory-3.0.0a23}/tests/utils.py +0 -0
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0-alpha.23 (2025-07-15)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v3.0.0-alpha.22...v3.0.0-alpha.23](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.22...v3.0.0-alpha.23)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([3f71f60](https://github.com/supermemoryai/python-sdk/commit/3f71f60954dedc0a91e1859df48c5c3ca0a47c88))
|
|
10
|
+
* **api:** api update ([b614732](https://github.com/supermemoryai/python-sdk/commit/b61473253183d434613b0aeb631376262d22cb0c))
|
|
11
|
+
* clean up environment call outs ([4aaccf1](https://github.com/supermemoryai/python-sdk/commit/4aaccf17ae31c04f3097fe04a6a081171fc725d1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **client:** don't send Content-Type header on GET requests ([80480dd](https://github.com/supermemoryai/python-sdk/commit/80480dd46271dc5136f39c5ff1315555b8d51e31))
|
|
17
|
+
* **parsing:** correctly handle nested discriminated unions ([812e982](https://github.com/supermemoryai/python-sdk/commit/812e982cbba93e197d4cd3cf8bdfa710e7830a78))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* **internal:** bump pinned h11 dep ([9e822a1](https://github.com/supermemoryai/python-sdk/commit/9e822a16ce8cf30791abf6384e2e3205233eeaba))
|
|
23
|
+
* **package:** mark python 3.13 as supported ([2dc73dd](https://github.com/supermemoryai/python-sdk/commit/2dc73dd51ac30fa4d6b2d370b7411857518c1ddd))
|
|
24
|
+
* **readme:** fix version rendering on pypi ([a6d7d7a](https://github.com/supermemoryai/python-sdk/commit/a6d7d7a100680cfaa03138542f60b7b7407ad347))
|
|
25
|
+
|
|
3
26
|
## 3.0.0-alpha.22 (2025-07-03)
|
|
4
27
|
|
|
5
28
|
Full Changelog: [v3.0.0-alpha.21...v3.0.0-alpha.22](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.21...v3.0.0-alpha.22)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: supermemory
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0a23
|
|
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
|
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
23
|
Classifier: Typing :: Typed
|
|
23
24
|
Requires-Python: >=3.8
|
|
@@ -29,12 +30,13 @@ Requires-Dist: sniffio
|
|
|
29
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
30
31
|
Provides-Extra: aiohttp
|
|
31
32
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
32
|
-
Requires-Dist: httpx-aiohttp>=0.1.
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
|
|
33
34
|
Description-Content-Type: text/markdown
|
|
34
35
|
|
|
35
36
|
# Supermemory Python API library
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
<!-- prettier-ignore -->
|
|
39
|
+
[)](https://pypi.org/project/supermemory/)
|
|
38
40
|
|
|
39
41
|
The Supermemory Python library provides convenient access to the Supermemory REST API from any Python 3.8+
|
|
40
42
|
application. The library includes type definitions for all request params and response fields,
|
|
@@ -116,7 +118,6 @@ pip install --pre supermemory[aiohttp]
|
|
|
116
118
|
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
117
119
|
|
|
118
120
|
```python
|
|
119
|
-
import os
|
|
120
121
|
import asyncio
|
|
121
122
|
from supermemory import DefaultAioHttpClient
|
|
122
123
|
from supermemory import AsyncSupermemory
|
|
@@ -124,7 +125,7 @@ from supermemory import AsyncSupermemory
|
|
|
124
125
|
|
|
125
126
|
async def main() -> None:
|
|
126
127
|
async with AsyncSupermemory(
|
|
127
|
-
api_key=
|
|
128
|
+
api_key="My API Key",
|
|
128
129
|
http_client=DefaultAioHttpClient(),
|
|
129
130
|
) as client:
|
|
130
131
|
response = await client.search.execute(
|
|
@@ -161,9 +162,7 @@ from supermemory import Supermemory
|
|
|
161
162
|
client = Supermemory()
|
|
162
163
|
|
|
163
164
|
try:
|
|
164
|
-
client.memories.add(
|
|
165
|
-
content="This is a detailed article about machine learning concepts...",
|
|
166
|
-
)
|
|
165
|
+
client.memories.add()
|
|
167
166
|
except supermemory.APIConnectionError as e:
|
|
168
167
|
print("The server could not be reached")
|
|
169
168
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
@@ -206,9 +205,7 @@ client = Supermemory(
|
|
|
206
205
|
)
|
|
207
206
|
|
|
208
207
|
# Or, configure per-request:
|
|
209
|
-
client.with_options(max_retries=5).memories.add(
|
|
210
|
-
content="This is a detailed article about machine learning concepts...",
|
|
211
|
-
)
|
|
208
|
+
client.with_options(max_retries=5).memories.add()
|
|
212
209
|
```
|
|
213
210
|
|
|
214
211
|
### Timeouts
|
|
@@ -231,9 +228,7 @@ client = Supermemory(
|
|
|
231
228
|
)
|
|
232
229
|
|
|
233
230
|
# Override per-request:
|
|
234
|
-
client.with_options(timeout=5.0).memories.add(
|
|
235
|
-
content="This is a detailed article about machine learning concepts...",
|
|
236
|
-
)
|
|
231
|
+
client.with_options(timeout=5.0).memories.add()
|
|
237
232
|
```
|
|
238
233
|
|
|
239
234
|
On timeout, an `APITimeoutError` is thrown.
|
|
@@ -274,9 +269,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
274
269
|
from supermemory import Supermemory
|
|
275
270
|
|
|
276
271
|
client = Supermemory()
|
|
277
|
-
response = client.memories.with_raw_response.add(
|
|
278
|
-
content="This is a detailed article about machine learning concepts...",
|
|
279
|
-
)
|
|
272
|
+
response = client.memories.with_raw_response.add()
|
|
280
273
|
print(response.headers.get('X-My-Header'))
|
|
281
274
|
|
|
282
275
|
memory = response.parse() # get the object that `memories.add()` would have returned
|
|
@@ -294,9 +287,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
294
287
|
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.
|
|
295
288
|
|
|
296
289
|
```python
|
|
297
|
-
with client.memories.with_streaming_response.add(
|
|
298
|
-
content="This is a detailed article about machine learning concepts...",
|
|
299
|
-
) as response:
|
|
290
|
+
with client.memories.with_streaming_response.add() as response:
|
|
300
291
|
print(response.headers.get("X-My-Header"))
|
|
301
292
|
|
|
302
293
|
for line in response.iter_lines():
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Supermemory Python API library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- prettier-ignore -->
|
|
4
|
+
[)](https://pypi.org/project/supermemory/)
|
|
4
5
|
|
|
5
6
|
The Supermemory Python library provides convenient access to the Supermemory REST API from any Python 3.8+
|
|
6
7
|
application. The library includes type definitions for all request params and response fields,
|
|
@@ -82,7 +83,6 @@ pip install --pre supermemory[aiohttp]
|
|
|
82
83
|
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
83
84
|
|
|
84
85
|
```python
|
|
85
|
-
import os
|
|
86
86
|
import asyncio
|
|
87
87
|
from supermemory import DefaultAioHttpClient
|
|
88
88
|
from supermemory import AsyncSupermemory
|
|
@@ -90,7 +90,7 @@ from supermemory import AsyncSupermemory
|
|
|
90
90
|
|
|
91
91
|
async def main() -> None:
|
|
92
92
|
async with AsyncSupermemory(
|
|
93
|
-
api_key=
|
|
93
|
+
api_key="My API Key",
|
|
94
94
|
http_client=DefaultAioHttpClient(),
|
|
95
95
|
) as client:
|
|
96
96
|
response = await client.search.execute(
|
|
@@ -127,9 +127,7 @@ from supermemory import Supermemory
|
|
|
127
127
|
client = Supermemory()
|
|
128
128
|
|
|
129
129
|
try:
|
|
130
|
-
client.memories.add(
|
|
131
|
-
content="This is a detailed article about machine learning concepts...",
|
|
132
|
-
)
|
|
130
|
+
client.memories.add()
|
|
133
131
|
except supermemory.APIConnectionError as e:
|
|
134
132
|
print("The server could not be reached")
|
|
135
133
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
@@ -172,9 +170,7 @@ client = Supermemory(
|
|
|
172
170
|
)
|
|
173
171
|
|
|
174
172
|
# 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()
|
|
178
174
|
```
|
|
179
175
|
|
|
180
176
|
### Timeouts
|
|
@@ -197,9 +193,7 @@ client = Supermemory(
|
|
|
197
193
|
)
|
|
198
194
|
|
|
199
195
|
# 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()
|
|
203
197
|
```
|
|
204
198
|
|
|
205
199
|
On timeout, an `APITimeoutError` is thrown.
|
|
@@ -240,9 +234,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
240
234
|
from supermemory import Supermemory
|
|
241
235
|
|
|
242
236
|
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()
|
|
246
238
|
print(response.headers.get('X-My-Header'))
|
|
247
239
|
|
|
248
240
|
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
|
|
|
260
252
|
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.
|
|
261
253
|
|
|
262
254
|
```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:
|
|
266
256
|
print(response.headers.get("X-My-Header"))
|
|
267
257
|
|
|
268
258
|
for line in response.iter_lines():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "supermemory"
|
|
3
|
-
version = "3.0.0-alpha.
|
|
3
|
+
version = "3.0.0-alpha.23"
|
|
4
4
|
description = "The official Python library for the supermemory API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -24,6 +24,7 @@ classifiers = [
|
|
|
24
24
|
"Programming Language :: Python :: 3.10",
|
|
25
25
|
"Programming Language :: Python :: 3.11",
|
|
26
26
|
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
27
28
|
"Operating System :: OS Independent",
|
|
28
29
|
"Operating System :: POSIX",
|
|
29
30
|
"Operating System :: MacOS",
|
|
@@ -38,7 +39,7 @@ Homepage = "https://github.com/supermemoryai/python-sdk"
|
|
|
38
39
|
Repository = "https://github.com/supermemoryai/python-sdk"
|
|
39
40
|
|
|
40
41
|
[project.optional-dependencies]
|
|
41
|
-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.
|
|
42
|
+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
|
|
42
43
|
|
|
43
44
|
[tool.rye]
|
|
44
45
|
managed = true
|
|
@@ -48,15 +48,15 @@ filelock==3.12.4
|
|
|
48
48
|
frozenlist==1.6.2
|
|
49
49
|
# via aiohttp
|
|
50
50
|
# via aiosignal
|
|
51
|
-
h11==0.
|
|
51
|
+
h11==0.16.0
|
|
52
52
|
# via httpcore
|
|
53
|
-
httpcore==1.0.
|
|
53
|
+
httpcore==1.0.9
|
|
54
54
|
# via httpx
|
|
55
55
|
httpx==0.28.1
|
|
56
56
|
# via httpx-aiohttp
|
|
57
57
|
# via respx
|
|
58
58
|
# via supermemory
|
|
59
|
-
httpx-aiohttp==0.1.
|
|
59
|
+
httpx-aiohttp==0.1.8
|
|
60
60
|
# via supermemory
|
|
61
61
|
idna==3.4
|
|
62
62
|
# via anyio
|
|
@@ -36,14 +36,14 @@ exceptiongroup==1.2.2
|
|
|
36
36
|
frozenlist==1.6.2
|
|
37
37
|
# via aiohttp
|
|
38
38
|
# via aiosignal
|
|
39
|
-
h11==0.
|
|
39
|
+
h11==0.16.0
|
|
40
40
|
# via httpcore
|
|
41
|
-
httpcore==1.0.
|
|
41
|
+
httpcore==1.0.9
|
|
42
42
|
# via httpx
|
|
43
43
|
httpx==0.28.1
|
|
44
44
|
# via httpx-aiohttp
|
|
45
45
|
# via supermemory
|
|
46
|
-
httpx-aiohttp==0.1.
|
|
46
|
+
httpx-aiohttp==0.1.8
|
|
47
47
|
# via supermemory
|
|
48
48
|
idna==3.4
|
|
49
49
|
# via anyio
|
|
@@ -529,6 +529,15 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
529
529
|
# work around https://github.com/encode/httpx/discussions/2880
|
|
530
530
|
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
|
|
531
531
|
|
|
532
|
+
is_body_allowed = options.method.lower() != "get"
|
|
533
|
+
|
|
534
|
+
if is_body_allowed:
|
|
535
|
+
kwargs["json"] = json_data if is_given(json_data) else None
|
|
536
|
+
kwargs["files"] = files
|
|
537
|
+
else:
|
|
538
|
+
headers.pop("Content-Type", None)
|
|
539
|
+
kwargs.pop("data", None)
|
|
540
|
+
|
|
532
541
|
# TODO: report this error to httpx
|
|
533
542
|
return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
|
|
534
543
|
headers=headers,
|
|
@@ -540,8 +549,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
540
549
|
# so that passing a `TypedDict` doesn't cause an error.
|
|
541
550
|
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
|
|
542
551
|
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
|
|
543
|
-
json=json_data if is_given(json_data) else None,
|
|
544
|
-
files=files,
|
|
545
552
|
**kwargs,
|
|
546
553
|
)
|
|
547
554
|
|
|
@@ -2,9 +2,10 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import inspect
|
|
5
|
-
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
|
|
6
6
|
from datetime import date, datetime
|
|
7
7
|
from typing_extensions import (
|
|
8
|
+
List,
|
|
8
9
|
Unpack,
|
|
9
10
|
Literal,
|
|
10
11
|
ClassVar,
|
|
@@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
|
|
|
366
367
|
if type_ is None:
|
|
367
368
|
raise RuntimeError(f"Unexpected field type is None for {key}")
|
|
368
369
|
|
|
369
|
-
return construct_type(value=value, type_=type_)
|
|
370
|
+
return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
|
|
370
371
|
|
|
371
372
|
|
|
372
373
|
def is_basemodel(type_: type) -> bool:
|
|
@@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
|
|
|
420
421
|
return cast(_T, construct_type(value=value, type_=type_))
|
|
421
422
|
|
|
422
423
|
|
|
423
|
-
def construct_type(*, value: object, type_: object) -> object:
|
|
424
|
+
def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object:
|
|
424
425
|
"""Loose coercion to the expected type with construction of nested values.
|
|
425
426
|
|
|
426
427
|
If the given value does not match the expected type then it is returned as-is.
|
|
@@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
|
438
439
|
type_ = type_.__value__ # type: ignore[unreachable]
|
|
439
440
|
|
|
440
441
|
# unwrap `Annotated[T, ...]` -> `T`
|
|
441
|
-
if
|
|
442
|
-
meta: tuple[Any, ...] =
|
|
442
|
+
if metadata is not None:
|
|
443
|
+
meta: tuple[Any, ...] = tuple(metadata)
|
|
444
|
+
elif is_annotated_type(type_):
|
|
445
|
+
meta = get_args(type_)[1:]
|
|
443
446
|
type_ = extract_type_arg(type_, 0)
|
|
444
447
|
else:
|
|
445
448
|
meta = tuple()
|
|
@@ -51,8 +51,8 @@ class MemoriesResource(SyncAPIResource):
|
|
|
51
51
|
self,
|
|
52
52
|
id: str,
|
|
53
53
|
*,
|
|
54
|
-
content: str,
|
|
55
54
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
|
55
|
+
content: str | NotGiven = NOT_GIVEN,
|
|
56
56
|
custom_id: str | NotGiven = NOT_GIVEN,
|
|
57
57
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
|
58
58
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -66,6 +66,9 @@ class MemoriesResource(SyncAPIResource):
|
|
|
66
66
|
Update a memory with any content type (text, url, file, etc.) and metadata
|
|
67
67
|
|
|
68
68
|
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
|
+
|
|
69
72
|
content: The content to extract and process into a memory. This can be a URL to a
|
|
70
73
|
website, a PDF, an image, or a video.
|
|
71
74
|
|
|
@@ -75,9 +78,6 @@ class MemoriesResource(SyncAPIResource):
|
|
|
75
78
|
|
|
76
79
|
We automatically detect the content type from the url's response format.
|
|
77
80
|
|
|
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
|
-
|
|
81
81
|
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
|
82
82
|
will uniquely identify this memory.
|
|
83
83
|
|
|
@@ -101,8 +101,8 @@ class MemoriesResource(SyncAPIResource):
|
|
|
101
101
|
f"/v3/memories/{id}",
|
|
102
102
|
body=maybe_transform(
|
|
103
103
|
{
|
|
104
|
-
"content": content,
|
|
105
104
|
"container_tags": container_tags,
|
|
105
|
+
"content": content,
|
|
106
106
|
"custom_id": custom_id,
|
|
107
107
|
"metadata": metadata,
|
|
108
108
|
},
|
|
@@ -211,8 +211,8 @@ class MemoriesResource(SyncAPIResource):
|
|
|
211
211
|
def add(
|
|
212
212
|
self,
|
|
213
213
|
*,
|
|
214
|
-
content: str,
|
|
215
214
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
|
215
|
+
content: str | NotGiven = NOT_GIVEN,
|
|
216
216
|
custom_id: str | NotGiven = NOT_GIVEN,
|
|
217
217
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
|
218
218
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -226,6 +226,9 @@ class MemoriesResource(SyncAPIResource):
|
|
|
226
226
|
Add a memory with any content type (text, url, file, etc.) and metadata
|
|
227
227
|
|
|
228
228
|
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
|
+
|
|
229
232
|
content: The content to extract and process into a memory. This can be a URL to a
|
|
230
233
|
website, a PDF, an image, or a video.
|
|
231
234
|
|
|
@@ -235,9 +238,6 @@ class MemoriesResource(SyncAPIResource):
|
|
|
235
238
|
|
|
236
239
|
We automatically detect the content type from the url's response format.
|
|
237
240
|
|
|
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
|
-
|
|
241
241
|
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
|
242
242
|
will uniquely identify this memory.
|
|
243
243
|
|
|
@@ -259,8 +259,8 @@ class MemoriesResource(SyncAPIResource):
|
|
|
259
259
|
"/v3/memories",
|
|
260
260
|
body=maybe_transform(
|
|
261
261
|
{
|
|
262
|
-
"content": content,
|
|
263
262
|
"container_tags": container_tags,
|
|
263
|
+
"content": content,
|
|
264
264
|
"custom_id": custom_id,
|
|
265
265
|
"metadata": metadata,
|
|
266
266
|
},
|
|
@@ -330,8 +330,8 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
330
330
|
self,
|
|
331
331
|
id: str,
|
|
332
332
|
*,
|
|
333
|
-
content: str,
|
|
334
333
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
|
334
|
+
content: str | NotGiven = NOT_GIVEN,
|
|
335
335
|
custom_id: str | NotGiven = NOT_GIVEN,
|
|
336
336
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
|
337
337
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -345,6 +345,9 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
345
345
|
Update a memory with any content type (text, url, file, etc.) and metadata
|
|
346
346
|
|
|
347
347
|
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
|
+
|
|
348
351
|
content: The content to extract and process into a memory. This can be a URL to a
|
|
349
352
|
website, a PDF, an image, or a video.
|
|
350
353
|
|
|
@@ -354,9 +357,6 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
354
357
|
|
|
355
358
|
We automatically detect the content type from the url's response format.
|
|
356
359
|
|
|
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
|
-
|
|
360
360
|
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
|
361
361
|
will uniquely identify this memory.
|
|
362
362
|
|
|
@@ -380,8 +380,8 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
380
380
|
f"/v3/memories/{id}",
|
|
381
381
|
body=await async_maybe_transform(
|
|
382
382
|
{
|
|
383
|
-
"content": content,
|
|
384
383
|
"container_tags": container_tags,
|
|
384
|
+
"content": content,
|
|
385
385
|
"custom_id": custom_id,
|
|
386
386
|
"metadata": metadata,
|
|
387
387
|
},
|
|
@@ -490,8 +490,8 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
490
490
|
async def add(
|
|
491
491
|
self,
|
|
492
492
|
*,
|
|
493
|
-
content: str,
|
|
494
493
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
|
494
|
+
content: str | NotGiven = NOT_GIVEN,
|
|
495
495
|
custom_id: str | NotGiven = NOT_GIVEN,
|
|
496
496
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
|
497
497
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -505,6 +505,9 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
505
505
|
Add a memory with any content type (text, url, file, etc.) and metadata
|
|
506
506
|
|
|
507
507
|
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
|
+
|
|
508
511
|
content: The content to extract and process into a memory. This can be a URL to a
|
|
509
512
|
website, a PDF, an image, or a video.
|
|
510
513
|
|
|
@@ -514,9 +517,6 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
514
517
|
|
|
515
518
|
We automatically detect the content type from the url's response format.
|
|
516
519
|
|
|
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
|
-
|
|
520
520
|
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
|
521
521
|
will uniquely identify this memory.
|
|
522
522
|
|
|
@@ -538,8 +538,8 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
538
538
|
"/v3/memories",
|
|
539
539
|
body=await async_maybe_transform(
|
|
540
540
|
{
|
|
541
|
-
"content": content,
|
|
542
541
|
"container_tags": container_tags,
|
|
542
|
+
"content": content,
|
|
543
543
|
"custom_id": custom_id,
|
|
544
544
|
"metadata": metadata,
|
|
545
545
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import Dict, List, Union
|
|
6
|
-
from typing_extensions import
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
7
|
|
|
8
8
|
from .._utils import PropertyInfo
|
|
9
9
|
|
|
@@ -11,7 +11,14 @@ __all__ = ["MemoryAddParams"]
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class MemoryAddParams(TypedDict, total=False):
|
|
14
|
-
|
|
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
|
|
15
22
|
"""The content to extract and process into a memory.
|
|
16
23
|
|
|
17
24
|
This can be a URL to a website, a PDF, an image, or a video.
|
|
@@ -23,13 +30,6 @@ class MemoryAddParams(TypedDict, total=False):
|
|
|
23
30
|
We automatically detect the content type from the url's response format.
|
|
24
31
|
"""
|
|
25
32
|
|
|
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
|
-
|
|
33
33
|
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
34
34
|
"""Optional custom ID of the memory.
|
|
35
35
|
|
|
@@ -62,6 +62,12 @@ class MemoryGetResponse(BaseModel):
|
|
|
62
62
|
summary: Optional[str] = None
|
|
63
63
|
"""Summary of the memory content"""
|
|
64
64
|
|
|
65
|
+
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
66
|
+
|
|
67
|
+
summary_embedding_model_new: Optional[str] = FieldInfo(alias="summaryEmbeddingModelNew", default=None)
|
|
68
|
+
|
|
69
|
+
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
70
|
+
|
|
65
71
|
title: Optional[str] = None
|
|
66
72
|
"""Title of the memory"""
|
|
67
73
|
|
|
@@ -83,9 +89,6 @@ class MemoryGetResponse(BaseModel):
|
|
|
83
89
|
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
84
90
|
"""Last update timestamp"""
|
|
85
91
|
|
|
86
|
-
url: Optional[str] = None
|
|
87
|
-
"""URL of the memory"""
|
|
88
|
-
|
|
89
92
|
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
90
93
|
"""Optional tags this memory should be containerized by.
|
|
91
94
|
|
|
@@ -95,3 +98,6 @@ class MemoryGetResponse(BaseModel):
|
|
|
95
98
|
|
|
96
99
|
raw: None = None
|
|
97
100
|
"""Raw content of the memory"""
|
|
101
|
+
|
|
102
|
+
url: Optional[str] = None
|
|
103
|
+
"""URL of the memory"""
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import Dict, List, Union
|
|
6
|
-
from typing_extensions import
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
7
|
|
|
8
8
|
from .._utils import PropertyInfo
|
|
9
9
|
|
|
@@ -11,7 +11,14 @@ __all__ = ["MemoryUpdateParams"]
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class MemoryUpdateParams(TypedDict, total=False):
|
|
14
|
-
|
|
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
|
|
15
22
|
"""The content to extract and process into a memory.
|
|
16
23
|
|
|
17
24
|
This can be a URL to a website, a PDF, an image, or a video.
|
|
@@ -23,13 +30,6 @@ class MemoryUpdateParams(TypedDict, total=False):
|
|
|
23
30
|
We automatically detect the content type from the url's response format.
|
|
24
31
|
"""
|
|
25
32
|
|
|
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
|
-
|
|
33
33
|
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
34
34
|
"""Optional custom ID of the memory.
|
|
35
35
|
|