Skip to content

Commit b4b239e

Browse files
feat(api): api update
1 parent ca7b28d commit b4b239e

File tree

7 files changed

+38
-2
lines changed

7 files changed

+38
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-c42d5f3942d6e32b6d1ed95d40bf6cca87aa8c715343444b97e0c68d44646878.yml
3-
openapi_spec_hash: 952074229d1f810fe95aeee711db8ca4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-eef92a68d48cbd0da30cae650e608f5114a52305f81c4deea56ef42e4a0ec05b.yml
3+
openapi_spec_hash: 5b9e4ea9387648b156fdcfea9651ff58
44
config_hash: a69d5c502ffbfb11a2c8ec61ca5823e9

src/supermemory/resources/documents.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def upload_file(
452452
file_type: str | Omit = omit,
453453
metadata: str | Omit = omit,
454454
mime_type: str | Omit = omit,
455+
use_advanced_processing: str | Omit = omit,
455456
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
456457
# The extra values given here take precedence over values defined on the client or passed to this method.
457458
extra_headers: Headers | None = None,
@@ -481,6 +482,9 @@ def upload_file(
481482
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
482483
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
483484
485+
use_advanced_processing: Use advanced processing with Reducto for better PDF extraction and chunking.
486+
This costs 3x tokens but provides superior quality for complex documents.
487+
484488
extra_headers: Send extra headers
485489
486490
extra_query: Add additional query parameters to the request
@@ -496,6 +500,7 @@ def upload_file(
496500
"file_type": file_type,
497501
"metadata": metadata,
498502
"mime_type": mime_type,
503+
"use_advanced_processing": use_advanced_processing,
499504
}
500505
)
501506
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
@@ -928,6 +933,7 @@ async def upload_file(
928933
file_type: str | Omit = omit,
929934
metadata: str | Omit = omit,
930935
mime_type: str | Omit = omit,
936+
use_advanced_processing: str | Omit = omit,
931937
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
932938
# The extra values given here take precedence over values defined on the client or passed to this method.
933939
extra_headers: Headers | None = None,
@@ -957,6 +963,9 @@ async def upload_file(
957963
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
958964
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
959965
966+
use_advanced_processing: Use advanced processing with Reducto for better PDF extraction and chunking.
967+
This costs 3x tokens but provides superior quality for complex documents.
968+
960969
extra_headers: Send extra headers
961970
962971
extra_query: Add additional query parameters to the request
@@ -972,6 +981,7 @@ async def upload_file(
972981
"file_type": file_type,
973982
"metadata": metadata,
974983
"mime_type": mime_type,
984+
"use_advanced_processing": use_advanced_processing,
975985
}
976986
)
977987
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])

src/supermemory/resources/memories.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ def upload_file(
440440
file_type: str | Omit = omit,
441441
metadata: str | Omit = omit,
442442
mime_type: str | Omit = omit,
443+
use_advanced_processing: str | Omit = omit,
443444
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
444445
# The extra values given here take precedence over values defined on the client or passed to this method.
445446
extra_headers: Headers | None = None,
@@ -469,6 +470,9 @@ def upload_file(
469470
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
470471
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
471472
473+
use_advanced_processing: Use advanced processing with Reducto for better PDF extraction and chunking.
474+
This costs 3x tokens but provides superior quality for complex documents.
475+
472476
extra_headers: Send extra headers
473477
474478
extra_query: Add additional query parameters to the request
@@ -484,6 +488,7 @@ def upload_file(
484488
"file_type": file_type,
485489
"metadata": metadata,
486490
"mime_type": mime_type,
491+
"use_advanced_processing": use_advanced_processing,
487492
}
488493
)
489494
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
@@ -905,6 +910,7 @@ async def upload_file(
905910
file_type: str | Omit = omit,
906911
metadata: str | Omit = omit,
907912
mime_type: str | Omit = omit,
913+
use_advanced_processing: str | Omit = omit,
908914
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
909915
# The extra values given here take precedence over values defined on the client or passed to this method.
910916
extra_headers: Headers | None = None,
@@ -934,6 +940,9 @@ async def upload_file(
934940
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
935941
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
936942
943+
use_advanced_processing: Use advanced processing with Reducto for better PDF extraction and chunking.
944+
This costs 3x tokens but provides superior quality for complex documents.
945+
937946
extra_headers: Send extra headers
938947
939948
extra_query: Add additional query parameters to the request
@@ -949,6 +958,7 @@ async def upload_file(
949958
"file_type": file_type,
950959
"metadata": metadata,
951960
"mime_type": mime_type,
961+
"use_advanced_processing": use_advanced_processing,
952962
}
953963
)
954964
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])

src/supermemory/types/document_upload_file_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ class DocumentUploadFileParams(TypedDict, total=False):
4242
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
4343
'video/mp4', 'video/webm')
4444
"""
45+
46+
use_advanced_processing: Annotated[str, PropertyInfo(alias="useAdvancedProcessing")]
47+
"""Use advanced processing with Reducto for better PDF extraction and chunking.
48+
49+
This costs 3x tokens but provides superior quality for complex documents.
50+
"""

src/supermemory/types/memory_upload_file_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ class MemoryUploadFileParams(TypedDict, total=False):
4242
Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg',
4343
'video/mp4', 'video/webm')
4444
"""
45+
46+
use_advanced_processing: Annotated[str, PropertyInfo(alias="useAdvancedProcessing")]
47+
"""Use advanced processing with Reducto for better PDF extraction and chunking.
48+
49+
This costs 3x tokens but provides superior quality for complex documents.
50+
"""

tests/api_resources/test_documents.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None:
429429
file_type="image",
430430
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
431431
mime_type="mimeType",
432+
use_advanced_processing="true",
432433
)
433434
assert_matches_type(DocumentUploadFileResponse, document, path=["response"])
434435

@@ -867,6 +868,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper
867868
file_type="image",
868869
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
869870
mime_type="mimeType",
871+
use_advanced_processing="true",
870872
)
871873
assert_matches_type(DocumentUploadFileResponse, document, path=["response"])
872874

tests/api_resources/test_memories.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None:
389389
file_type="image",
390390
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
391391
mime_type="mimeType",
392+
use_advanced_processing="true",
392393
)
393394
assert_matches_type(MemoryUploadFileResponse, memory, path=["response"])
394395

@@ -788,6 +789,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper
788789
file_type="image",
789790
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
790791
mime_type="mimeType",
792+
use_advanced_processing="true",
791793
)
792794
assert_matches_type(MemoryUploadFileResponse, memory, path=["response"])
793795

0 commit comments

Comments
 (0)