supermemory 3.7.0__py3-none-any.whl → 3.19.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.
- supermemory/_base_client.py +140 -11
- supermemory/_client.py +226 -52
- supermemory/_models.py +16 -1
- supermemory/_streaming.py +12 -10
- supermemory/_types.py +12 -2
- supermemory/_version.py +1 -1
- supermemory/resources/connections.py +219 -29
- supermemory/resources/documents.py +306 -2
- supermemory/resources/memories.py +270 -1
- supermemory/resources/search.py +14 -0
- supermemory/resources/settings.py +12 -0
- supermemory/types/__init__.py +15 -2
- supermemory/types/client_profile_params.py +6 -0
- supermemory/types/connection_configure_params.py +12 -0
- supermemory/types/connection_configure_response.py +17 -0
- supermemory/types/connection_get_by_id_response.py +3 -1
- supermemory/types/{connection_get_by_tags_params.py → connection_get_by_tag_params.py} +2 -2
- supermemory/types/{connection_get_by_tags_response.py → connection_get_by_tag_response.py} +5 -3
- supermemory/types/connection_list_response.py +2 -0
- supermemory/types/connection_resources_params.py +13 -0
- supermemory/types/connection_resources_response.py +13 -0
- supermemory/types/document_batch_add_params.py +84 -0
- supermemory/types/document_batch_add_response.py +19 -0
- supermemory/types/document_delete_bulk_params.py +18 -0
- supermemory/types/document_delete_bulk_response.py +37 -0
- supermemory/types/document_get_response.py +7 -0
- supermemory/types/document_list_params.py +3790 -3
- supermemory/types/document_list_processing_response.py +75 -0
- supermemory/types/document_list_response.py +5 -0
- supermemory/types/document_upload_file_params.py +8 -0
- supermemory/types/memory_forget_params.py +26 -0
- supermemory/types/memory_forget_response.py +15 -0
- supermemory/types/memory_get_response.py +7 -0
- supermemory/types/memory_list_params.py +3790 -3
- supermemory/types/memory_list_response.py +5 -0
- supermemory/types/memory_update_memory_params.py +31 -0
- supermemory/types/memory_update_memory_response.py +31 -0
- supermemory/types/memory_upload_file_params.py +8 -0
- supermemory/types/profile_response.py +2 -0
- supermemory/types/search_documents_params.py +3791 -4
- supermemory/types/search_documents_response.py +2 -0
- supermemory/types/search_execute_params.py +3791 -4
- supermemory/types/search_execute_response.py +2 -0
- supermemory/types/search_memories_params.py +3809 -8
- supermemory/types/search_memories_response.py +33 -5
- supermemory/types/setting_get_response.py +6 -0
- supermemory/types/setting_update_params.py +6 -0
- supermemory/types/setting_update_response.py +6 -0
- {supermemory-3.7.0.dist-info → supermemory-3.19.0.dist-info}/METADATA +12 -2
- supermemory-3.19.0.dist-info/RECORD +97 -0
- {supermemory-3.7.0.dist-info → supermemory-3.19.0.dist-info}/licenses/LICENSE +1 -1
- supermemory-3.7.0.dist-info/RECORD +0 -84
- {supermemory-3.7.0.dist-info → supermemory-3.19.0.dist-info}/WHEEL +0 -0
|
@@ -7,7 +7,14 @@ from typing_extensions import Literal
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import
|
|
10
|
+
from ..types import (
|
|
11
|
+
memory_add_params,
|
|
12
|
+
memory_list_params,
|
|
13
|
+
memory_forget_params,
|
|
14
|
+
memory_update_params,
|
|
15
|
+
memory_upload_file_params,
|
|
16
|
+
memory_update_memory_params,
|
|
17
|
+
)
|
|
11
18
|
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, SequenceNotStr, omit, not_given
|
|
12
19
|
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
|
|
13
20
|
from .._compat import cached_property
|
|
@@ -22,8 +29,10 @@ from .._base_client import make_request_options
|
|
|
22
29
|
from ..types.memory_add_response import MemoryAddResponse
|
|
23
30
|
from ..types.memory_get_response import MemoryGetResponse
|
|
24
31
|
from ..types.memory_list_response import MemoryListResponse
|
|
32
|
+
from ..types.memory_forget_response import MemoryForgetResponse
|
|
25
33
|
from ..types.memory_update_response import MemoryUpdateResponse
|
|
26
34
|
from ..types.memory_upload_file_response import MemoryUploadFileResponse
|
|
35
|
+
from ..types.memory_update_memory_response import MemoryUpdateMemoryResponse
|
|
27
36
|
|
|
28
37
|
__all__ = ["MemoriesResource", "AsyncMemoriesResource"]
|
|
29
38
|
|
|
@@ -278,6 +287,60 @@ class MemoriesResource(SyncAPIResource):
|
|
|
278
287
|
cast_to=MemoryAddResponse,
|
|
279
288
|
)
|
|
280
289
|
|
|
290
|
+
def forget(
|
|
291
|
+
self,
|
|
292
|
+
*,
|
|
293
|
+
container_tag: str,
|
|
294
|
+
id: str | Omit = omit,
|
|
295
|
+
content: str | Omit = omit,
|
|
296
|
+
reason: str | Omit = omit,
|
|
297
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
298
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
299
|
+
extra_headers: Headers | None = None,
|
|
300
|
+
extra_query: Query | None = None,
|
|
301
|
+
extra_body: Body | None = None,
|
|
302
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
303
|
+
) -> MemoryForgetResponse:
|
|
304
|
+
"""Forget (soft delete) a memory entry.
|
|
305
|
+
|
|
306
|
+
The memory is marked as forgotten but not
|
|
307
|
+
permanently deleted.
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
container_tag: Container tag / space identifier. Required to scope the operation.
|
|
311
|
+
|
|
312
|
+
id: ID of the memory entry to operate on
|
|
313
|
+
|
|
314
|
+
content: Exact content match of the memory entry to operate on. Use this when you don't
|
|
315
|
+
have the ID.
|
|
316
|
+
|
|
317
|
+
reason: Optional reason for forgetting this memory
|
|
318
|
+
|
|
319
|
+
extra_headers: Send extra headers
|
|
320
|
+
|
|
321
|
+
extra_query: Add additional query parameters to the request
|
|
322
|
+
|
|
323
|
+
extra_body: Add additional JSON properties to the request
|
|
324
|
+
|
|
325
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
326
|
+
"""
|
|
327
|
+
return self._delete(
|
|
328
|
+
"/v4/memories",
|
|
329
|
+
body=maybe_transform(
|
|
330
|
+
{
|
|
331
|
+
"container_tag": container_tag,
|
|
332
|
+
"id": id,
|
|
333
|
+
"content": content,
|
|
334
|
+
"reason": reason,
|
|
335
|
+
},
|
|
336
|
+
memory_forget_params.MemoryForgetParams,
|
|
337
|
+
),
|
|
338
|
+
options=make_request_options(
|
|
339
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
340
|
+
),
|
|
341
|
+
cast_to=MemoryForgetResponse,
|
|
342
|
+
)
|
|
343
|
+
|
|
281
344
|
def get(
|
|
282
345
|
self,
|
|
283
346
|
id: str,
|
|
@@ -311,6 +374,64 @@ class MemoriesResource(SyncAPIResource):
|
|
|
311
374
|
cast_to=MemoryGetResponse,
|
|
312
375
|
)
|
|
313
376
|
|
|
377
|
+
def update_memory(
|
|
378
|
+
self,
|
|
379
|
+
*,
|
|
380
|
+
container_tag: str,
|
|
381
|
+
new_content: str,
|
|
382
|
+
id: str | Omit = omit,
|
|
383
|
+
content: str | Omit = omit,
|
|
384
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit,
|
|
385
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
386
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
387
|
+
extra_headers: Headers | None = None,
|
|
388
|
+
extra_query: Query | None = None,
|
|
389
|
+
extra_body: Body | None = None,
|
|
390
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
391
|
+
) -> MemoryUpdateMemoryResponse:
|
|
392
|
+
"""Update a memory by creating a new version.
|
|
393
|
+
|
|
394
|
+
The original memory is preserved with
|
|
395
|
+
isLatest=false.
|
|
396
|
+
|
|
397
|
+
Args:
|
|
398
|
+
container_tag: Container tag / space identifier. Required to scope the operation.
|
|
399
|
+
|
|
400
|
+
new_content: The new content that will replace the existing memory
|
|
401
|
+
|
|
402
|
+
id: ID of the memory entry to operate on
|
|
403
|
+
|
|
404
|
+
content: Exact content match of the memory entry to operate on. Use this when you don't
|
|
405
|
+
have the ID.
|
|
406
|
+
|
|
407
|
+
metadata: Optional metadata. If not provided, inherits from the previous version.
|
|
408
|
+
|
|
409
|
+
extra_headers: Send extra headers
|
|
410
|
+
|
|
411
|
+
extra_query: Add additional query parameters to the request
|
|
412
|
+
|
|
413
|
+
extra_body: Add additional JSON properties to the request
|
|
414
|
+
|
|
415
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
416
|
+
"""
|
|
417
|
+
return self._patch(
|
|
418
|
+
"/v4/memories",
|
|
419
|
+
body=maybe_transform(
|
|
420
|
+
{
|
|
421
|
+
"container_tag": container_tag,
|
|
422
|
+
"new_content": new_content,
|
|
423
|
+
"id": id,
|
|
424
|
+
"content": content,
|
|
425
|
+
"metadata": metadata,
|
|
426
|
+
},
|
|
427
|
+
memory_update_memory_params.MemoryUpdateMemoryParams,
|
|
428
|
+
),
|
|
429
|
+
options=make_request_options(
|
|
430
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
431
|
+
),
|
|
432
|
+
cast_to=MemoryUpdateMemoryResponse,
|
|
433
|
+
)
|
|
434
|
+
|
|
314
435
|
def upload_file(
|
|
315
436
|
self,
|
|
316
437
|
*,
|
|
@@ -319,6 +440,7 @@ class MemoriesResource(SyncAPIResource):
|
|
|
319
440
|
file_type: str | Omit = omit,
|
|
320
441
|
metadata: str | Omit = omit,
|
|
321
442
|
mime_type: str | Omit = omit,
|
|
443
|
+
use_advanced_processing: str | Omit = omit,
|
|
322
444
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
445
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
446
|
extra_headers: Headers | None = None,
|
|
@@ -348,6 +470,10 @@ class MemoriesResource(SyncAPIResource):
|
|
|
348
470
|
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
|
|
349
471
|
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
|
|
350
472
|
|
|
473
|
+
use_advanced_processing: DEPRECATED: This field is no longer used. Advanced PDF processing is now
|
|
474
|
+
automatic with our hybrid Mistral OCR + Gemini pipeline. This parameter will be
|
|
475
|
+
accepted but ignored for backwards compatibility.
|
|
476
|
+
|
|
351
477
|
extra_headers: Send extra headers
|
|
352
478
|
|
|
353
479
|
extra_query: Add additional query parameters to the request
|
|
@@ -363,6 +489,7 @@ class MemoriesResource(SyncAPIResource):
|
|
|
363
489
|
"file_type": file_type,
|
|
364
490
|
"metadata": metadata,
|
|
365
491
|
"mime_type": mime_type,
|
|
492
|
+
"use_advanced_processing": use_advanced_processing,
|
|
366
493
|
}
|
|
367
494
|
)
|
|
368
495
|
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
@@ -631,6 +758,60 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
631
758
|
cast_to=MemoryAddResponse,
|
|
632
759
|
)
|
|
633
760
|
|
|
761
|
+
async def forget(
|
|
762
|
+
self,
|
|
763
|
+
*,
|
|
764
|
+
container_tag: str,
|
|
765
|
+
id: str | Omit = omit,
|
|
766
|
+
content: str | Omit = omit,
|
|
767
|
+
reason: str | Omit = omit,
|
|
768
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
769
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
770
|
+
extra_headers: Headers | None = None,
|
|
771
|
+
extra_query: Query | None = None,
|
|
772
|
+
extra_body: Body | None = None,
|
|
773
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
774
|
+
) -> MemoryForgetResponse:
|
|
775
|
+
"""Forget (soft delete) a memory entry.
|
|
776
|
+
|
|
777
|
+
The memory is marked as forgotten but not
|
|
778
|
+
permanently deleted.
|
|
779
|
+
|
|
780
|
+
Args:
|
|
781
|
+
container_tag: Container tag / space identifier. Required to scope the operation.
|
|
782
|
+
|
|
783
|
+
id: ID of the memory entry to operate on
|
|
784
|
+
|
|
785
|
+
content: Exact content match of the memory entry to operate on. Use this when you don't
|
|
786
|
+
have the ID.
|
|
787
|
+
|
|
788
|
+
reason: Optional reason for forgetting this memory
|
|
789
|
+
|
|
790
|
+
extra_headers: Send extra headers
|
|
791
|
+
|
|
792
|
+
extra_query: Add additional query parameters to the request
|
|
793
|
+
|
|
794
|
+
extra_body: Add additional JSON properties to the request
|
|
795
|
+
|
|
796
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
797
|
+
"""
|
|
798
|
+
return await self._delete(
|
|
799
|
+
"/v4/memories",
|
|
800
|
+
body=await async_maybe_transform(
|
|
801
|
+
{
|
|
802
|
+
"container_tag": container_tag,
|
|
803
|
+
"id": id,
|
|
804
|
+
"content": content,
|
|
805
|
+
"reason": reason,
|
|
806
|
+
},
|
|
807
|
+
memory_forget_params.MemoryForgetParams,
|
|
808
|
+
),
|
|
809
|
+
options=make_request_options(
|
|
810
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
811
|
+
),
|
|
812
|
+
cast_to=MemoryForgetResponse,
|
|
813
|
+
)
|
|
814
|
+
|
|
634
815
|
async def get(
|
|
635
816
|
self,
|
|
636
817
|
id: str,
|
|
@@ -664,6 +845,64 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
664
845
|
cast_to=MemoryGetResponse,
|
|
665
846
|
)
|
|
666
847
|
|
|
848
|
+
async def update_memory(
|
|
849
|
+
self,
|
|
850
|
+
*,
|
|
851
|
+
container_tag: str,
|
|
852
|
+
new_content: str,
|
|
853
|
+
id: str | Omit = omit,
|
|
854
|
+
content: str | Omit = omit,
|
|
855
|
+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit,
|
|
856
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
857
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
858
|
+
extra_headers: Headers | None = None,
|
|
859
|
+
extra_query: Query | None = None,
|
|
860
|
+
extra_body: Body | None = None,
|
|
861
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
862
|
+
) -> MemoryUpdateMemoryResponse:
|
|
863
|
+
"""Update a memory by creating a new version.
|
|
864
|
+
|
|
865
|
+
The original memory is preserved with
|
|
866
|
+
isLatest=false.
|
|
867
|
+
|
|
868
|
+
Args:
|
|
869
|
+
container_tag: Container tag / space identifier. Required to scope the operation.
|
|
870
|
+
|
|
871
|
+
new_content: The new content that will replace the existing memory
|
|
872
|
+
|
|
873
|
+
id: ID of the memory entry to operate on
|
|
874
|
+
|
|
875
|
+
content: Exact content match of the memory entry to operate on. Use this when you don't
|
|
876
|
+
have the ID.
|
|
877
|
+
|
|
878
|
+
metadata: Optional metadata. If not provided, inherits from the previous version.
|
|
879
|
+
|
|
880
|
+
extra_headers: Send extra headers
|
|
881
|
+
|
|
882
|
+
extra_query: Add additional query parameters to the request
|
|
883
|
+
|
|
884
|
+
extra_body: Add additional JSON properties to the request
|
|
885
|
+
|
|
886
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
887
|
+
"""
|
|
888
|
+
return await self._patch(
|
|
889
|
+
"/v4/memories",
|
|
890
|
+
body=await async_maybe_transform(
|
|
891
|
+
{
|
|
892
|
+
"container_tag": container_tag,
|
|
893
|
+
"new_content": new_content,
|
|
894
|
+
"id": id,
|
|
895
|
+
"content": content,
|
|
896
|
+
"metadata": metadata,
|
|
897
|
+
},
|
|
898
|
+
memory_update_memory_params.MemoryUpdateMemoryParams,
|
|
899
|
+
),
|
|
900
|
+
options=make_request_options(
|
|
901
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
902
|
+
),
|
|
903
|
+
cast_to=MemoryUpdateMemoryResponse,
|
|
904
|
+
)
|
|
905
|
+
|
|
667
906
|
async def upload_file(
|
|
668
907
|
self,
|
|
669
908
|
*,
|
|
@@ -672,6 +911,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
672
911
|
file_type: str | Omit = omit,
|
|
673
912
|
metadata: str | Omit = omit,
|
|
674
913
|
mime_type: str | Omit = omit,
|
|
914
|
+
use_advanced_processing: str | Omit = omit,
|
|
675
915
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
676
916
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
677
917
|
extra_headers: Headers | None = None,
|
|
@@ -701,6 +941,10 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
701
941
|
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
|
|
702
942
|
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
|
|
703
943
|
|
|
944
|
+
use_advanced_processing: DEPRECATED: This field is no longer used. Advanced PDF processing is now
|
|
945
|
+
automatic with our hybrid Mistral OCR + Gemini pipeline. This parameter will be
|
|
946
|
+
accepted but ignored for backwards compatibility.
|
|
947
|
+
|
|
704
948
|
extra_headers: Send extra headers
|
|
705
949
|
|
|
706
950
|
extra_query: Add additional query parameters to the request
|
|
@@ -716,6 +960,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
|
|
|
716
960
|
"file_type": file_type,
|
|
717
961
|
"metadata": metadata,
|
|
718
962
|
"mime_type": mime_type,
|
|
963
|
+
"use_advanced_processing": use_advanced_processing,
|
|
719
964
|
}
|
|
720
965
|
)
|
|
721
966
|
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
@@ -750,9 +995,15 @@ class MemoriesResourceWithRawResponse:
|
|
|
750
995
|
self.add = to_raw_response_wrapper(
|
|
751
996
|
memories.add,
|
|
752
997
|
)
|
|
998
|
+
self.forget = to_raw_response_wrapper(
|
|
999
|
+
memories.forget,
|
|
1000
|
+
)
|
|
753
1001
|
self.get = to_raw_response_wrapper(
|
|
754
1002
|
memories.get,
|
|
755
1003
|
)
|
|
1004
|
+
self.update_memory = to_raw_response_wrapper(
|
|
1005
|
+
memories.update_memory,
|
|
1006
|
+
)
|
|
756
1007
|
self.upload_file = to_raw_response_wrapper(
|
|
757
1008
|
memories.upload_file,
|
|
758
1009
|
)
|
|
@@ -774,9 +1025,15 @@ class AsyncMemoriesResourceWithRawResponse:
|
|
|
774
1025
|
self.add = async_to_raw_response_wrapper(
|
|
775
1026
|
memories.add,
|
|
776
1027
|
)
|
|
1028
|
+
self.forget = async_to_raw_response_wrapper(
|
|
1029
|
+
memories.forget,
|
|
1030
|
+
)
|
|
777
1031
|
self.get = async_to_raw_response_wrapper(
|
|
778
1032
|
memories.get,
|
|
779
1033
|
)
|
|
1034
|
+
self.update_memory = async_to_raw_response_wrapper(
|
|
1035
|
+
memories.update_memory,
|
|
1036
|
+
)
|
|
780
1037
|
self.upload_file = async_to_raw_response_wrapper(
|
|
781
1038
|
memories.upload_file,
|
|
782
1039
|
)
|
|
@@ -798,9 +1055,15 @@ class MemoriesResourceWithStreamingResponse:
|
|
|
798
1055
|
self.add = to_streamed_response_wrapper(
|
|
799
1056
|
memories.add,
|
|
800
1057
|
)
|
|
1058
|
+
self.forget = to_streamed_response_wrapper(
|
|
1059
|
+
memories.forget,
|
|
1060
|
+
)
|
|
801
1061
|
self.get = to_streamed_response_wrapper(
|
|
802
1062
|
memories.get,
|
|
803
1063
|
)
|
|
1064
|
+
self.update_memory = to_streamed_response_wrapper(
|
|
1065
|
+
memories.update_memory,
|
|
1066
|
+
)
|
|
804
1067
|
self.upload_file = to_streamed_response_wrapper(
|
|
805
1068
|
memories.upload_file,
|
|
806
1069
|
)
|
|
@@ -822,9 +1085,15 @@ class AsyncMemoriesResourceWithStreamingResponse:
|
|
|
822
1085
|
self.add = async_to_streamed_response_wrapper(
|
|
823
1086
|
memories.add,
|
|
824
1087
|
)
|
|
1088
|
+
self.forget = async_to_streamed_response_wrapper(
|
|
1089
|
+
memories.forget,
|
|
1090
|
+
)
|
|
825
1091
|
self.get = async_to_streamed_response_wrapper(
|
|
826
1092
|
memories.get,
|
|
827
1093
|
)
|
|
1094
|
+
self.update_memory = async_to_streamed_response_wrapper(
|
|
1095
|
+
memories.update_memory,
|
|
1096
|
+
)
|
|
828
1097
|
self.upload_file = async_to_streamed_response_wrapper(
|
|
829
1098
|
memories.upload_file,
|
|
830
1099
|
)
|
supermemory/resources/search.py
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
5
7
|
import httpx
|
|
6
8
|
|
|
7
9
|
from ..types import search_execute_params, search_memories_params, search_documents_params
|
|
@@ -249,6 +251,7 @@ class SearchResource(SyncAPIResource):
|
|
|
249
251
|
limit: int | Omit = omit,
|
|
250
252
|
rerank: bool | Omit = omit,
|
|
251
253
|
rewrite_query: bool | Omit = omit,
|
|
254
|
+
search_mode: Literal["memories", "hybrid"] | Omit = omit,
|
|
252
255
|
threshold: float | Omit = omit,
|
|
253
256
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
254
257
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -276,6 +279,10 @@ class SearchResource(SyncAPIResource):
|
|
|
276
279
|
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
|
|
277
280
|
the latency by about 400ms
|
|
278
281
|
|
|
282
|
+
search_mode: Search mode. 'memories' searches only memory entries (default). 'hybrid'
|
|
283
|
+
searches memories first, then falls back to document chunks if no memories are
|
|
284
|
+
found.
|
|
285
|
+
|
|
279
286
|
threshold: Threshold / sensitivity for memories selection. 0 is least sensitive (returns
|
|
280
287
|
most memories, more results), 1 is most sensitive (returns lesser memories,
|
|
281
288
|
accurate results)
|
|
@@ -299,6 +306,7 @@ class SearchResource(SyncAPIResource):
|
|
|
299
306
|
"limit": limit,
|
|
300
307
|
"rerank": rerank,
|
|
301
308
|
"rewrite_query": rewrite_query,
|
|
309
|
+
"search_mode": search_mode,
|
|
302
310
|
"threshold": threshold,
|
|
303
311
|
},
|
|
304
312
|
search_memories_params.SearchMemoriesParams,
|
|
@@ -536,6 +544,7 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
536
544
|
limit: int | Omit = omit,
|
|
537
545
|
rerank: bool | Omit = omit,
|
|
538
546
|
rewrite_query: bool | Omit = omit,
|
|
547
|
+
search_mode: Literal["memories", "hybrid"] | Omit = omit,
|
|
539
548
|
threshold: float | Omit = omit,
|
|
540
549
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
541
550
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -563,6 +572,10 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
563
572
|
rewrite_query: If true, rewrites the query to make it easier to find documents. This increases
|
|
564
573
|
the latency by about 400ms
|
|
565
574
|
|
|
575
|
+
search_mode: Search mode. 'memories' searches only memory entries (default). 'hybrid'
|
|
576
|
+
searches memories first, then falls back to document chunks if no memories are
|
|
577
|
+
found.
|
|
578
|
+
|
|
566
579
|
threshold: Threshold / sensitivity for memories selection. 0 is least sensitive (returns
|
|
567
580
|
most memories, more results), 1 is most sensitive (returns lesser memories,
|
|
568
581
|
accurate results)
|
|
@@ -586,6 +599,7 @@ class AsyncSearchResource(AsyncAPIResource):
|
|
|
586
599
|
"limit": limit,
|
|
587
600
|
"rerank": rerank,
|
|
588
601
|
"rewrite_query": rewrite_query,
|
|
602
|
+
"search_mode": search_mode,
|
|
589
603
|
"threshold": threshold,
|
|
590
604
|
},
|
|
591
605
|
search_memories_params.SearchMemoriesParams,
|
|
@@ -50,6 +50,9 @@ class SettingsResource(SyncAPIResource):
|
|
|
50
50
|
chunk_size: Optional[int] | Omit = omit,
|
|
51
51
|
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
52
52
|
filter_prompt: Optional[str] | Omit = omit,
|
|
53
|
+
github_client_id: Optional[str] | Omit = omit,
|
|
54
|
+
github_client_secret: Optional[str] | Omit = omit,
|
|
55
|
+
github_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
53
56
|
google_drive_client_id: Optional[str] | Omit = omit,
|
|
54
57
|
google_drive_client_secret: Optional[str] | Omit = omit,
|
|
55
58
|
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
@@ -87,6 +90,9 @@ class SettingsResource(SyncAPIResource):
|
|
|
87
90
|
"chunk_size": chunk_size,
|
|
88
91
|
"exclude_items": exclude_items,
|
|
89
92
|
"filter_prompt": filter_prompt,
|
|
93
|
+
"github_client_id": github_client_id,
|
|
94
|
+
"github_client_secret": github_client_secret,
|
|
95
|
+
"github_custom_key_enabled": github_custom_key_enabled,
|
|
90
96
|
"google_drive_client_id": google_drive_client_id,
|
|
91
97
|
"google_drive_client_secret": google_drive_client_secret,
|
|
92
98
|
"google_drive_custom_key_enabled": google_drive_custom_key_enabled,
|
|
@@ -153,6 +159,9 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
|
153
159
|
chunk_size: Optional[int] | Omit = omit,
|
|
154
160
|
exclude_items: Union[str, float, bool, Dict[str, object], Iterable[object], None] | Omit = omit,
|
|
155
161
|
filter_prompt: Optional[str] | Omit = omit,
|
|
162
|
+
github_client_id: Optional[str] | Omit = omit,
|
|
163
|
+
github_client_secret: Optional[str] | Omit = omit,
|
|
164
|
+
github_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
156
165
|
google_drive_client_id: Optional[str] | Omit = omit,
|
|
157
166
|
google_drive_client_secret: Optional[str] | Omit = omit,
|
|
158
167
|
google_drive_custom_key_enabled: Optional[bool] | Omit = omit,
|
|
@@ -190,6 +199,9 @@ class AsyncSettingsResource(AsyncAPIResource):
|
|
|
190
199
|
"chunk_size": chunk_size,
|
|
191
200
|
"exclude_items": exclude_items,
|
|
192
201
|
"filter_prompt": filter_prompt,
|
|
202
|
+
"github_client_id": github_client_id,
|
|
203
|
+
"github_client_secret": github_client_secret,
|
|
204
|
+
"github_custom_key_enabled": github_custom_key_enabled,
|
|
193
205
|
"google_drive_client_id": google_drive_client_id,
|
|
194
206
|
"google_drive_client_secret": google_drive_client_secret,
|
|
195
207
|
"google_drive_custom_key_enabled": google_drive_custom_key_enabled,
|
supermemory/types/__init__.py
CHANGED
|
@@ -11,6 +11,7 @@ from .document_add_params import DocumentAddParams as DocumentAddParams
|
|
|
11
11
|
from .memory_add_response import MemoryAddResponse as MemoryAddResponse
|
|
12
12
|
from .memory_get_response import MemoryGetResponse as MemoryGetResponse
|
|
13
13
|
from .document_list_params import DocumentListParams as DocumentListParams
|
|
14
|
+
from .memory_forget_params import MemoryForgetParams as MemoryForgetParams
|
|
14
15
|
from .memory_list_response import MemoryListResponse as MemoryListResponse
|
|
15
16
|
from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
|
|
16
17
|
from .setting_get_response import SettingGetResponse as SettingGetResponse
|
|
@@ -22,6 +23,7 @@ from .setting_update_params import SettingUpdateParams as SettingUpdateParams
|
|
|
22
23
|
from .connection_list_params import ConnectionListParams as ConnectionListParams
|
|
23
24
|
from .document_list_response import DocumentListResponse as DocumentListResponse
|
|
24
25
|
from .document_update_params import DocumentUpdateParams as DocumentUpdateParams
|
|
26
|
+
from .memory_forget_response import MemoryForgetResponse as MemoryForgetResponse
|
|
25
27
|
from .memory_update_response import MemoryUpdateResponse as MemoryUpdateResponse
|
|
26
28
|
from .search_memories_params import SearchMemoriesParams as SearchMemoriesParams
|
|
27
29
|
from .search_documents_params import SearchDocumentsParams as SearchDocumentsParams
|
|
@@ -32,18 +34,29 @@ from .connection_import_params import ConnectionImportParams as ConnectionImport
|
|
|
32
34
|
from .connection_list_response import ConnectionListResponse as ConnectionListResponse
|
|
33
35
|
from .document_update_response import DocumentUpdateResponse as DocumentUpdateResponse
|
|
34
36
|
from .search_memories_response import SearchMemoriesResponse as SearchMemoriesResponse
|
|
37
|
+
from .document_batch_add_params import DocumentBatchAddParams as DocumentBatchAddParams
|
|
35
38
|
from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
|
|
36
39
|
from .search_documents_response import SearchDocumentsResponse as SearchDocumentsResponse
|
|
37
40
|
from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
|
|
38
41
|
from .connection_import_response import ConnectionImportResponse as ConnectionImportResponse
|
|
42
|
+
from .connection_configure_params import ConnectionConfigureParams as ConnectionConfigureParams
|
|
43
|
+
from .connection_resources_params import ConnectionResourcesParams as ConnectionResourcesParams
|
|
44
|
+
from .document_batch_add_response import DocumentBatchAddResponse as DocumentBatchAddResponse
|
|
45
|
+
from .document_delete_bulk_params import DocumentDeleteBulkParams as DocumentDeleteBulkParams
|
|
39
46
|
from .document_upload_file_params import DocumentUploadFileParams as DocumentUploadFileParams
|
|
47
|
+
from .memory_update_memory_params import MemoryUpdateMemoryParams as MemoryUpdateMemoryParams
|
|
40
48
|
from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse
|
|
49
|
+
from .connection_get_by_tag_params import ConnectionGetByTagParams as ConnectionGetByTagParams
|
|
50
|
+
from .connection_configure_response import ConnectionConfigureResponse as ConnectionConfigureResponse
|
|
41
51
|
from .connection_get_by_id_response import ConnectionGetByIDResponse as ConnectionGetByIDResponse
|
|
42
|
-
from .
|
|
52
|
+
from .connection_resources_response import ConnectionResourcesResponse as ConnectionResourcesResponse
|
|
53
|
+
from .document_delete_bulk_response import DocumentDeleteBulkResponse as DocumentDeleteBulkResponse
|
|
43
54
|
from .document_upload_file_response import DocumentUploadFileResponse as DocumentUploadFileResponse
|
|
44
|
-
from .
|
|
55
|
+
from .memory_update_memory_response import MemoryUpdateMemoryResponse as MemoryUpdateMemoryResponse
|
|
56
|
+
from .connection_get_by_tag_response import ConnectionGetByTagResponse as ConnectionGetByTagResponse
|
|
45
57
|
from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse
|
|
46
58
|
from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams
|
|
59
|
+
from .document_list_processing_response import DocumentListProcessingResponse as DocumentListProcessingResponse
|
|
47
60
|
from .connection_list_documents_response import ConnectionListDocumentsResponse as ConnectionListDocumentsResponse
|
|
48
61
|
from .connection_delete_by_provider_params import ConnectionDeleteByProviderParams as ConnectionDeleteByProviderParams
|
|
49
62
|
from .connection_delete_by_provider_response import (
|
|
@@ -19,3 +19,9 @@ class ClientProfileParams(TypedDict, total=False):
|
|
|
19
19
|
|
|
20
20
|
q: str
|
|
21
21
|
"""Optional search query to include search results in the response"""
|
|
22
|
+
|
|
23
|
+
threshold: float
|
|
24
|
+
"""Threshold for search results.
|
|
25
|
+
|
|
26
|
+
Only results with a score above this threshold will be included.
|
|
27
|
+
"""
|
|
@@ -0,0 +1,12 @@
|
|
|
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, Iterable
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["ConnectionConfigureParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ConnectionConfigureParams(TypedDict, total=False):
|
|
12
|
+
resources: Required[Iterable[Dict[str, object]]]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import Field as FieldInfo
|
|
6
|
+
|
|
7
|
+
from .._models import BaseModel
|
|
8
|
+
|
|
9
|
+
__all__ = ["ConnectionConfigureResponse"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ConnectionConfigureResponse(BaseModel):
|
|
13
|
+
message: str
|
|
14
|
+
|
|
15
|
+
success: bool
|
|
16
|
+
|
|
17
|
+
webhooks_registered: Optional[float] = FieldInfo(alias="webhooksRegistered", default=None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import Dict, Optional
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
4
|
|
|
5
5
|
from pydantic import Field as FieldInfo
|
|
6
6
|
|
|
@@ -16,6 +16,8 @@ class ConnectionGetByIDResponse(BaseModel):
|
|
|
16
16
|
|
|
17
17
|
provider: str
|
|
18
18
|
|
|
19
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
20
|
+
|
|
19
21
|
document_limit: Optional[float] = FieldInfo(alias="documentLimit", default=None)
|
|
20
22
|
|
|
21
23
|
email: Optional[str] = None
|
|
@@ -7,9 +7,9 @@ from typing_extensions import Required, Annotated, TypedDict
|
|
|
7
7
|
from .._types import SequenceNotStr
|
|
8
8
|
from .._utils import PropertyInfo
|
|
9
9
|
|
|
10
|
-
__all__ = ["
|
|
10
|
+
__all__ = ["ConnectionGetByTagParams"]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class ConnectionGetByTagParams(TypedDict, total=False):
|
|
14
14
|
container_tags: Required[Annotated[SequenceNotStr[str], PropertyInfo(alias="containerTags")]]
|
|
15
15
|
"""Comma-separated list of container tags to filter connection by"""
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import Dict, Optional
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
4
|
|
|
5
5
|
from pydantic import Field as FieldInfo
|
|
6
6
|
|
|
7
7
|
from .._models import BaseModel
|
|
8
8
|
|
|
9
|
-
__all__ = ["
|
|
9
|
+
__all__ = ["ConnectionGetByTagResponse"]
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class ConnectionGetByTagResponse(BaseModel):
|
|
13
13
|
id: str
|
|
14
14
|
|
|
15
15
|
created_at: str = FieldInfo(alias="createdAt")
|
|
16
16
|
|
|
17
17
|
provider: str
|
|
18
18
|
|
|
19
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
20
|
+
|
|
19
21
|
document_limit: Optional[float] = FieldInfo(alias="documentLimit", default=None)
|
|
20
22
|
|
|
21
23
|
email: Optional[str] = None
|
|
@@ -17,6 +17,8 @@ class ConnectionListResponseItem(BaseModel):
|
|
|
17
17
|
|
|
18
18
|
provider: str
|
|
19
19
|
|
|
20
|
+
container_tags: Optional[List[str]] = FieldInfo(alias="containerTags", default=None)
|
|
21
|
+
|
|
20
22
|
document_limit: Optional[float] = FieldInfo(alias="documentLimit", default=None)
|
|
21
23
|
|
|
22
24
|
email: Optional[str] = None
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ConnectionResourcesParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ConnectionResourcesParams(TypedDict, total=False):
|
|
11
|
+
page: float
|
|
12
|
+
|
|
13
|
+
per_page: float
|