supermemory 3.0.0a1__py3-none-any.whl → 3.0.0a2__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/__init__.py +2 -1
- supermemory/_base_client.py +44 -2
- supermemory/_client.py +1 -9
- supermemory/_files.py +1 -1
- supermemory/_models.py +2 -0
- supermemory/_types.py +2 -0
- supermemory/_version.py +1 -1
- supermemory/resources/__init__.py +0 -14
- supermemory/resources/connections.py +30 -117
- supermemory/resources/memories.py +102 -230
- supermemory/resources/settings.py +47 -11
- supermemory/types/__init__.py +0 -9
- supermemory/types/connection_create_params.py +5 -3
- supermemory/types/connection_get_response.py +4 -0
- supermemory/types/memory_add_params.py +28 -0
- supermemory/types/memory_get_response.py +87 -1
- supermemory/types/memory_update_params.py +28 -0
- supermemory/types/setting_get_response.py +36 -2
- supermemory/types/setting_update_params.py +30 -6
- supermemory/types/setting_update_response.py +34 -8
- {supermemory-3.0.0a1.dist-info → supermemory-3.0.0a2.dist-info}/METADATA +44 -24
- supermemory-3.0.0a2.dist-info/RECORD +46 -0
- supermemory/resources/search.py +0 -296
- supermemory/types/connection_list_params.py +0 -13
- supermemory/types/connection_list_response.py +0 -25
- supermemory/types/memory_delete_response.py +0 -9
- supermemory/types/memory_list_params.py +0 -24
- supermemory/types/memory_list_response.py +0 -95
- supermemory/types/memory_upload_file_params.py +0 -13
- supermemory/types/memory_upload_file_response.py +0 -11
- supermemory/types/search_execute_params.py +0 -86
- supermemory/types/search_execute_response.py +0 -52
- supermemory-3.0.0a1.dist-info/RECORD +0 -56
- {supermemory-3.0.0a1.dist-info → supermemory-3.0.0a2.dist-info}/WHEEL +0 -0
- {supermemory-3.0.0a1.dist-info → supermemory-3.0.0a2.dist-info}/licenses/LICENSE +0 -0
@@ -2,14 +2,13 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from typing import Dict, List, Union
|
6
|
-
from typing_extensions import Literal
|
5
|
+
from typing import Dict, List, Union
|
7
6
|
|
8
7
|
import httpx
|
9
8
|
|
10
|
-
from ..types import memory_add_params,
|
11
|
-
from .._types import NOT_GIVEN, Body, Query, Headers,
|
12
|
-
from .._utils import
|
9
|
+
from ..types import memory_add_params, memory_update_params
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
13
12
|
from .._compat import cached_property
|
14
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
15
14
|
from .._response import (
|
@@ -21,10 +20,7 @@ from .._response import (
|
|
21
20
|
from .._base_client import make_request_options
|
22
21
|
from ..types.memory_add_response import MemoryAddResponse
|
23
22
|
from ..types.memory_get_response import MemoryGetResponse
|
24
|
-
from ..types.memory_list_response import MemoryListResponse
|
25
|
-
from ..types.memory_delete_response import MemoryDeleteResponse
|
26
23
|
from ..types.memory_update_response import MemoryUpdateResponse
|
27
|
-
from ..types.memory_upload_file_response import MemoryUploadFileResponse
|
28
24
|
|
29
25
|
__all__ = ["MemoriesResource", "AsyncMemoriesResource"]
|
30
26
|
|
@@ -55,6 +51,7 @@ class MemoriesResource(SyncAPIResource):
|
|
55
51
|
*,
|
56
52
|
content: str,
|
57
53
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
54
|
+
custom_id: str | NotGiven = NOT_GIVEN,
|
58
55
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
59
56
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
60
57
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -67,6 +64,27 @@ class MemoriesResource(SyncAPIResource):
|
|
67
64
|
Update a memory with any content type (text, url, file, etc.) and metadata
|
68
65
|
|
69
66
|
Args:
|
67
|
+
content: The content to extract and process into a memory. This can be a URL to a
|
68
|
+
website, a PDF, an image, or a video.
|
69
|
+
|
70
|
+
Plaintext: Any plaintext format
|
71
|
+
|
72
|
+
URL: A URL to a website, PDF, image, or video
|
73
|
+
|
74
|
+
We automatically detect the content type from the url's response format.
|
75
|
+
|
76
|
+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
|
77
|
+
user, a project ID, or any other identifier you wish to use to group memories.
|
78
|
+
|
79
|
+
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
80
|
+
will uniquely identify this memory.
|
81
|
+
|
82
|
+
metadata: Optional metadata for the memory. This is used to store additional information
|
83
|
+
about the memory. You can use this to store any additional information you need
|
84
|
+
about the memory. Metadata can be filtered through. Keys must be strings and are
|
85
|
+
case sensitive. Values can be strings, numbers, or booleans. You cannot nest
|
86
|
+
objects.
|
87
|
+
|
70
88
|
extra_headers: Send extra headers
|
71
89
|
|
72
90
|
extra_query: Add additional query parameters to the request
|
@@ -83,6 +101,7 @@ class MemoriesResource(SyncAPIResource):
|
|
83
101
|
{
|
84
102
|
"content": content,
|
85
103
|
"container_tags": container_tags,
|
104
|
+
"custom_id": custom_id,
|
86
105
|
"metadata": metadata,
|
87
106
|
},
|
88
107
|
memory_update_params.MemoryUpdateParams,
|
@@ -93,64 +112,6 @@ class MemoriesResource(SyncAPIResource):
|
|
93
112
|
cast_to=MemoryUpdateResponse,
|
94
113
|
)
|
95
114
|
|
96
|
-
def list(
|
97
|
-
self,
|
98
|
-
*,
|
99
|
-
filters: str | NotGiven = NOT_GIVEN,
|
100
|
-
limit: str | NotGiven = NOT_GIVEN,
|
101
|
-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
102
|
-
page: str | NotGiven = NOT_GIVEN,
|
103
|
-
sort: Literal["createdAt", "updatedAt"] | NotGiven = NOT_GIVEN,
|
104
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
105
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
106
|
-
extra_headers: Headers | None = None,
|
107
|
-
extra_query: Query | None = None,
|
108
|
-
extra_body: Body | None = None,
|
109
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
110
|
-
) -> MemoryListResponse:
|
111
|
-
"""
|
112
|
-
Retrieves a paginated list of memories with their metadata and workflow status
|
113
|
-
|
114
|
-
Args:
|
115
|
-
filters: Optional filters to apply to the search
|
116
|
-
|
117
|
-
limit: Number of items per page
|
118
|
-
|
119
|
-
order: Sort order
|
120
|
-
|
121
|
-
page: Page number to fetch
|
122
|
-
|
123
|
-
sort: Field to sort by
|
124
|
-
|
125
|
-
extra_headers: Send extra headers
|
126
|
-
|
127
|
-
extra_query: Add additional query parameters to the request
|
128
|
-
|
129
|
-
extra_body: Add additional JSON properties to the request
|
130
|
-
|
131
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
132
|
-
"""
|
133
|
-
return self._get(
|
134
|
-
"/v3/memories",
|
135
|
-
options=make_request_options(
|
136
|
-
extra_headers=extra_headers,
|
137
|
-
extra_query=extra_query,
|
138
|
-
extra_body=extra_body,
|
139
|
-
timeout=timeout,
|
140
|
-
query=maybe_transform(
|
141
|
-
{
|
142
|
-
"filters": filters,
|
143
|
-
"limit": limit,
|
144
|
-
"order": order,
|
145
|
-
"page": page,
|
146
|
-
"sort": sort,
|
147
|
-
},
|
148
|
-
memory_list_params.MemoryListParams,
|
149
|
-
),
|
150
|
-
),
|
151
|
-
cast_to=MemoryListResponse,
|
152
|
-
)
|
153
|
-
|
154
115
|
def delete(
|
155
116
|
self,
|
156
117
|
id: str,
|
@@ -161,7 +122,7 @@ class MemoriesResource(SyncAPIResource):
|
|
161
122
|
extra_query: Query | None = None,
|
162
123
|
extra_body: Body | None = None,
|
163
124
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
164
|
-
) ->
|
125
|
+
) -> None:
|
165
126
|
"""
|
166
127
|
Delete a memory
|
167
128
|
|
@@ -176,12 +137,13 @@ class MemoriesResource(SyncAPIResource):
|
|
176
137
|
"""
|
177
138
|
if not id:
|
178
139
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
140
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
179
141
|
return self._delete(
|
180
142
|
f"/v3/memories/{id}",
|
181
143
|
options=make_request_options(
|
182
144
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
183
145
|
),
|
184
|
-
cast_to=
|
146
|
+
cast_to=NoneType,
|
185
147
|
)
|
186
148
|
|
187
149
|
def add(
|
@@ -189,6 +151,7 @@ class MemoriesResource(SyncAPIResource):
|
|
189
151
|
*,
|
190
152
|
content: str,
|
191
153
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
154
|
+
custom_id: str | NotGiven = NOT_GIVEN,
|
192
155
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
193
156
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
194
157
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -201,6 +164,27 @@ class MemoriesResource(SyncAPIResource):
|
|
201
164
|
Add a memory with any content type (text, url, file, etc.) and metadata
|
202
165
|
|
203
166
|
Args:
|
167
|
+
content: The content to extract and process into a memory. This can be a URL to a
|
168
|
+
website, a PDF, an image, or a video.
|
169
|
+
|
170
|
+
Plaintext: Any plaintext format
|
171
|
+
|
172
|
+
URL: A URL to a website, PDF, image, or video
|
173
|
+
|
174
|
+
We automatically detect the content type from the url's response format.
|
175
|
+
|
176
|
+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
|
177
|
+
user, a project ID, or any other identifier you wish to use to group memories.
|
178
|
+
|
179
|
+
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
180
|
+
will uniquely identify this memory.
|
181
|
+
|
182
|
+
metadata: Optional metadata for the memory. This is used to store additional information
|
183
|
+
about the memory. You can use this to store any additional information you need
|
184
|
+
about the memory. Metadata can be filtered through. Keys must be strings and are
|
185
|
+
case sensitive. Values can be strings, numbers, or booleans. You cannot nest
|
186
|
+
objects.
|
187
|
+
|
204
188
|
extra_headers: Send extra headers
|
205
189
|
|
206
190
|
extra_query: Add additional query parameters to the request
|
@@ -215,6 +199,7 @@ class MemoriesResource(SyncAPIResource):
|
|
215
199
|
{
|
216
200
|
"content": content,
|
217
201
|
"container_tags": container_tags,
|
202
|
+
"custom_id": custom_id,
|
218
203
|
"metadata": metadata,
|
219
204
|
},
|
220
205
|
memory_add_params.MemoryAddParams,
|
@@ -258,45 +243,6 @@ class MemoriesResource(SyncAPIResource):
|
|
258
243
|
cast_to=MemoryGetResponse,
|
259
244
|
)
|
260
245
|
|
261
|
-
def upload_file(
|
262
|
-
self,
|
263
|
-
*,
|
264
|
-
file: FileTypes,
|
265
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
266
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
267
|
-
extra_headers: Headers | None = None,
|
268
|
-
extra_query: Query | None = None,
|
269
|
-
extra_body: Body | None = None,
|
270
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
271
|
-
) -> MemoryUploadFileResponse:
|
272
|
-
"""
|
273
|
-
Upload a file to be processed
|
274
|
-
|
275
|
-
Args:
|
276
|
-
extra_headers: Send extra headers
|
277
|
-
|
278
|
-
extra_query: Add additional query parameters to the request
|
279
|
-
|
280
|
-
extra_body: Add additional JSON properties to the request
|
281
|
-
|
282
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
283
|
-
"""
|
284
|
-
body = deepcopy_minimal({"file": file})
|
285
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
286
|
-
# It should be noted that the actual Content-Type header that will be
|
287
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
288
|
-
# multipart/form-data; boundary=---abc--
|
289
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
290
|
-
return self._post(
|
291
|
-
"/v3/memories/file",
|
292
|
-
body=maybe_transform(body, memory_upload_file_params.MemoryUploadFileParams),
|
293
|
-
files=files,
|
294
|
-
options=make_request_options(
|
295
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
296
|
-
),
|
297
|
-
cast_to=MemoryUploadFileResponse,
|
298
|
-
)
|
299
|
-
|
300
246
|
|
301
247
|
class AsyncMemoriesResource(AsyncAPIResource):
|
302
248
|
@cached_property
|
@@ -324,6 +270,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
324
270
|
*,
|
325
271
|
content: str,
|
326
272
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
273
|
+
custom_id: str | NotGiven = NOT_GIVEN,
|
327
274
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
328
275
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
329
276
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -336,6 +283,27 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
336
283
|
Update a memory with any content type (text, url, file, etc.) and metadata
|
337
284
|
|
338
285
|
Args:
|
286
|
+
content: The content to extract and process into a memory. This can be a URL to a
|
287
|
+
website, a PDF, an image, or a video.
|
288
|
+
|
289
|
+
Plaintext: Any plaintext format
|
290
|
+
|
291
|
+
URL: A URL to a website, PDF, image, or video
|
292
|
+
|
293
|
+
We automatically detect the content type from the url's response format.
|
294
|
+
|
295
|
+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
|
296
|
+
user, a project ID, or any other identifier you wish to use to group memories.
|
297
|
+
|
298
|
+
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
299
|
+
will uniquely identify this memory.
|
300
|
+
|
301
|
+
metadata: Optional metadata for the memory. This is used to store additional information
|
302
|
+
about the memory. You can use this to store any additional information you need
|
303
|
+
about the memory. Metadata can be filtered through. Keys must be strings and are
|
304
|
+
case sensitive. Values can be strings, numbers, or booleans. You cannot nest
|
305
|
+
objects.
|
306
|
+
|
339
307
|
extra_headers: Send extra headers
|
340
308
|
|
341
309
|
extra_query: Add additional query parameters to the request
|
@@ -352,6 +320,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
352
320
|
{
|
353
321
|
"content": content,
|
354
322
|
"container_tags": container_tags,
|
323
|
+
"custom_id": custom_id,
|
355
324
|
"metadata": metadata,
|
356
325
|
},
|
357
326
|
memory_update_params.MemoryUpdateParams,
|
@@ -362,64 +331,6 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
362
331
|
cast_to=MemoryUpdateResponse,
|
363
332
|
)
|
364
333
|
|
365
|
-
async def list(
|
366
|
-
self,
|
367
|
-
*,
|
368
|
-
filters: str | NotGiven = NOT_GIVEN,
|
369
|
-
limit: str | NotGiven = NOT_GIVEN,
|
370
|
-
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
371
|
-
page: str | NotGiven = NOT_GIVEN,
|
372
|
-
sort: Literal["createdAt", "updatedAt"] | NotGiven = NOT_GIVEN,
|
373
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
374
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
375
|
-
extra_headers: Headers | None = None,
|
376
|
-
extra_query: Query | None = None,
|
377
|
-
extra_body: Body | None = None,
|
378
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
379
|
-
) -> MemoryListResponse:
|
380
|
-
"""
|
381
|
-
Retrieves a paginated list of memories with their metadata and workflow status
|
382
|
-
|
383
|
-
Args:
|
384
|
-
filters: Optional filters to apply to the search
|
385
|
-
|
386
|
-
limit: Number of items per page
|
387
|
-
|
388
|
-
order: Sort order
|
389
|
-
|
390
|
-
page: Page number to fetch
|
391
|
-
|
392
|
-
sort: Field to sort by
|
393
|
-
|
394
|
-
extra_headers: Send extra headers
|
395
|
-
|
396
|
-
extra_query: Add additional query parameters to the request
|
397
|
-
|
398
|
-
extra_body: Add additional JSON properties to the request
|
399
|
-
|
400
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
401
|
-
"""
|
402
|
-
return await self._get(
|
403
|
-
"/v3/memories",
|
404
|
-
options=make_request_options(
|
405
|
-
extra_headers=extra_headers,
|
406
|
-
extra_query=extra_query,
|
407
|
-
extra_body=extra_body,
|
408
|
-
timeout=timeout,
|
409
|
-
query=await async_maybe_transform(
|
410
|
-
{
|
411
|
-
"filters": filters,
|
412
|
-
"limit": limit,
|
413
|
-
"order": order,
|
414
|
-
"page": page,
|
415
|
-
"sort": sort,
|
416
|
-
},
|
417
|
-
memory_list_params.MemoryListParams,
|
418
|
-
),
|
419
|
-
),
|
420
|
-
cast_to=MemoryListResponse,
|
421
|
-
)
|
422
|
-
|
423
334
|
async def delete(
|
424
335
|
self,
|
425
336
|
id: str,
|
@@ -430,7 +341,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
430
341
|
extra_query: Query | None = None,
|
431
342
|
extra_body: Body | None = None,
|
432
343
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
433
|
-
) ->
|
344
|
+
) -> None:
|
434
345
|
"""
|
435
346
|
Delete a memory
|
436
347
|
|
@@ -445,12 +356,13 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
445
356
|
"""
|
446
357
|
if not id:
|
447
358
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
359
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
448
360
|
return await self._delete(
|
449
361
|
f"/v3/memories/{id}",
|
450
362
|
options=make_request_options(
|
451
363
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
452
364
|
),
|
453
|
-
cast_to=
|
365
|
+
cast_to=NoneType,
|
454
366
|
)
|
455
367
|
|
456
368
|
async def add(
|
@@ -458,6 +370,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
458
370
|
*,
|
459
371
|
content: str,
|
460
372
|
container_tags: List[str] | NotGiven = NOT_GIVEN,
|
373
|
+
custom_id: str | NotGiven = NOT_GIVEN,
|
461
374
|
metadata: Dict[str, Union[str, float, bool]] | NotGiven = NOT_GIVEN,
|
462
375
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
463
376
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -470,6 +383,27 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
470
383
|
Add a memory with any content type (text, url, file, etc.) and metadata
|
471
384
|
|
472
385
|
Args:
|
386
|
+
content: The content to extract and process into a memory. This can be a URL to a
|
387
|
+
website, a PDF, an image, or a video.
|
388
|
+
|
389
|
+
Plaintext: Any plaintext format
|
390
|
+
|
391
|
+
URL: A URL to a website, PDF, image, or video
|
392
|
+
|
393
|
+
We automatically detect the content type from the url's response format.
|
394
|
+
|
395
|
+
container_tags: Optional tags this memory should be containerized by. This can be an ID for your
|
396
|
+
user, a project ID, or any other identifier you wish to use to group memories.
|
397
|
+
|
398
|
+
custom_id: Optional custom ID of the memory. This could be an ID from your database that
|
399
|
+
will uniquely identify this memory.
|
400
|
+
|
401
|
+
metadata: Optional metadata for the memory. This is used to store additional information
|
402
|
+
about the memory. You can use this to store any additional information you need
|
403
|
+
about the memory. Metadata can be filtered through. Keys must be strings and are
|
404
|
+
case sensitive. Values can be strings, numbers, or booleans. You cannot nest
|
405
|
+
objects.
|
406
|
+
|
473
407
|
extra_headers: Send extra headers
|
474
408
|
|
475
409
|
extra_query: Add additional query parameters to the request
|
@@ -484,6 +418,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
484
418
|
{
|
485
419
|
"content": content,
|
486
420
|
"container_tags": container_tags,
|
421
|
+
"custom_id": custom_id,
|
487
422
|
"metadata": metadata,
|
488
423
|
},
|
489
424
|
memory_add_params.MemoryAddParams,
|
@@ -527,45 +462,6 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
527
462
|
cast_to=MemoryGetResponse,
|
528
463
|
)
|
529
464
|
|
530
|
-
async def upload_file(
|
531
|
-
self,
|
532
|
-
*,
|
533
|
-
file: FileTypes,
|
534
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
535
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
536
|
-
extra_headers: Headers | None = None,
|
537
|
-
extra_query: Query | None = None,
|
538
|
-
extra_body: Body | None = None,
|
539
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
540
|
-
) -> MemoryUploadFileResponse:
|
541
|
-
"""
|
542
|
-
Upload a file to be processed
|
543
|
-
|
544
|
-
Args:
|
545
|
-
extra_headers: Send extra headers
|
546
|
-
|
547
|
-
extra_query: Add additional query parameters to the request
|
548
|
-
|
549
|
-
extra_body: Add additional JSON properties to the request
|
550
|
-
|
551
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
552
|
-
"""
|
553
|
-
body = deepcopy_minimal({"file": file})
|
554
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
555
|
-
# It should be noted that the actual Content-Type header that will be
|
556
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
557
|
-
# multipart/form-data; boundary=---abc--
|
558
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
559
|
-
return await self._post(
|
560
|
-
"/v3/memories/file",
|
561
|
-
body=await async_maybe_transform(body, memory_upload_file_params.MemoryUploadFileParams),
|
562
|
-
files=files,
|
563
|
-
options=make_request_options(
|
564
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
565
|
-
),
|
566
|
-
cast_to=MemoryUploadFileResponse,
|
567
|
-
)
|
568
|
-
|
569
465
|
|
570
466
|
class MemoriesResourceWithRawResponse:
|
571
467
|
def __init__(self, memories: MemoriesResource) -> None:
|
@@ -574,9 +470,6 @@ class MemoriesResourceWithRawResponse:
|
|
574
470
|
self.update = to_raw_response_wrapper(
|
575
471
|
memories.update,
|
576
472
|
)
|
577
|
-
self.list = to_raw_response_wrapper(
|
578
|
-
memories.list,
|
579
|
-
)
|
580
473
|
self.delete = to_raw_response_wrapper(
|
581
474
|
memories.delete,
|
582
475
|
)
|
@@ -586,9 +479,6 @@ class MemoriesResourceWithRawResponse:
|
|
586
479
|
self.get = to_raw_response_wrapper(
|
587
480
|
memories.get,
|
588
481
|
)
|
589
|
-
self.upload_file = to_raw_response_wrapper(
|
590
|
-
memories.upload_file,
|
591
|
-
)
|
592
482
|
|
593
483
|
|
594
484
|
class AsyncMemoriesResourceWithRawResponse:
|
@@ -598,9 +488,6 @@ class AsyncMemoriesResourceWithRawResponse:
|
|
598
488
|
self.update = async_to_raw_response_wrapper(
|
599
489
|
memories.update,
|
600
490
|
)
|
601
|
-
self.list = async_to_raw_response_wrapper(
|
602
|
-
memories.list,
|
603
|
-
)
|
604
491
|
self.delete = async_to_raw_response_wrapper(
|
605
492
|
memories.delete,
|
606
493
|
)
|
@@ -610,9 +497,6 @@ class AsyncMemoriesResourceWithRawResponse:
|
|
610
497
|
self.get = async_to_raw_response_wrapper(
|
611
498
|
memories.get,
|
612
499
|
)
|
613
|
-
self.upload_file = async_to_raw_response_wrapper(
|
614
|
-
memories.upload_file,
|
615
|
-
)
|
616
500
|
|
617
501
|
|
618
502
|
class MemoriesResourceWithStreamingResponse:
|
@@ -622,9 +506,6 @@ class MemoriesResourceWithStreamingResponse:
|
|
622
506
|
self.update = to_streamed_response_wrapper(
|
623
507
|
memories.update,
|
624
508
|
)
|
625
|
-
self.list = to_streamed_response_wrapper(
|
626
|
-
memories.list,
|
627
|
-
)
|
628
509
|
self.delete = to_streamed_response_wrapper(
|
629
510
|
memories.delete,
|
630
511
|
)
|
@@ -634,9 +515,6 @@ class MemoriesResourceWithStreamingResponse:
|
|
634
515
|
self.get = to_streamed_response_wrapper(
|
635
516
|
memories.get,
|
636
517
|
)
|
637
|
-
self.upload_file = to_streamed_response_wrapper(
|
638
|
-
memories.upload_file,
|
639
|
-
)
|
640
518
|
|
641
519
|
|
642
520
|
class AsyncMemoriesResourceWithStreamingResponse:
|
@@ -646,9 +524,6 @@ class AsyncMemoriesResourceWithStreamingResponse:
|
|
646
524
|
self.update = async_to_streamed_response_wrapper(
|
647
525
|
memories.update,
|
648
526
|
)
|
649
|
-
self.list = async_to_streamed_response_wrapper(
|
650
|
-
memories.list,
|
651
|
-
)
|
652
527
|
self.delete = async_to_streamed_response_wrapper(
|
653
528
|
memories.delete,
|
654
529
|
)
|
@@ -658,6 +533,3 @@ class AsyncMemoriesResourceWithStreamingResponse:
|
|
658
533
|
self.get = async_to_streamed_response_wrapper(
|
659
534
|
memories.get,
|
660
535
|
)
|
661
|
-
self.upload_file = async_to_streamed_response_wrapper(
|
662
|
-
memories.upload_file,
|
663
|
-
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from typing import Dict,
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
6
6
|
|
7
7
|
import httpx
|
8
8
|
|
@@ -47,11 +47,20 @@ class SettingsResource(SyncAPIResource):
|
|
47
47
|
def update(
|
48
48
|
self,
|
49
49
|
*,
|
50
|
-
exclude_items:
|
51
|
-
filter_prompt: str | NotGiven = NOT_GIVEN,
|
52
|
-
filter_tags:
|
53
|
-
|
54
|
-
|
50
|
+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
51
|
+
filter_prompt: Optional[str] | NotGiven = NOT_GIVEN,
|
52
|
+
filter_tags: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
53
|
+
google_drive_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
54
|
+
google_drive_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
55
|
+
google_drive_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
56
|
+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
57
|
+
notion_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
58
|
+
notion_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
59
|
+
notion_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
60
|
+
onedrive_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
61
|
+
onedrive_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
62
|
+
onedrive_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
63
|
+
should_llm_filter: Optional[bool] | NotGiven = NOT_GIVEN,
|
55
64
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
56
65
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
57
66
|
extra_headers: Headers | None = None,
|
@@ -78,7 +87,16 @@ class SettingsResource(SyncAPIResource):
|
|
78
87
|
"exclude_items": exclude_items,
|
79
88
|
"filter_prompt": filter_prompt,
|
80
89
|
"filter_tags": filter_tags,
|
90
|
+
"google_drive_client_id": google_drive_client_id,
|
91
|
+
"google_drive_client_secret": google_drive_client_secret,
|
92
|
+
"google_drive_custom_key_enabled": google_drive_custom_key_enabled,
|
81
93
|
"include_items": include_items,
|
94
|
+
"notion_client_id": notion_client_id,
|
95
|
+
"notion_client_secret": notion_client_secret,
|
96
|
+
"notion_custom_key_enabled": notion_custom_key_enabled,
|
97
|
+
"onedrive_client_id": onedrive_client_id,
|
98
|
+
"onedrive_client_secret": onedrive_client_secret,
|
99
|
+
"onedrive_custom_key_enabled": onedrive_custom_key_enabled,
|
82
100
|
"should_llm_filter": should_llm_filter,
|
83
101
|
},
|
84
102
|
setting_update_params.SettingUpdateParams,
|
@@ -132,11 +150,20 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
132
150
|
async def update(
|
133
151
|
self,
|
134
152
|
*,
|
135
|
-
exclude_items:
|
136
|
-
filter_prompt: str | NotGiven = NOT_GIVEN,
|
137
|
-
filter_tags:
|
138
|
-
|
139
|
-
|
153
|
+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
154
|
+
filter_prompt: Optional[str] | NotGiven = NOT_GIVEN,
|
155
|
+
filter_tags: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
156
|
+
google_drive_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
157
|
+
google_drive_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
158
|
+
google_drive_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
159
|
+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | NotGiven = NOT_GIVEN,
|
160
|
+
notion_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
161
|
+
notion_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
162
|
+
notion_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
163
|
+
onedrive_client_id: Optional[str] | NotGiven = NOT_GIVEN,
|
164
|
+
onedrive_client_secret: Optional[str] | NotGiven = NOT_GIVEN,
|
165
|
+
onedrive_custom_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
166
|
+
should_llm_filter: Optional[bool] | NotGiven = NOT_GIVEN,
|
140
167
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
141
168
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
142
169
|
extra_headers: Headers | None = None,
|
@@ -163,7 +190,16 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
163
190
|
"exclude_items": exclude_items,
|
164
191
|
"filter_prompt": filter_prompt,
|
165
192
|
"filter_tags": filter_tags,
|
193
|
+
"google_drive_client_id": google_drive_client_id,
|
194
|
+
"google_drive_client_secret": google_drive_client_secret,
|
195
|
+
"google_drive_custom_key_enabled": google_drive_custom_key_enabled,
|
166
196
|
"include_items": include_items,
|
197
|
+
"notion_client_id": notion_client_id,
|
198
|
+
"notion_client_secret": notion_client_secret,
|
199
|
+
"notion_custom_key_enabled": notion_custom_key_enabled,
|
200
|
+
"onedrive_client_id": onedrive_client_id,
|
201
|
+
"onedrive_client_secret": onedrive_client_secret,
|
202
|
+
"onedrive_custom_key_enabled": onedrive_custom_key_enabled,
|
167
203
|
"should_llm_filter": should_llm_filter,
|
168
204
|
},
|
169
205
|
setting_update_params.SettingUpdateParams,
|
supermemory/types/__init__.py
CHANGED
@@ -3,22 +3,13 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
from .memory_add_params import MemoryAddParams as MemoryAddParams
|
6
|
-
from .memory_list_params import MemoryListParams as MemoryListParams
|
7
6
|
from .memory_add_response import MemoryAddResponse as MemoryAddResponse
|
8
7
|
from .memory_get_response import MemoryGetResponse as MemoryGetResponse
|
9
|
-
from .memory_list_response import MemoryListResponse as MemoryListResponse
|
10
8
|
from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
|
11
9
|
from .setting_get_response import SettingGetResponse as SettingGetResponse
|
12
|
-
from .search_execute_params import SearchExecuteParams as SearchExecuteParams
|
13
10
|
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
|
14
|
-
from .connection_list_params import ConnectionListParams as ConnectionListParams
|
15
|
-
from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
|
16
11
|
from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
|
17
12
|
from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse
|
18
|
-
from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
|
19
13
|
from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse
|
20
14
|
from .connection_create_params import ConnectionCreateParams as ConnectionCreateParams
|
21
|
-
from .connection_list_response import ConnectionListResponse as ConnectionListResponse
|
22
|
-
from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
|
23
15
|
from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
|
24
|
-
from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from typing import Dict, Union, Optional
|
5
|
+
from typing import Dict, List, Union, Optional
|
6
6
|
from typing_extensions import Annotated, TypedDict
|
7
7
|
|
8
8
|
from .._utils import PropertyInfo
|
@@ -11,8 +11,10 @@ __all__ = ["ConnectionCreateParams"]
|
|
11
11
|
|
12
12
|
|
13
13
|
class ConnectionCreateParams(TypedDict, total=False):
|
14
|
-
|
14
|
+
container_tags: Annotated[List[str], PropertyInfo(alias="containerTags")]
|
15
15
|
|
16
|
-
|
16
|
+
document_limit: Annotated[int, PropertyInfo(alias="documentLimit")]
|
17
17
|
|
18
18
|
metadata: Optional[Dict[str, Union[str, float, bool]]]
|
19
|
+
|
20
|
+
redirect_url: Annotated[str, PropertyInfo(alias="redirectUrl")]
|