supermemory 3.0.0a29__py3-none-any.whl → 3.0.0a30__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.
Potentially problematic release.
This version of supermemory might be problematic. Click here for more details.
- supermemory/_base_client.py +3 -3
- supermemory/_client.py +1 -9
- supermemory/_compat.py +48 -48
- supermemory/_files.py +1 -1
- supermemory/_models.py +40 -40
- supermemory/_types.py +35 -1
- supermemory/_utils/__init__.py +9 -2
- supermemory/_utils/_compat.py +45 -0
- supermemory/_utils/_datetime_parse.py +136 -0
- supermemory/_utils/_transform.py +11 -1
- supermemory/_utils/_typing.py +6 -1
- supermemory/_utils/_utils.py +0 -1
- supermemory/_version.py +1 -1
- supermemory/resources/__init__.py +0 -14
- supermemory/resources/connections.py +14 -14
- supermemory/resources/search.py +9 -9
- supermemory/types/__init__.py +0 -9
- supermemory/types/connection_create_params.py +3 -2
- supermemory/types/connection_delete_by_provider_params.py +2 -2
- supermemory/types/connection_get_by_tags_params.py +2 -2
- supermemory/types/connection_import_params.py +2 -2
- supermemory/types/connection_list_documents_params.py +2 -2
- supermemory/types/connection_list_params.py +2 -2
- supermemory/types/search_documents_params.py +3 -2
- supermemory/types/search_execute_params.py +3 -2
- supermemory/types/search_memories_response.py +10 -7
- {supermemory-3.0.0a29.dist-info → supermemory-3.0.0a30.dist-info}/METADATA +18 -25
- supermemory-3.0.0a30.dist-info/RECORD +60 -0
- supermemory/resources/memories.py +0 -806
- supermemory/types/memory_add_params.py +0 -53
- supermemory/types/memory_add_response.py +0 -11
- supermemory/types/memory_get_response.py +0 -103
- supermemory/types/memory_list_params.py +0 -40
- supermemory/types/memory_list_response.py +0 -94
- supermemory/types/memory_update_params.py +0 -53
- supermemory/types/memory_update_response.py +0 -11
- supermemory/types/memory_upload_file_params.py +0 -16
- supermemory/types/memory_upload_file_response.py +0 -11
- supermemory-3.0.0a29.dist-info/RECORD +0 -68
- {supermemory-3.0.0a29.dist-info → supermemory-3.0.0a30.dist-info}/WHEEL +0 -0
- {supermemory-3.0.0a29.dist-info → supermemory-3.0.0a30.dist-info}/licenses/LICENSE +0 -0
|
@@ -71,17 +71,20 @@ class ResultDocument(BaseModel):
|
|
|
71
71
|
created_at: datetime = FieldInfo(alias="createdAt")
|
|
72
72
|
"""Document creation date"""
|
|
73
73
|
|
|
74
|
+
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
75
|
+
"""Document last update date"""
|
|
76
|
+
|
|
74
77
|
metadata: Optional[Dict[str, object]] = None
|
|
75
|
-
"""Document metadata"""
|
|
78
|
+
"""Document metadata (only included when documents=true)"""
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
"""Document
|
|
80
|
+
summary: Optional[str] = None
|
|
81
|
+
"""Document summary (only included when summaries=true)"""
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
"""Document
|
|
83
|
+
title: Optional[str] = None
|
|
84
|
+
"""Document title (only included when documents=true)"""
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
"""Document
|
|
86
|
+
type: Optional[str] = None
|
|
87
|
+
"""Document type (only included when documents=true)"""
|
|
85
88
|
|
|
86
89
|
|
|
87
90
|
class Result(BaseModel):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: supermemory
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0a30
|
|
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
|
|
@@ -162,23 +162,6 @@ response = client.search.memories(
|
|
|
162
162
|
print(response.include)
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
## File uploads
|
|
166
|
-
|
|
167
|
-
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)`.
|
|
168
|
-
|
|
169
|
-
```python
|
|
170
|
-
from pathlib import Path
|
|
171
|
-
from supermemory import Supermemory
|
|
172
|
-
|
|
173
|
-
client = Supermemory()
|
|
174
|
-
|
|
175
|
-
client.memories.upload_file(
|
|
176
|
-
file=Path("/path/to/file"),
|
|
177
|
-
)
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
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.
|
|
181
|
-
|
|
182
165
|
## Handling errors
|
|
183
166
|
|
|
184
167
|
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.
|
|
@@ -195,7 +178,9 @@ from supermemory import Supermemory
|
|
|
195
178
|
client = Supermemory()
|
|
196
179
|
|
|
197
180
|
try:
|
|
198
|
-
client.
|
|
181
|
+
client.search.documents(
|
|
182
|
+
q="machine learning concepts",
|
|
183
|
+
)
|
|
199
184
|
except supermemory.APIConnectionError as e:
|
|
200
185
|
print("The server could not be reached")
|
|
201
186
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
@@ -238,7 +223,9 @@ client = Supermemory(
|
|
|
238
223
|
)
|
|
239
224
|
|
|
240
225
|
# Or, configure per-request:
|
|
241
|
-
client.with_options(max_retries=5).
|
|
226
|
+
client.with_options(max_retries=5).search.documents(
|
|
227
|
+
q="machine learning concepts",
|
|
228
|
+
)
|
|
242
229
|
```
|
|
243
230
|
|
|
244
231
|
### Timeouts
|
|
@@ -261,7 +248,9 @@ client = Supermemory(
|
|
|
261
248
|
)
|
|
262
249
|
|
|
263
250
|
# Override per-request:
|
|
264
|
-
client.with_options(timeout=5.0).
|
|
251
|
+
client.with_options(timeout=5.0).search.documents(
|
|
252
|
+
q="machine learning concepts",
|
|
253
|
+
)
|
|
265
254
|
```
|
|
266
255
|
|
|
267
256
|
On timeout, an `APITimeoutError` is thrown.
|
|
@@ -302,11 +291,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
302
291
|
from supermemory import Supermemory
|
|
303
292
|
|
|
304
293
|
client = Supermemory()
|
|
305
|
-
response = client.
|
|
294
|
+
response = client.search.with_raw_response.documents(
|
|
295
|
+
q="machine learning concepts",
|
|
296
|
+
)
|
|
306
297
|
print(response.headers.get('X-My-Header'))
|
|
307
298
|
|
|
308
|
-
|
|
309
|
-
print(
|
|
299
|
+
search = response.parse() # get the object that `search.documents()` would have returned
|
|
300
|
+
print(search.results)
|
|
310
301
|
```
|
|
311
302
|
|
|
312
303
|
These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object.
|
|
@@ -320,7 +311,9 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
320
311
|
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.
|
|
321
312
|
|
|
322
313
|
```python
|
|
323
|
-
with client.
|
|
314
|
+
with client.search.with_streaming_response.documents(
|
|
315
|
+
q="machine learning concepts",
|
|
316
|
+
) as response:
|
|
324
317
|
print(response.headers.get("X-My-Header"))
|
|
325
318
|
|
|
326
319
|
for line in response.iter_lines():
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
supermemory/__init__.py,sha256=PDWpv0_OWO8lBFh21lQl5k0zrlBzcGf643CKXRoQgzM,2664
|
|
2
|
+
supermemory/_base_client.py,sha256=bK0ae9oSv0vJ1OlcKMUbe3nqB_4chN9pI1EFiHpt0v4,67052
|
|
3
|
+
supermemory/_client.py,sha256=XCDomFBEKkDLBYTs6tx0yXho0VeFjSsrAnuc_6aOwVA,16328
|
|
4
|
+
supermemory/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
5
|
+
supermemory/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
|
+
supermemory/_exceptions.py,sha256=5nnX7W8L_eA6LkX3SBl7csJy5d9QEcDqRVuwDq8wVh8,3230
|
|
7
|
+
supermemory/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
|
|
8
|
+
supermemory/_models.py,sha256=c29x_mRccdxlGwdUPfSR5eJxGXe74Ea5Dje5igZTrKQ,30024
|
|
9
|
+
supermemory/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
|
10
|
+
supermemory/_resource.py,sha256=_wuaB1exMy-l-qqdJJdTv15hH5qBSN2Rj9CFwjXTZJU,1130
|
|
11
|
+
supermemory/_response.py,sha256=Yh869-U8INkojKZHFsNw69z5Y2BrK2isgRJ8mifEURM,28848
|
|
12
|
+
supermemory/_streaming.py,sha256=MGbosxSTqq0_JG52hvH2Z-Mr_Y95ws5UdFw77_iYukc,10120
|
|
13
|
+
supermemory/_types.py,sha256=QjJ-KUf9LVQjcoSDmaE5HGS-JPjxSqPr6_xQZrMisig,7301
|
|
14
|
+
supermemory/_version.py,sha256=3k6HeAMc3BROEEY8fsfJTLdhgARmjiA2lSD1sQNNdKA,172
|
|
15
|
+
supermemory/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
supermemory/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
|
+
supermemory/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
18
|
+
supermemory/_utils/_datetime_parse.py,sha256=bABTs0Bc6rabdFvnIwXjEhWL15TcRgWZ_6XGTqN8xUk,4204
|
|
19
|
+
supermemory/_utils/_logs.py,sha256=iceljYaEUb4Q4q1SgbSzwSrlJA64ISbaccczzZ8Z9Vg,789
|
|
20
|
+
supermemory/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
|
|
21
|
+
supermemory/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
|
22
|
+
supermemory/_utils/_resources_proxy.py,sha256=9MqlmhIEoyeVraNz90vnq1pS6EOxSqvYVlVK-CvLMmQ,614
|
|
23
|
+
supermemory/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
|
24
|
+
supermemory/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
|
25
|
+
supermemory/_utils/_transform.py,sha256=i_U4R82RtQJtKKCriwFqmfcWjtwmmsiiF1AEXKQ_OPo,15957
|
|
26
|
+
supermemory/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
27
|
+
supermemory/_utils/_utils.py,sha256=D2QE7mVPNEJzaB50u8rvDQAUDS5jx7JoeFD7zdj-TeI,12231
|
|
28
|
+
supermemory/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
29
|
+
supermemory/resources/__init__.py,sha256=GE_4JaZjfSY6B2WaoTqQ5C52tloAwBOww-1YK4roV_M,1543
|
|
30
|
+
supermemory/resources/connections.py,sha256=3F0qoyl_P8eNUJ1u1E_RBl7DEIFIn0QRm5vLNxn2T1s,33321
|
|
31
|
+
supermemory/resources/search.py,sha256=nL8VOpD9uyzWazOIsKmknuZiXrdYtEQ4vi6Jka6x2ao,28557
|
|
32
|
+
supermemory/resources/settings.py,sha256=tLM7ya1CEYI_TO8DMP_KLxXHqsxOeq3R3Xs4CQnvPuU,11855
|
|
33
|
+
supermemory/types/__init__.py,sha256=RmM24Xsd97VINnZ5XdTim-9L3oh-8kt-pYAn-UOQyZ0,2276
|
|
34
|
+
supermemory/types/connection_create_params.py,sha256=nhbXyd7hLyh7AuH4JrdfeWmiCj1H3YV22ycZzu4ggmk,670
|
|
35
|
+
supermemory/types/connection_create_response.py,sha256=i4sb0DSRs7wVVd8xDBOtr7vw-YbaeZ7MydlQLYvlvJs,468
|
|
36
|
+
supermemory/types/connection_delete_by_id_response.py,sha256=guD1vxqV2wiQnwnWCZSQH0z2HYXQOtvicRzouPVkHXA,243
|
|
37
|
+
supermemory/types/connection_delete_by_provider_params.py,sha256=inmWn18C-FCevq-mcsIRzcHwT5BEcH9LqOrlifBtnSQ,550
|
|
38
|
+
supermemory/types/connection_delete_by_provider_response.py,sha256=PgMQuSIhVFSF2LVa0FBei2bj3gyVRB7FyOi_-M-Rugc,255
|
|
39
|
+
supermemory/types/connection_get_by_id_response.py,sha256=H0xkm41aGnhzN29iPWit9xMjTvKfgoE8BY5xDlEYNtU,650
|
|
40
|
+
supermemory/types/connection_get_by_tags_params.py,sha256=c8u58EaxhEZrCERMix5H3lkVJqud0DIHd2Vsc8-mhok,526
|
|
41
|
+
supermemory/types/connection_get_by_tags_response.py,sha256=EX5wP1PHFO5uurKiTacudDX3Syp65TUJLN2KVZrb9QE,654
|
|
42
|
+
supermemory/types/connection_import_params.py,sha256=mUIuaeXLJe14_6vuFizs9sG_csibvQmn6eAdPll3pjA,510
|
|
43
|
+
supermemory/types/connection_import_response.py,sha256=W3Jn98_wmYGSAr4H553uoiutdWL49-myc6MDa0mFEog,210
|
|
44
|
+
supermemory/types/connection_list_documents_params.py,sha256=MBKSgfdV-Gx02DpV4ENk2ME8F1bz2JcXd7j6sYbooIk,522
|
|
45
|
+
supermemory/types/connection_list_documents_response.py,sha256=0IdHufx0yErjfmoXYeY0KJ2QID9C-_58joyGEuu8gd4,682
|
|
46
|
+
supermemory/types/connection_list_params.py,sha256=hg7wKFASpFqDnJ3Kycyziajimvx1p2q2fKJqfexxTF8,504
|
|
47
|
+
supermemory/types/connection_list_response.py,sha256=D4mYePuR9NAGMDkbgDncN-KjulLXbCWDfRBvRDXSE58,795
|
|
48
|
+
supermemory/types/search_documents_params.py,sha256=dvHbq4r_l5mGCfbKZ-Y8KQWK2ptLKXcW1-ZpEHKaqYc,3181
|
|
49
|
+
supermemory/types/search_documents_response.py,sha256=dCQ1UUOALmfPqnUpX_-_kFbV4eHPFcuT1b7AVtLq5y4,1464
|
|
50
|
+
supermemory/types/search_execute_params.py,sha256=0kVopvJnk67ZUWZspOi8s2mT0G6s1HXqllQPHEx-xBU,3177
|
|
51
|
+
supermemory/types/search_execute_response.py,sha256=U1Fh4JX433A442Di9nnaQq6ts1olDdz3-SSbKzIFBPc,1460
|
|
52
|
+
supermemory/types/search_memories_params.py,sha256=4SI8Z3ji_E_yqKmY5Nl-mL-7xODmRVV3TPsAeVefekU,1860
|
|
53
|
+
supermemory/types/search_memories_response.py,sha256=FfYDXRccWjMSWi-2sqpM7WHrVk_v5AAypHTmCWC5LJY,3288
|
|
54
|
+
supermemory/types/setting_get_response.py,sha256=WvgAb9zGMsMnAhLiYk6h5NBptnq0D06TnuoI4EJg5Ds,1648
|
|
55
|
+
supermemory/types/setting_update_params.py,sha256=KsreaS35v25aRKBY5vHna3hZ31U3b1Q5ruQLoM0gcyE,1710
|
|
56
|
+
supermemory/types/setting_update_response.py,sha256=F__RcFFWiiSw11IV8PsWn6POEb1crDwO8QwHEQToVuQ,1806
|
|
57
|
+
supermemory-3.0.0a30.dist-info/METADATA,sha256=bWoyruqNraB47cSHY5kueRgrH8boSVwMtDTRnN-d_pY,14313
|
|
58
|
+
supermemory-3.0.0a30.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
59
|
+
supermemory-3.0.0a30.dist-info/licenses/LICENSE,sha256=M2NcpYEBpakciOULpWzo-xO2Lincf74gGwfaU00Sct0,11341
|
|
60
|
+
supermemory-3.0.0a30.dist-info/RECORD,,
|