Skip to content

Commit fd86dc5

Browse files
feat(api): api update
1 parent 294f8fe commit fd86dc5

File tree

7 files changed

+44
-2
lines changed

7 files changed

+44
-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: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-f35c8c3182ef17698350347936848877f3ed8a8af8fcfdc3471506309ff0b9ce.yml
3-
openapi_spec_hash: f58c1f9350390517a31e0f241245adc3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-0606bdf6929173c39cecc0ce0da252d509a38fbc98e7b8ddd64bdee5812625b9.yml
3+
openapi_spec_hash: c6c376e6d59b3c01e38559a2a74b075e
44
config_hash: 5deef1e3a49e3a7816348fbf7ba259bf

src/supermemory/resources/documents.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def upload_file(
356356
file: FileTypes,
357357
container_tags: str | Omit = omit,
358358
file_type: str | Omit = omit,
359+
metadata: str | Omit = omit,
359360
mime_type: str | Omit = omit,
360361
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
361362
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -378,6 +379,10 @@ def upload_file(
378379
text, pdf, tweet, google_doc, google_slide, google_sheet, image, video,
379380
notion_doc, webpage, onedrive
380381
382+
metadata: Optional metadata for the document as a JSON string. This is used to store
383+
additional information about the document. Keys must be strings and values can
384+
be strings, numbers, or booleans.
385+
381386
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
382387
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
383388
@@ -394,6 +399,7 @@ def upload_file(
394399
"file": file,
395400
"container_tags": container_tags,
396401
"file_type": file_type,
402+
"metadata": metadata,
397403
"mime_type": mime_type,
398404
}
399405
)
@@ -741,6 +747,7 @@ async def upload_file(
741747
file: FileTypes,
742748
container_tags: str | Omit = omit,
743749
file_type: str | Omit = omit,
750+
metadata: str | Omit = omit,
744751
mime_type: str | Omit = omit,
745752
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
746753
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -763,6 +770,10 @@ async def upload_file(
763770
text, pdf, tweet, google_doc, google_slide, google_sheet, image, video,
764771
notion_doc, webpage, onedrive
765772
773+
metadata: Optional metadata for the document as a JSON string. This is used to store
774+
additional information about the document. Keys must be strings and values can
775+
be strings, numbers, or booleans.
776+
766777
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
767778
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
768779
@@ -779,6 +790,7 @@ async def upload_file(
779790
"file": file,
780791
"container_tags": container_tags,
781792
"file_type": file_type,
793+
"metadata": metadata,
782794
"mime_type": mime_type,
783795
}
784796
)

src/supermemory/resources/memories.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def upload_file(
356356
file: FileTypes,
357357
container_tags: str | Omit = omit,
358358
file_type: str | Omit = omit,
359+
metadata: str | Omit = omit,
359360
mime_type: str | Omit = omit,
360361
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
361362
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -378,6 +379,10 @@ def upload_file(
378379
text, pdf, tweet, google_doc, google_slide, google_sheet, image, video,
379380
notion_doc, webpage, onedrive
380381
382+
metadata: Optional metadata for the document as a JSON string. This is used to store
383+
additional information about the document. Keys must be strings and values can
384+
be strings, numbers, or booleans.
385+
381386
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
382387
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
383388
@@ -394,6 +399,7 @@ def upload_file(
394399
"file": file,
395400
"container_tags": container_tags,
396401
"file_type": file_type,
402+
"metadata": metadata,
397403
"mime_type": mime_type,
398404
}
399405
)
@@ -741,6 +747,7 @@ async def upload_file(
741747
file: FileTypes,
742748
container_tags: str | Omit = omit,
743749
file_type: str | Omit = omit,
750+
metadata: str | Omit = omit,
744751
mime_type: str | Omit = omit,
745752
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
746753
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -763,6 +770,10 @@ async def upload_file(
763770
text, pdf, tweet, google_doc, google_slide, google_sheet, image, video,
764771
notion_doc, webpage, onedrive
765772
773+
metadata: Optional metadata for the document as a JSON string. This is used to store
774+
additional information about the document. Keys must be strings and values can
775+
be strings, numbers, or booleans.
776+
766777
mime_type: Required when fileType is 'image' or 'video'. Specifies the exact MIME type to
767778
use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm')
768779
@@ -779,6 +790,7 @@ async def upload_file(
779790
"file": file,
780791
"container_tags": container_tags,
781792
"file_type": file_type,
793+
"metadata": metadata,
782794
"mime_type": mime_type,
783795
}
784796
)

src/supermemory/types/document_upload_file_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ class DocumentUploadFileParams(TypedDict, total=False):
2828
video, notion_doc, webpage, onedrive
2929
"""
3030

31+
metadata: str
32+
"""Optional metadata for the document as a JSON string.
33+
34+
This is used to store additional information about the document. Keys must be
35+
strings and values can be strings, numbers, or booleans.
36+
"""
37+
3138
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
3239
"""Required when fileType is 'image' or 'video'.
3340

src/supermemory/types/memory_upload_file_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ class MemoryUploadFileParams(TypedDict, total=False):
2828
video, notion_doc, webpage, onedrive
2929
"""
3030

31+
metadata: str
32+
"""Optional metadata for the document as a JSON string.
33+
34+
This is used to store additional information about the document. Keys must be
35+
strings and values can be strings, numbers, or booleans.
36+
"""
37+
3138
mime_type: Annotated[str, PropertyInfo(alias="mimeType")]
3239
"""Required when fileType is 'image' or 'video'.
3340

tests/api_resources/test_documents.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None:
300300
file=b"raw file contents",
301301
container_tags='["user_123", "project_123"]',
302302
file_type="image",
303+
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
303304
mime_type="image/png",
304305
)
305306
assert_matches_type(DocumentUploadFileResponse, document, path=["response"])
@@ -613,6 +614,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper
613614
file=b"raw file contents",
614615
container_tags='["user_123", "project_123"]',
615616
file_type="image",
617+
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
616618
mime_type="image/png",
617619
)
618620
assert_matches_type(DocumentUploadFileResponse, document, path=["response"])

tests/api_resources/test_memories.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def test_method_upload_file_with_all_params(self, client: Supermemory) -> None:
300300
file=b"raw file contents",
301301
container_tags='["user_123", "project_123"]',
302302
file_type="image",
303+
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
303304
mime_type="image/png",
304305
)
305306
assert_matches_type(MemoryUploadFileResponse, memory, path=["response"])
@@ -613,6 +614,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncSuper
613614
file=b"raw file contents",
614615
container_tags='["user_123", "project_123"]',
615616
file_type="image",
617+
metadata='{"category": "technology", "isPublic": true, "readingTime": 5}',
616618
mime_type="image/png",
617619
)
618620
assert_matches_type(MemoryUploadFileResponse, memory, path=["response"])

0 commit comments

Comments
 (0)