Skip to content

Commit 13a8b89

Browse files
feat(api): manual updates
1 parent acee529 commit 13a8b89

16 files changed

+620
-57
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 24
1+
configured_endpoints: 26
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-3856961a8959b60dbf0b6912d69c23390fbbca1c5e31028dd0decc85234dd285.yml
33
openapi_spec_hash: 988a7d6d7cef81ceb4acda3ef9f8c21e
4-
config_hash: 86bb383366a4687b405d4aa49808933d
4+
config_hash: b6ef9b4dc6a01f799e46a04dd24becc7

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@ Types:
5050

5151
```python
5252
from supermemory.types import (
53+
Query,
5354
DocumentUpdateResponse,
5455
DocumentListResponse,
5556
DocumentAddResponse,
57+
DocumentBatchCreateResponse,
5658
DocumentDeleteBulkResponse,
5759
DocumentGetResponse,
60+
DocumentListProcessingResponse,
5861
DocumentUploadFileResponse,
5962
)
6063
```
@@ -65,8 +68,10 @@ Methods:
6568
- <code title="post /v3/documents/list">client.documents.<a href="./src/supermemory/resources/documents.py">list</a>(\*\*<a href="src/supermemory/types/document_list_params.py">params</a>) -> <a href="./src/supermemory/types/document_list_response.py">DocumentListResponse</a></code>
6669
- <code title="delete /v3/documents/{id}">client.documents.<a href="./src/supermemory/resources/documents.py">delete</a>(id) -> None</code>
6770
- <code title="post /v3/documents">client.documents.<a href="./src/supermemory/resources/documents.py">add</a>(\*\*<a href="src/supermemory/types/document_add_params.py">params</a>) -> <a href="./src/supermemory/types/document_add_response.py">DocumentAddResponse</a></code>
71+
- <code title="post /v3/documents/batch">client.documents.<a href="./src/supermemory/resources/documents.py">batch_create</a>(\*\*<a href="src/supermemory/types/document_batch_create_params.py">params</a>) -> <a href="./src/supermemory/types/document_batch_create_response.py">DocumentBatchCreateResponse</a></code>
6872
- <code title="delete /v3/documents/bulk">client.documents.<a href="./src/supermemory/resources/documents.py">delete_bulk</a>(\*\*<a href="src/supermemory/types/document_delete_bulk_params.py">params</a>) -> <a href="./src/supermemory/types/document_delete_bulk_response.py">DocumentDeleteBulkResponse</a></code>
6973
- <code title="get /v3/documents/{id}">client.documents.<a href="./src/supermemory/resources/documents.py">get</a>(id) -> <a href="./src/supermemory/types/document_get_response.py">DocumentGetResponse</a></code>
74+
- <code title="get /v3/documents/processing">client.documents.<a href="./src/supermemory/resources/documents.py">list_processing</a>() -> <a href="./src/supermemory/types/document_list_processing_response.py">DocumentListProcessingResponse</a></code>
7075
- <code title="post /v3/documents/file">client.documents.<a href="./src/supermemory/resources/documents.py">upload_file</a>(\*\*<a href="src/supermemory/types/document_upload_file_params.py">params</a>) -> <a href="./src/supermemory/types/document_upload_file_response.py">DocumentUploadFileResponse</a></code>
7176

7277
# Search

src/supermemory/resources/documents.py

Lines changed: 192 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Mapping, cast
5+
from typing import Dict, Union, Mapping, Iterable, cast
66
from typing_extensions import Literal
77

88
import httpx
99

