Skip to content

Commit 25be280

Browse files
feat(api): api update
1 parent 1d58848 commit 25be280

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

.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/supermemory-new-92296474fc4d680741b695918b87850ffe3655530a4611dadfa599e4376a778e.yml
3-
openapi_spec_hash: aacf6838b9ec2431611e87fab118d913
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc/supermemory-new-5e1ac142b427e15ca46d0920c4d65c6e1f464e46ce014e42cd5a716f97b820ab.yml
3+
openapi_spec_hash: f0d9f62796cf1fb5dd79dad7b1c692fd
44
config_hash: cde97ef3188581c5f4924c633ec33ddb

src/supermemory/resources/documents.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ def upload_file(
496496
file: FileTypes,
497497
container_tag: str | Omit = omit,
498498
container_tags: str | Omit = omit,
499+
custom_id: str | Omit = omit,
500+
entity_context: str | Omit = omit,
499501
filepath: str | Omit = omit,
500502
file_type: str | Omit = omit,
501503
metadata: str | Omit = omit,
@@ -521,6 +523,12 @@ def upload_file(
521523
'["user_123", "project_123"]') or a single string (e.g., 'user_123'). Single
522524
strings will be automatically converted to an array.
523525
526+
custom_id: Optional custom ID of the document. Max 100 characters, alphanumeric with
527+
hyphens, underscores, and colons only.
528+
529+
entity_context: Optional entity context for this container tag. Max 1500 characters. Used during
530+
document processing to guide memory extraction.
531+
524532
filepath: Optional file path for the uploaded file (e.g., '/documents/reports/file.pdf').
525533
Used by supermemoryfs to map documents to filesystem paths.
526534
@@ -556,6 +564,8 @@ def upload_file(
556564
"file": file,
557565
"container_tag": container_tag,
558566
"container_tags": container_tags,
567+
"custom_id": custom_id,
568+
"entity_context": entity_context,
559569
"filepath": filepath,
560570
"file_type": file_type,
561571
"metadata": metadata,
@@ -1038,6 +1048,8 @@ async def upload_file(
10381048
file: FileTypes,
10391049
container_tag: str | Omit = omit,
10401050
container_tags: str | Omit = omit,
1051+
custom_id: str | Omit = omit,
1052+
entity_context: str | Omit = omit,
10411053
filepath: str | Omit = omit,
10421054
file_type: str | Omit = omit,
10431055
metadata: str | Omit = omit,
@@ -1063,6 +1075,12 @@ async def upload_file(
10631075
'["user_123", "project_123"]') or a single string (e.g., 'user_123'). Single
10641076
strings will be automatically converted to an array.
10651077
1078+
custom_id: Optional custom ID of the document. Max 100 characters, alphanumeric with
1079+
hyphens, underscores, and colons only.
1080+
1081+
entity_context: Optional entity context for this container tag. Max 1500 characters. Used during
1082+
document processing to guide memory extraction.
1083+
10661084
filepath: Optional file path for the uploaded file (e.g., '/documents/reports/file.pdf').
10671085
Used by supermemoryfs to map documents to filesystem paths.
10681086
@@ -1098,6 +1116,8 @@ async def upload_file(
10981116
"file": file,
10991117
"container_tag": container_tag,
11001118
"container_tags": container_tags,
1119+
"custom_id": custom_id,
1120+
"entity_context": entity_context,
11011121
"filepath": filepath,
11021122
"file_type": file_type,
11031123
"metadata": metadata,

src/supermemory/types/document_upload_file_params.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ class DocumentUploadFileParams(TypedDict, total=False):
2525
converted to an array.
2626
"""
2727

28+
custom_id: Annotated[str, PropertyInfo(alias="customId")]
29+
"""Optional custom ID of the document.
30+
31+
Max 100 characters, alphanumeric with hyphens, underscores, and colons only.
32+
"""
33+
34+
entity_context: Annotated[str, PropertyInfo(alias="entityContext")]
35+
"""Optional entity context for this container tag.
36+
37+
Max 1500 characters. Used during document processing to guide memory extraction.
38+
"""
39+
2840
filepath: str
2941
"""Optional file path for the uploaded file (e.g., '/documents/reports/file.pdf').
3042

tests/api_resources/test_documents.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None:
438438
file=b"Example data",
439439
container_tag="user",
440440
container_tags='["user_123", "project_123"]',
441+
custom_id="mem_abc123",
442+
entity_context="This user is a software engineer who prefers concise technical documentation.",
441443
filepath="/documents/reports/file.pdf",
442444
file_type="image",
443445
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
@@ -891,6 +893,8 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper
891893
file=b"Example data",
892894
container_tag="user",
893895
container_tags='["user_123", "project_123"]',
896+
custom_id="mem_abc123",
897+
entity_context="This user is a software engineer who prefers concise technical documentation.",
894898
filepath="/documents/reports/file.pdf",
895899
file_type="image",
896900
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',

0 commit comments

Comments
 (0)