supermemory 3.0.0a30__py3-none-any.whl → 3.2.0__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/__init__.py +3 -1
- supermemory/_base_client.py +9 -9
- supermemory/_client.py +25 -9
- supermemory/_files.py +1 -1
- supermemory/_models.py +10 -4
- supermemory/_qs.py +7 -7
- supermemory/_types.py +18 -11
- supermemory/_utils/_transform.py +2 -2
- supermemory/_utils/_utils.py +4 -4
- supermemory/_version.py +1 -1
- supermemory/resources/__init__.py +28 -0
- supermemory/resources/connections.py +31 -31
- supermemory/resources/documents.py +894 -0
- supermemory/resources/memories.py +894 -0
- supermemory/resources/search.py +75 -75
- supermemory/resources/settings.py +35 -31
- supermemory/types/__init__.py +18 -0
- supermemory/types/document_add_params.py +69 -0
- supermemory/types/document_add_response.py +11 -0
- supermemory/types/document_get_response.py +104 -0
- supermemory/types/document_list_params.py +111 -0
- supermemory/types/document_list_response.py +95 -0
- supermemory/types/document_update_params.py +69 -0
- supermemory/types/document_update_response.py +11 -0
- supermemory/types/document_upload_file_params.py +36 -0
- supermemory/types/document_upload_file_response.py +11 -0
- supermemory/types/memory_add_params.py +69 -0
- supermemory/types/memory_add_response.py +11 -0
- supermemory/types/memory_get_response.py +104 -0
- supermemory/types/memory_list_params.py +111 -0
- supermemory/types/memory_list_response.py +95 -0
- supermemory/types/memory_update_params.py +69 -0
- supermemory/types/memory_update_response.py +11 -0
- supermemory/types/memory_upload_file_params.py +36 -0
- supermemory/types/memory_upload_file_response.py +11 -0
- supermemory/types/search_documents_params.py +68 -7
- supermemory/types/search_execute_params.py +68 -7
- supermemory/types/search_memories_params.py +77 -8
- supermemory/types/setting_get_response.py +2 -0
- supermemory/types/setting_update_params.py +2 -0
- supermemory/types/setting_update_response.py +2 -0
- {supermemory-3.0.0a30.dist-info → supermemory-3.2.0.dist-info}/METADATA +32 -15
- supermemory-3.2.0.dist-info/RECORD +80 -0
- supermemory-3.0.0a30.dist-info/RECORD +0 -60
- {supermemory-3.0.0a30.dist-info → supermemory-3.2.0.dist-info}/WHEEL +0 -0
- {supermemory-3.0.0a30.dist-info → supermemory-3.2.0.dist-info}/licenses/LICENSE +0 -0
supermemory/resources/search.py
CHANGED
|
@@ -8,7 +8,7 @@ from typing_extensions import Literal
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import search_execute_params, search_memories_params, search_documents_params
|
|
11
|
-
from .._types import
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
12
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -50,24 +50,24 @@ class SearchResource(SyncAPIResource):
|
|
|
50
50
|
self,
|
|
51
51
|
*,
|
|
52
52
|
q: str,
|
|
53
|
-
categories_filter: List[Literal["technology", "science", "business", "health"]] |
|
|
54
|
-
chunk_threshold: float |
|
|
55
|
-
container_tags: SequenceNotStr[str] |
|
|
56
|
-
doc_id: str |
|
|
57
|
-
document_threshold: float |
|
|
58
|
-
filters: search_documents_params.Filters |
|
|
59
|
-
include_full_docs: bool |
|
|
60
|
-
include_summary: bool |
|
|
61
|
-
limit: int |
|
|
62
|
-
only_matching_chunks: bool |
|
|
63
|
-
rerank: bool |
|
|
64
|
-
rewrite_query: bool |
|
|
53
|
+
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
|
|
54
|
+
chunk_threshold: float | Omit = omit,
|
|
55
|
+
container_tags: SequenceNotStr[str] | Omit = omit,
|
|
56
|
+
doc_id: str | Omit = omit,
|
|
57
|
+
document_threshold: float | Omit = omit,
|
|
58
|
+
filters: search_documents_params.Filters | Omit = omit,
|
|
59
|
+
include_full_docs: bool | Omit = omit,
|
|
60
|
+
include_summary: bool | Omit = omit,
|
|
61
|
+
limit: int | Omit = omit,
|
|
62
|
+
only_matching_chunks: bool | Omit = omit,
|
|
63
|
+
rerank: bool | Omit = omit,
|
|
64
|
+
rewrite_query: bool | Omit = omit,
|
|
65
65
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
66
66
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
67
67
|
extra_headers: Headers | None = None,
|
|
68
68
|
extra_query: Query | None = None,
|
|
69
69
|
extra_body: Body | None = None,
|
|
70
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
70
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
71
71
|
) -> SearchDocumentsResponse:
|
|
72
72
|
"""
|
|
73
73
|
Search memories with advanced filtering
|
|
@@ -91,7 +91,7 @@ class SearchResource(SyncAPIResource):
|
|
|
91
91
|
most documents, more results), 1 is most sensitive (returns lesser documents,
|
|
92
92
|
accurate results)
|
|
93
93
|
|
|
94
|
-
filters: Optional filters to apply to the search
|
|
94
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
95
95
|
|
|
96
96
|
include_full_docs: If true, include full document in the response. This is helpful if you want a
|
|
97
97
|
chatbot to know the full context of the document.
|
|
@@ -149,24 +149,24 @@ class SearchResource(SyncAPIResource):
|
|
|
149
149
|
self,
|
|
150
150
|
*,
|
|
151
151
|
q: str,
|
|
152
|
-
categories_filter: List[Literal["technology", "science", "business", "health"]] |
|
|
153
|
-
chunk_threshold: float |
|
|
154
|
-
container_tags: SequenceNotStr[str] |
|
|
155
|
-
doc_id: str |
|
|
156
|
-
document_threshold: float |
|
|
157
|
-
filters: search_execute_params.Filters |
|
|
158
|
-
include_full_docs: bool |
|
|
159
|
-
include_summary: bool |
|
|
160
|
-
limit: int |
|
|
161
|
-
only_matching_chunks: bool |
|
|
162
|
-
rerank: bool |
|
|
163
|
-
rewrite_query: bool |
|
|
152
|
+
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
|
|
153
|
+
chunk_threshold: float | Omit = omit,
|
|
154
|
+
container_tags: SequenceNotStr[str] | Omit = omit,
|
|
155
|
+
doc_id: str | Omit = omit,
|
|
156
|
+
document_threshold: float | Omit = omit,
|
|
157
|
+
filters: search_execute_params.Filters | Omit = omit,
|
|
158
|
+
include_full_docs: bool | Omit = omit,
|
|
159
|
+
include_summary: bool | Omit = omit,
|
|
160
|
+
limit: int | Omit = omit,
|
|
161
|
+
only_matching_chunks: bool | Omit = omit,
|
|
162
|
+
rerank: bool | Omit = omit,
|
|
163
|
+
rewrite_query: bool | Omit = omit,
|
|
164
164
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
165
165
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
166
166
|
extra_headers: Headers | None = None,
|
|
167
167
|
extra_query: Query | None = None,
|
|
168
168
|
extra_body: Body | None = None,
|
|
169
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
169
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
170
170
|
) -> SearchExecuteResponse:
|
|
171
171
|
"""
|
|
172
172
|
Search memories with advanced filtering
|
|
@@ -190,7 +190,7 @@ class SearchResource(SyncAPIResource):
|
|
|
190
190
|
most documents, more results), 1 is most sensitive (returns lesser documents,
|
|
191
191
|
accurate results)
|
|
192
192
|
|
|
193
|
-
filters: Optional filters to apply to the search
|
|
193
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
194
194
|
|
|
195
195
|
include_full_docs: If true, include full document in the response. This is helpful if you want a
|
|
196
196
|
chatbot to know the full context of the document.
|
|
@@ -248,19 +248,19 @@ class SearchResource(SyncAPIResource):
|
|
|
248
248
|
self,
|
|
249
249
|
*,
|
|
250
250
|
q: str,
|
|
251
|
-
container_tag: str |
|
|
252
|
-
filters: search_memories_params.Filters |
|
|
253
|
-
include: search_memories_params.Include |
|
|
254
|
-
limit: int |
|
|
255
|
-
rerank: bool |
|
|
256
|
-
rewrite_query: bool |
|
|
257
|
-
threshold: float |
|
|
251
|
+
container_tag: str | Omit = omit,
|
|
252
|
+
filters: search_memories_params.Filters | Omit = omit,
|
|
253
|
+
include: search_memories_params.Include | Omit = omit,
|
|
254
|
+
limit: int | Omit = omit,
|
|
255
|
+
rerank: bool | Omit = omit,
|
|
256
|
+
rewrite_query: bool | Omit = omit,
|
|
257
|
+
threshold: float | Omit = omit,
|
|
258
258
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
259
259
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
260
260
|
extra_headers: Headers | None = None,
|
|
261
261
|
extra_query: Query | None = None,
|
|
262
262
|
extra_body: Body | None = None,
|
|
263
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
263
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
264
264
|
) -> SearchMemoriesResponse:
|
|
265
265
|
"""
|
|
266
266
|
Search memory entries - Low latency for conversational
|
|
@@ -271,7 +271,7 @@ class SearchResource(SyncAPIResource):
|
|
|
271
271
|
container_tag: Optional tag this search should be containerized by. This can be an ID for your
|
|
272
272
|
user, a project ID, or any other identifier you wish to use to filter memories.
|
|
273
273
|
|
|
274
|
-
filters: Optional filters to apply to the search
|
|
274
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
275
275
|
|
|
276
276
|
limit: Maximum number of results to return
|
|
277
277
|
|
|
@@ -339,24 +339,24 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
339
339
|
self,
|
|
340
340
|
*,
|
|
341
341
|
q: str,
|
|
342
|
-
categories_filter: List[Literal["technology", "science", "business", "health"]] |
|
|
343
|
-
chunk_threshold: float |
|
|
344
|
-
container_tags: SequenceNotStr[str] |
|
|
345
|
-
doc_id: str |
|
|
346
|
-
document_threshold: float |
|
|
347
|
-
filters: search_documents_params.Filters |
|
|
348
|
-
include_full_docs: bool |
|
|
349
|
-
include_summary: bool |
|
|
350
|
-
limit: int |
|
|
351
|
-
only_matching_chunks: bool |
|
|
352
|
-
rerank: bool |
|
|
353
|
-
rewrite_query: bool |
|
|
342
|
+
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
|
|
343
|
+
chunk_threshold: float | Omit = omit,
|
|
344
|
+
container_tags: SequenceNotStr[str] | Omit = omit,
|
|
345
|
+
doc_id: str | Omit = omit,
|
|
346
|
+
document_threshold: float | Omit = omit,
|
|
347
|
+
filters: search_documents_params.Filters | Omit = omit,
|
|
348
|
+
include_full_docs: bool | Omit = omit,
|
|
349
|
+
include_summary: bool | Omit = omit,
|
|
350
|
+
limit: int | Omit = omit,
|
|
351
|
+
only_matching_chunks: bool | Omit = omit,
|
|
352
|
+
rerank: bool | Omit = omit,
|
|
353
|
+
rewrite_query: bool | Omit = omit,
|
|
354
354
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
355
355
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
356
356
|
extra_headers: Headers | None = None,
|
|
357
357
|
extra_query: Query | None = None,
|
|
358
358
|
extra_body: Body | None = None,
|
|
359
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
359
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
360
360
|
) -> SearchDocumentsResponse:
|
|
361
361
|
"""
|
|
362
362
|
Search memories with advanced filtering
|
|
@@ -380,7 +380,7 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
380
380
|
most documents, more results), 1 is most sensitive (returns lesser documents,
|
|
381
381
|
accurate results)
|
|
382
382
|
|
|
383
|
-
filters: Optional filters to apply to the search
|
|
383
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
384
384
|
|
|
385
385
|
include_full_docs: If true, include full document in the response. This is helpful if you want a
|
|
386
386
|
chatbot to know the full context of the document.
|
|
@@ -438,24 +438,24 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
438
438
|
self,
|
|
439
439
|
*,
|
|
440
440
|
q: str,
|
|
441
|
-
categories_filter: List[Literal["technology", "science", "business", "health"]] |
|
|
442
|
-
chunk_threshold: float |
|
|
443
|
-
container_tags: SequenceNotStr[str] |
|
|
444
|
-
doc_id: str |
|
|
445
|
-
document_threshold: float |
|
|
446
|
-
filters: search_execute_params.Filters |
|
|
447
|
-
include_full_docs: bool |
|
|
448
|
-
include_summary: bool |
|
|
449
|
-
limit: int |
|
|
450
|
-
only_matching_chunks: bool |
|
|
451
|
-
rerank: bool |
|
|
452
|
-
rewrite_query: bool |
|
|
441
|
+
categories_filter: List[Literal["technology", "science", "business", "health"]] | Omit = omit,
|
|
442
|
+
chunk_threshold: float | Omit = omit,
|
|
443
|
+
container_tags: SequenceNotStr[str] | Omit = omit,
|
|
444
|
+
doc_id: str | Omit = omit,
|
|
445
|
+
document_threshold: float | Omit = omit,
|
|
446
|
+
filters: search_execute_params.Filters | Omit = omit,
|
|
447
|
+
include_full_docs: bool | Omit = omit,
|
|
448
|
+
include_summary: bool | Omit = omit,
|
|
449
|
+
limit: int | Omit = omit,
|
|
450
|
+
only_matching_chunks: bool | Omit = omit,
|
|
451
|
+
rerank: bool | Omit = omit,
|
|
452
|
+
rewrite_query: bool | Omit = omit,
|
|
453
453
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
454
454
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
455
455
|
extra_headers: Headers | None = None,
|
|
456
456
|
extra_query: Query | None = None,
|
|
457
457
|
extra_body: Body | None = None,
|
|
458
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
458
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
459
459
|
) -> SearchExecuteResponse:
|
|
460
460
|
"""
|
|
461
461
|
Search memories with advanced filtering
|
|
@@ -479,7 +479,7 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
479
479
|
most documents, more results), 1 is most sensitive (returns lesser documents,
|
|
480
480
|
accurate results)
|
|
481
481
|
|
|
482
|
-
filters: Optional filters to apply to the search
|
|
482
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
483
483
|
|
|
484
484
|
include_full_docs: If true, include full document in the response. This is helpful if you want a
|
|
485
485
|
chatbot to know the full context of the document.
|
|
@@ -537,19 +537,19 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
537
537
|
self,
|
|
538
538
|
*,
|
|
539
539
|
q: str,
|
|
540
|
-
container_tag: str |
|
|
541
|
-
filters: search_memories_params.Filters |
|
|
542
|
-
include: search_memories_params.Include |
|
|
543
|
-
limit: int |
|
|
544
|
-
rerank: bool |
|
|
545
|
-
rewrite_query: bool |
|
|
546
|
-
threshold: float |
|
|
540
|
+
container_tag: str | Omit = omit,
|
|
541
|
+
filters: search_memories_params.Filters | Omit = omit,
|
|
542
|
+
include: search_memories_params.Include | Omit = omit,
|
|
543
|
+
limit: int | Omit = omit,
|
|
544
|
+
rerank: bool | Omit = omit,
|
|
545
|
+
rewrite_query: bool | Omit = omit,
|
|
546
|
+
threshold: float | Omit = omit,
|
|
547
547
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
548
548
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
549
549
|
extra_headers: Headers | None = None,
|
|
550
550
|
extra_query: Query | None = None,
|
|
551
551
|
extra_body: Body | None = None,
|
|
552
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
552
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
553
553
|
) -> SearchMemoriesResponse:
|
|
554
554
|
"""
|
|
555
555
|
Search memory entries - Low latency for conversational
|
|
@@ -560,7 +560,7 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
560
560
|
container_tag: Optional tag this search should be containerized by. This can be an ID for your
|
|
561
561
|
user, a project ID, or any other identifier you wish to use to filter memories.
|
|
562
562
|
|
|
563
|
-
filters: Optional filters to apply to the search
|
|
563
|
+
filters: Optional filters to apply to the search. Can be a JSON string or Query object.
|
|
564
564
|
|
|
565
565
|
limit: Maximum number of results to return
|
|
566
566
|
|
|
@@ -7,7 +7,7 @@ from typing import Dict, Union, Iterable, Optional
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
9
|
from ..types import setting_update_params
|
|
10
|
-
from .._types import
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
13
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -47,25 +47,26 @@ class SettingsResource(SyncAPIResource):
|
|
|
47
47
|
def update(
|
|
48
48
|
self,
|
|
49
49
|
*,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
chunk_size: Optional[int] | Omit = omit,
|
|
51
|
+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
52
|
+
filter_prompt: Optional[str] | Omit = omit,
|
|
53
|
+
google_drive_client_id: Optional[str] | Omit = omit,
|
|
54
|
+
google_drive_client_secret: Optional[str] | Omit = omit,
|
|
55
|
+
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
56
|
+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
57
|
+
notion_client_id: Optional[str] | Omit = omit,
|
|
58
|
+
notion_client_secret: Optional[str] | Omit = omit,
|
|
59
|
+
notion_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
60
|
+
onedrive_client_id: Optional[str] | Omit = omit,
|
|
61
|
+
onedrive_client_secret: Optional[str] | Omit = omit,
|
|
62
|
+
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
63
|
+
should_llm_filter: Optional[bool] | Omit = omit,
|
|
63
64
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
64
65
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
65
66
|
extra_headers: Headers | None = None,
|
|
66
67
|
extra_query: Query | None = None,
|
|
67
68
|
extra_body: Body | None = None,
|
|
68
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
69
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
69
70
|
) -> SettingUpdateResponse:
|
|
70
71
|
"""
|
|
71
72
|
Update settings for an organization
|
|
@@ -83,6 +84,7 @@ class SettingsResource(SyncAPIResource):
|
|
|
83
84
|
"/v3/settings",
|
|
84
85
|
body=maybe_transform(
|
|
85
86
|
{
|
|
87
|
+
"chunk_size": chunk_size,
|
|
86
88
|
"exclude_items": exclude_items,
|
|
87
89
|
"filter_prompt": filter_prompt,
|
|
88
90
|
"google_drive_client_id": google_drive_client_id,
|
|
@@ -113,7 +115,7 @@ class SettingsResource(SyncAPIResource):
|
|
|
113
115
|
extra_headers: Headers | None = None,
|
|
114
116
|
extra_query: Query | None = None,
|
|
115
117
|
extra_body: Body | None = None,
|
|
116
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
118
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
117
119
|
) -> SettingGetResponse:
|
|
118
120
|
"""Get settings for an organization"""
|
|
119
121
|
return self._get(
|
|
@@ -148,25 +150,26 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
|
148
150
|
async def update(
|
|
149
151
|
self,
|
|
150
152
|
*,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
chunk_size: Optional[int] | Omit = omit,
|
|
154
|
+
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
155
|
+
filter_prompt: Optional[str] | Omit = omit,
|
|
156
|
+
google_drive_client_id: Optional[str] | Omit = omit,
|
|
157
|
+
google_drive_client_secret: Optional[str] | Omit = omit,
|
|
158
|
+
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
159
|
+
include_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
160
|
+
notion_client_id: Optional[str] | Omit = omit,
|
|
161
|
+
notion_client_secret: Optional[str] | Omit = omit,
|
|
162
|
+
notion_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
163
|
+
onedrive_client_id: Optional[str] | Omit = omit,
|
|
164
|
+
onedrive_client_secret: Optional[str] | Omit = omit,
|
|
165
|
+
onedrive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
166
|
+
should_llm_filter: Optional[bool] | Omit = omit,
|
|
164
167
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
165
168
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
166
169
|
extra_headers: Headers | None = None,
|
|
167
170
|
extra_query: Query | None = None,
|
|
168
171
|
extra_body: Body | None = None,
|
|
169
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
172
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
170
173
|
) -> SettingUpdateResponse:
|
|
171
174
|
"""
|
|
172
175
|
Update settings for an organization
|
|
@@ -184,6 +187,7 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
|
184
187
|
"/v3/settings",
|
|
185
188
|
body=await async_maybe_transform(
|
|
186
189
|
{
|
|
190
|
+
"chunk_size": chunk_size,
|
|
187
191
|
"exclude_items": exclude_items,
|
|
188
192
|
"filter_prompt": filter_prompt,
|
|
189
193
|
"google_drive_client_id": google_drive_client_id,
|
|
@@ -214,7 +218,7 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
|
214
218
|
extra_headers: Headers | None = None,
|
|
215
219
|
extra_query: Query | None = None,
|
|
216
220
|
extra_body: Body | None = None,
|
|
217
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
221
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
218
222
|
) -> SettingGetResponse:
|
|
219
223
|
"""Get settings for an organization"""
|
|
220
224
|
return await self._get(
|
supermemory/types/__init__.py
CHANGED
|
@@ -2,10 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from .memory_add_params import MemoryAddParams as MemoryAddParams
|
|
6
|
+
from .memory_list_params import MemoryListParams as MemoryListParams
|
|
7
|
+
from .document_add_params import DocumentAddParams as DocumentAddParams
|
|
8
|
+
from .memory_add_response import MemoryAddResponse as MemoryAddResponse
|
|
9
|
+
from .memory_get_response import MemoryGetResponse as MemoryGetResponse
|
|
10
|
+
from .document_list_params import DocumentListParams as DocumentListParams
|
|
11
|
+
from .memory_list_response import MemoryListResponse as MemoryListResponse
|
|
12
|
+
from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
|
|
5
13
|
from .setting_get_response import SettingGetResponse as SettingGetResponse
|
|
14
|
+
from .document_add_response import DocumentAddResponse as DocumentAddResponse
|
|
15
|
+
from .document_get_response import DocumentGetResponse as DocumentGetResponse
|
|
6
16
|
from .search_execute_params import SearchExecuteParams as SearchExecuteParams
|
|
7
17
|
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
|
|
8
18
|
from .connection_list_params import ConnectionListParams as ConnectionListParams
|
|
19
|
+
from .document_list_response import DocumentListResponse as DocumentListResponse
|
|
20
|
+
from .document_update_params import DocumentUpdateParams as DocumentUpdateParams
|
|
21
|
+
from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
|
|
9
22
|
from .search_memories_params import SearchMemoriesParams as SearchMemoriesParams
|
|
10
23
|
from .search_documents_params import SearchDocumentsParams as SearchDocumentsParams
|
|
11
24
|
from .search_execute_response import SearchExecuteResponse as SearchExecuteResponse
|
|
@@ -13,12 +26,17 @@ from .setting_update_response import SettingUpdateResponse as SettingUpdateRespo
|
|
|
13
26
|
from .connection_create_params import ConnectionCreateParams as ConnectionCreateParams
|
|
14
27
|
from .connection_import_params import ConnectionImportParams as ConnectionImportParams
|
|
15
28
|
from .connection_list_response import ConnectionListResponse as ConnectionListResponse
|
|
29
|
+
from .document_update_response import DocumentUpdateResponse as DocumentUpdateResponse
|
|
16
30
|
from .search_memories_response import SearchMemoriesResponse as SearchMemoriesResponse
|
|
31
|
+
from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
|
|
17
32
|
from .search_documents_response import SearchDocumentsResponse as SearchDocumentsResponse
|
|
18
33
|
from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
|
|
19
34
|
from .connection_import_response import ConnectionImportResponse as ConnectionImportResponse
|
|
35
|
+
from .document_upload_file_params import DocumentUploadFileParams as DocumentUploadFileParams
|
|
36
|
+
from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse
|
|
20
37
|
from .connection_get_by_id_response import ConnectionGetByIDResponse as ConnectionGetByIDResponse
|
|
21
38
|
from .connection_get_by_tags_params import ConnectionGetByTagsParams as ConnectionGetByTagsParams
|
|
39
|
+
from .document_upload_file_response import DocumentUploadFileResponse as DocumentUploadFileResponse
|
|
22
40
|
from .connection_get_by_tags_response import ConnectionGetByTagsResponse as ConnectionGetByTagsResponse
|
|
23
41
|
from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse
|
|
24
42
|
from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentAddParams"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentAddParams(TypedDict, total=False):
|
|
15
|
+
content: Required[str]
|
|
16
|
+
"""The content to extract and process into a document.
|
|
17
|
+
|
|
18
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
19
|
+
|
|
20
|
+
Plaintext: Any plaintext format
|
|
21
|
+
|
|
22
|
+
URL: A URL to a website, PDF, image, or video
|
|
23
|
+
|
|
24
|
+
We automatically detect the content type from the url's response format.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]
|
|
28
|
+
"""Optional tag this document should be containerized by.
|
|
29
|
+
|
|
30
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
31
|
+
to use to group documents.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
container_tags: Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]
|
|
35
|
+
"""
|
|
36
|
+
(DEPRECATED: Use containerTag instead) Optional tags this document should be
|
|
37
|
+
containerized by. This can be an ID for your user, a project ID, or any other
|
|
38
|
+
identifier you wish to use to group documents.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
|
|
42
|
+
"""Optional custom ID of the document.
|
|
43
|
+
|
|
44
|
+
This could be an ID from your database that will uniquely identify this
|
|
45
|
+
document.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
file_type: Annotated[str, PropertyInfo(alias="fileType")]
|
|
49
|
+
"""Optional file type override to force specific processing behavior.
|
|
50
|
+
|
|
51
|
+
Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image,
|
|
52
|
+
video, notion_doc, webpage, onedrive
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]]
|
|
56
|
+
"""Optional metadata for the document.
|
|
57
|
+
|
|
58
|
+
This is used to store additional information about the document. You can use
|
|
59
|
+
this to store any additional information you need about the document. Metadata
|
|
60
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
61
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
|
|
65
|
+
"""Required when fileType is 'image' or 'video'.
|
|
66
|
+
|
|
67
|
+
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
|
|
68
|
+
'video/mp4', 'video/webm')
|
|
69
|
+
"""
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field as FieldInfo
|
|
8
|
+
|
|
9
|
+
from .._models import BaseModel
|
|
10
|
+
|
|
11
|
+
__all__ = ["DocumentGetResponse"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DocumentGetResponse(BaseModel):
|
|
15
|
+
id: str
|
|
16
|
+
"""Unique identifier of the document."""
|
|
17
|
+
|
|
18
|
+
connection_id: Optional[str] = FieldInfo(alias="connectionId", default=None)
|
|
19
|
+
"""Optional ID of connection the document was created from.
|
|
20
|
+
|
|
21
|
+
This is useful for identifying the source of the document.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
content: Optional[str] = None
|
|
25
|
+
"""The content to extract and process into a document.
|
|
26
|
+
|
|
27
|
+
This can be a URL to a website, a PDF, an image, or a video.
|
|
28
|
+
|
|
29
|
+
Plaintext: Any plaintext format
|
|
30
|
+
|
|
31
|
+
URL: A URL to a website, PDF, image, or video
|
|
32
|
+
|
|
33
|
+
We automatically detect the content type from the url's response format.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
created_at: datetime = FieldInfo(alias="createdAt")
|
|
37
|
+
"""Creation timestamp"""
|
|
38
|
+
|
|
39
|
+
custom_id: Optional[str] = FieldInfo(alias="customId", default=None)
|
|
40
|
+
"""Optional custom ID of the document.
|
|
41
|
+
|
|
42
|
+
This could be an ID from your database that will uniquely identify this
|
|
43
|
+
document.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
metadata: Union[str, float, bool, Dict[str, object], List[object], None] = None
|
|
47
|
+
"""Optional metadata for the document.
|
|
48
|
+
|
|
49
|
+
This is used to store additional information about the document. You can use
|
|
50
|
+
this to store any additional information you need about the document. Metadata
|
|
51
|
+
can be filtered through. Keys must be strings and are case sensitive. Values can
|
|
52
|
+
be strings, numbers, or booleans. You cannot nest objects.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
og_image: Optional[str] = FieldInfo(alias="ogImage", default=None)
|
|
56
|
+
|
|
57
|
+
source: Optional[str] = None
|
|
58
|
+
"""Source of the document"""
|
|
59
|
+
|
|
60
|
+
status: Literal["unknown", "queued", "extracting", "chunking", "embedding", "indexing", "done", "failed"]
|
|
61
|
+
"""Status of the document"""
|
|
62
|
+
|
|
63
|
+
summary: Optional[str] = None
|
|
64
|
+
"""Summary of the document content"""
|
|
65
|
+
|
|
66
|
+
summary_embedding_model: Optional[str] = FieldInfo(alias="summaryEmbeddingModel", default=None)
|
|
67
|
+
|
|
68
|
+
summary_embedding_model_new: Optional[str] = FieldInfo(alias="summaryEmbeddingModelNew", default=None)
|
|
69
|
+
|
|
70
|
+
summary_embedding_new: Optional[List[float]] = FieldInfo(alias="summaryEmbeddingNew", default=None)
|
|
71
|
+
|
|
72
|
+
title: Optional[str] = None
|
|
73
|
+
"""Title of the document"""
|
|
74
|
+
|
|
75
|
+
type: Literal[
|
|
76
|
+
"text",
|
|
77
|
+
"pdf",
|
|
78
|
+
"tweet",
|
|
79
|
+
"google_doc",
|
|
80
|
+
"google_slide",
|
|
81
|
+
"google_sheet",
|
|
82
|
+
"image",
|
|
83
|
+
"video",
|
|
84
|
+
"notion_doc",
|
|
85
|
+
"webpage",
|
|
86
|
+
"onedrive",
|
|
87
|
+
]
|
|
88
|
+
"""Type of the document"""
|
|
89
|
+
|
|
90
|
+
updated_at: datetime = FieldInfo(alias="updatedAt")
|
|
91
|
+
"""Last update timestamp"""
|
|
92
|
+
|
|
93
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
94
|
+
"""Optional tags this document should be containerized by.
|
|
95
|
+
|
|
96
|
+
This can be an ID for your user, a project ID, or any other identifier you wish
|
|
97
|
+
to use to group documents.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
raw: None = None
|
|
101
|
+
"""Raw content of the document"""
|
|
102
|
+
|
|
103
|
+
url: Optional[str] = None
|
|
104
|
+
"""URL of the document"""
|