1010
from ..types import (
11+
Query,
1112
document_add_params,
1213
document_list_params,
1314
document_update_params,
1415
document_delete_bulk_params,
1516
document_upload_file_params,
17+
document_batch_create_params,
1618
)
1719
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, SequenceNotStr, omit, not_given
1820
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
@@ -25,12 +27,15 @@
2527
async_to_streamed_response_wrapper,
2628
)
2729
from .._base_client import make_request_options
30+
from ..types.query_param import QueryParam
2831
from ..types.document_add_response import DocumentAddResponse
2932
from ..types.document_get_response import DocumentGetResponse
3033
from ..types.document_list_response import DocumentListResponse
3134
from ..types.document_update_response import DocumentUpdateResponse
3235
from ..types.document_delete_bulk_response import DocumentDeleteBulkResponse
3336
from ..types.document_upload_file_response import DocumentUploadFileResponse
37+
from ..types.document_batch_create_response import DocumentBatchCreateResponse
38+
from ..types.document_list_processing_response import DocumentListProcessingResponse
3439

3540
__all__ = ["DocumentsResource", "AsyncDocumentsResource"]
3641

@@ -133,7 +138,7 @@ def list(
133138
self,
134139
*,
135140
container_tags: SequenceNotStr[str] | Omit = omit,
136-
filters: document_list_params.Filters | Omit = omit,
141+
filters: QueryParam | Omit = omit,
137142
include_content: bool | Omit = omit,
138143
limit: Union[str, float] | Omit = omit,
139144
order: Literal["asc", "desc"] | Omit = omit,
@@ -285,6 +290,67 @@ def add(
285290
cast_to=DocumentAddResponse,
286291
)
287292

293+
def batch_create(
294+
self,
295+
*,
296+
documents: Union[Iterable[document_batch_create_params.DocumentsUnionMember0], SequenceNotStr[str]],
297+
container_tag: str | Omit = omit,
298+
container_tags: SequenceNotStr[str] | Omit = omit,
299+
content: None | Omit = omit,
300+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit,
301+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
302+
# The extra values given here take precedence over values defined on the client or passed to this method.
303+
extra_headers: Headers | None = None,
304+
extra_query: Query | None = None,
305+
extra_body: Body | None = None,
306+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
307+
) -> DocumentBatchCreateResponse:
308+
"""Add multiple documents in a single request.
309+
310+
Each document can have any content
311+
type (text, url, file, etc.) and metadata
312+
313+
Args:
314+
container_tag: Optional tag this document should be containerized by. This can be an ID for
315+
your user, a project ID, or any other identifier you wish to use to group
316+
documents.
317+
318+
container_tags: (DEPRECATED: Use containerTag instead) Optional tags this document should be
319+
containerized by. This can be an ID for your user, a project ID, or any other
320+
identifier you wish to use to group documents.
321+
322+
metadata: Optional metadata for the document. This is used to store additional information
323+
about the document. You can use this to store any additional information you
324+
need about the document. Metadata can be filtered through. Keys must be strings
325+
and are case sensitive. Values can be strings, numbers, or booleans. You cannot
326+
nest objects.
327+
328+
extra_headers: Send extra headers
329+
330+
extra_query: Add additional query parameters to the request
331+
332+
extra_body: Add additional JSON properties to the request
333+
334+
timeout: Override the client-level default timeout for this request, in seconds
335+
"""
336+
return self._post(
337+
"/v3/documents/batch",
338+
body=maybe_transform(
339+
{
340+
"documents": documents,
341+
"container_tag": container_tag,
342+
"container_tags": container_tags,
343+
"content": content,
344+
"metadata": metadata,
345+
},
346+
document_batch_create_params.DocumentBatchCreateParams,
347+
),
348+
options=make_request_options(
349+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
350+
),
351+
cast_to=DocumentBatchCreateResponse,
352+
)
353+
288354
def delete_bulk(
289355
self,
290356
*,
@@ -361,6 +427,25 @@ def get(
361427
cast_to=DocumentGetResponse,
362428
)
363429

430+
def list_processing(
431+
self,
432+
*,
433+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
434+
# The extra values given here take precedence over values defined on the client or passed to this method.
435+
extra_headers: Headers | None = None,
436+
extra_query: Query | None = None,
437+
extra_body: Body | None = None,
438+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
439+
) -> DocumentListProcessingResponse:
440+
"""Get documents that are currently being processed"""
441+
return self._get(
442+
"/v3/documents/processing",
443+
options=make_request_options(
444+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
445+
),
446+
cast_to=DocumentListProcessingResponse,
447+
)
448+
364449
def upload_file(
365450
self,
366451
*,
@@ -529,7 +614,7 @@ async def list(
529614
self,
530615
*,
531616
container_tags: SequenceNotStr[str] | Omit = omit,
532-
filters: document_list_params.Filters | Omit = omit,
617+
filters: QueryParam | Omit = omit,
533618
include_content: bool | Omit = omit,
534619
limit: Union[str, float] | Omit = omit,
535620
order: Literal["asc", "desc"] | Omit = omit,
@@ -681,6 +766,67 @@ async def add(
681766
cast_to=DocumentAddResponse,
682767
)
683768

769+
async def batch_create(
770+
self,
771+
*,
772+
documents: Union[Iterable[document_batch_create_params.DocumentsUnionMember0], SequenceNotStr[str]],
773+
container_tag: str | Omit = omit,
774+
container_tags: SequenceNotStr[str] | Omit = omit,
775+
content: None | Omit = omit,
776+
metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit,
777+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
778+
# The extra values given here take precedence over values defined on the client or passed to this method.
779+
extra_headers: Headers | None = None,
780+
extra_query: Query | None = None,
781+
extra_body: Body | None = None,
782+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
783+
) -> DocumentBatchCreateResponse:
784+
"""Add multiple documents in a single request.
785+
786+
Each document can have any content
787+
type (text, url, file, etc.) and metadata
788+
789+
Args:
790+
container_tag: Optional tag this document should be containerized by. This can be an ID for
791+
your user, a project ID, or any other identifier you wish to use to group
792+
documents.
793+
794+
container_tags: (DEPRECATED: Use containerTag instead) Optional tags this document should be
795+
containerized by. This can be an ID for your user, a project ID, or any other
796+
identifier you wish to use to group documents.
797+
798+
metadata: Optional metadata for the document. This is used to store additional information
799+
about the document. You can use this to store any additional information you
800+
need about the document. Metadata can be filtered through. Keys must be strings
801+
and are case sensitive. Values can be strings, numbers, or booleans. You cannot
802+
nest objects.
803+
804+
extra_headers: Send extra headers
805+
806+
extra_query: Add additional query parameters to the request
807+
808+
extra_body: Add additional JSON properties to the request
809+
810+
timeout: Override the client-level default timeout for this request, in seconds
811+
"""
812+
return await self._post(
813+
"/v3/documents/batch",
814+
body=await async_maybe_transform(
815+
{
816+
"documents": documents,
817+
"container_tag": container_tag,
818+
"container_tags": container_tags,
819+
"content": content,
820+
"metadata": metadata,
821+
},
822+
document_batch_create_params.DocumentBatchCreateParams,
823+
),
824+
options=make_request_options(
825+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
826+
),
827+
cast_to=DocumentBatchCreateResponse,
828+
)
829+
684830
async def delete_bulk(
685831
self,
686832
*,
@@ -757,6 +903,25 @@ async def get(
757903
cast_to=DocumentGetResponse,
758904
)
759905

906+
async def list_processing(
907+
self,
908+
*,
909+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
910+
# The extra values given here take precedence over values defined on the client or passed to this method.
911+
extra_headers: Headers | None = None,
912+
extra_query: Query | None = None,
913+
extra_body: Body | None = None,
914+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
915+
) -> DocumentListProcessingResponse:
916+
"""Get documents that are currently being processed"""
917+
return await self._get(
918+
"/v3/documents/processing",
919+
options=make_request_options(
920+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
921+
),
922+
cast_to=DocumentListProcessingResponse,
923+
)
924+
760925
async def upload_file(
761926
self,
762927
*,
@@ -843,12 +1008,18 @@ def __init__(self, documents: DocumentsResource) -> None:
8431008
self.add = to_raw_response_wrapper(
8441009
documents.add,
8451010
)
1011+
self.batch_create = to_raw_response_wrapper(
1012+
documents.batch_create,
1013+
)
8461014
self.delete_bulk = to_raw_response_wrapper(
8471015
documents.delete_bulk,
8481016
)
8491017
self.get = to_raw_response_wrapper(
8501018
documents.get,
8511019
)
1020+
self.list_processing = to_raw_response_wrapper(
1021+
documents.list_processing,
1022+
)
8521023
self.upload_file = to_raw_response_wrapper(
8531024
documents.upload_file,
8541025
)
@@ -870,12 +1041,18 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
8701041
self.add = async_to_raw_response_wrapper(
8711042
documents.add,
8721043
)
1044+
self.batch_create = async_to_raw_response_wrapper(
1045+
documents.batch_create,
1046+
)
8731047
self.delete_bulk = async_to_raw_response_wrapper(
8741048
documents.delete_bulk,
8751049
)
8761050
self.get = async_to_raw_response_wrapper(
8771051
documents.get,
8781052
)
1053+
self.list_processing = async_to_raw_response_wrapper(
1054+
documents.list_processing,
1055+
)
8791056
self.upload_file = async_to_raw_response_wrapper(
8801057
documents.upload_file,
8811058
)
@@ -897,12 +1074,18 @@ def __init__(self, documents: DocumentsResource) -> None:
8971074
self.add = to_streamed_response_wrapper(
8981075
documents.add,
8991076
)
1077+
self.batch_create = to_streamed_response_wrapper(
1078+
documents.batch_create,
1079+
)
9001080
self.delete_bulk = to_streamed_response_wrapper(
9011081
documents.delete_bulk,
9021082
)
9031083
self.get = to_streamed_response_wrapper(
9041084
documents.get,
9051085
)
1086+
self.list_processing = to_streamed_response_wrapper(
1087+
documents.list_processing,
1088+
)
9061089
self.upload_file = to_streamed_response_wrapper(
9071090
documents.upload_file,
9081091
)
@@ -924,12 +1107,18 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
9241107
self.add = async_to_streamed_response_wrapper(
9251108
documents.add,
9261109
)
1110+
self.batch_create = async_to_streamed_response_wrapper(
1111+
documents.batch_create,
1112+
)
9271113
self.delete_bulk = async_to_streamed_response_wrapper(
9281114
documents.delete_bulk,
9291115
)
9301116
self.get = async_to_streamed_response_wrapper(
9311117
documents.get,
9321118
)
1119+
self.list_processing = async_to_streamed_response_wrapper(
1120+
documents.list_processing,
1121+
)
9331122
self.upload_file = async_to_streamed_response_wrapper(
9341123
documents.upload_file,
9351124
)

src/supermemory/resources/memories.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import httpx
99

1010
from ..types import (
11+
Query,
1112
memory_add_params,
1213
memory_list_params,
1314
memory_forget_params,
@@ -26,6 +27,7 @@
2627
async_to_streamed_response_wrapper,
2728
)
2829
from .._base_client import make_request_options
30+
from ..types.query_param import QueryParam
2931
from ..types.memory_add_response import MemoryAddResponse
3032
from ..types.memory_get_response import MemoryGetResponse
3133
from ..types.memory_list_response import MemoryListResponse
@@ -135,7 +137,7 @@ def list(
135137
self,
136138
*,
137139
container_tags: SequenceNotStr[str] | Omit = omit,
138-
filters: memory_list_params.Filters | Omit = omit,
140+
filters: QueryParam | Omit = omit,
139141
include_content: bool | Omit = omit,
140142
limit: Union[str, float] | Omit = omit,
141143
order: Literal["asc", "desc"] | Omit = omit,
@@ -600,7 +602,7 @@ async def list(
600602
self,
601603
*,
602604
container_tags: SequenceNotStr[str] | Omit = omit,
603-
filters: memory_list_params.Filters | Omit = omit,
605+
filters: QueryParam | Omit = omit,
604606
include_content: bool | Omit = omit,
605607
limit: Union[str, float] | Omit = omit,
606608
order: Literal["asc", "desc"] | Omit = omit,

0 commit comments

Comments
 (0)