Skip to content

Commit 094162f

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

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
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: b6ef9b4dc6a01f799e46a04dd24becc7
4+
config_hash: 87b9e108ccf7a61dbda94437747a84be

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ from supermemory.types import (
5454
DocumentUpdateResponse,
5555
DocumentListResponse,
5656
DocumentAddResponse,
57-
DocumentBatchCreateResponse,
57+
DocumentBatchAddResponse,
5858
DocumentDeleteBulkResponse,
5959
DocumentGetResponse,
6060
DocumentListProcessingResponse,
@@ -68,7 +68,7 @@ Methods:
6868
- <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>
6969
- <code title="delete /v3/documents/{id}">client.documents.<a href="./src/supermemory/resources/documents.py">delete</a>(id) -> None</code>
7070
- <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>
71+
- <code title="post /v3/documents/batch">client.documents.<a href="./src/supermemory/resources/documents.py">batch_add</a>(\*\*<a href="src/supermemory/types/document_batch_add_params.py">params</a>) -> <a href="./src/supermemory/types/document_batch_add_response.py">DocumentBatchAddResponse</a></code>
7272
- <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>
7373
- <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>
7474
- <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>

src/supermemory/resources/documents.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
document_add_params,
1313
document_list_params,
1414
document_update_params,
15+
document_batch_add_params,
1516
document_delete_bulk_params,
1617
document_upload_file_params,
17-
document_batch_create_params,
1818
)
1919
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, SequenceNotStr, omit, not_given
2020
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
@@ -32,9 +32,9 @@
3232
from ..types.document_get_response import DocumentGetResponse
3333
from ..types.document_list_response import DocumentListResponse
3434
from ..types.document_update_response import DocumentUpdateResponse
35+
from ..types.document_batch_add_response import DocumentBatchAddResponse
3536
from ..types.document_delete_bulk_response import DocumentDeleteBulkResponse
3637
from ..types.document_upload_file_response import DocumentUploadFileResponse
37-
from ..types.document_batch_create_response import DocumentBatchCreateResponse
3838
from ..types.document_list_processing_response import DocumentListProcessingResponse
3939

4040
__all__ = ["DocumentsResource", "AsyncDocumentsResource"]
@@ -290,10 +290,10 @@ def add(
290290
cast_to=DocumentAddResponse,
291291
)
292292

293-
def batch_create(
293+
def batch_add(
294294
self,
295295
*,
296-
documents: Union[Iterable[document_batch_create_params.DocumentsUnionMember0], SequenceNotStr[str]],
296+
documents: Union[Iterable[document_batch_add_params.DocumentsUnionMember0], SequenceNotStr[str]],
297297
container_tag: str | Omit = omit,
298298
container_tags: SequenceNotStr[str] | Omit = omit,
299299
content: None | Omit = omit,
@@ -304,7 +304,7 @@ def batch_create(
304304
extra_query: Query | None = None,
305305
extra_body: Body | None = None,
306306
timeout: float | httpx.Timeout | None | NotGiven = not_given,
307-
) -> DocumentBatchCreateResponse:
307+
) -> DocumentBatchAddResponse:
308308
"""Add multiple documents in a single request.
309309
310310
Each document can have any content
@@ -343,12 +343,12 @@ def batch_create(
343343
"content": content,
344344
"metadata": metadata,
345345
},
346-
document_batch_create_params.DocumentBatchCreateParams,
346+
document_batch_add_params.DocumentBatchAddParams,
347347
),
348348
options=make_request_options(
349349
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
350350
),
351-
cast_to=DocumentBatchCreateResponse,
351+
cast_to=DocumentBatchAddResponse,
352352
)
353353

354354
def delete_bulk(
@@ -766,10 +766,10 @@ async def add(
766766
cast_to=DocumentAddResponse,
767767
)
768768

769-
async def batch_create(
769+
async def batch_add(
770770
self,
771771
*,
772-
documents: Union[Iterable[document_batch_create_params.DocumentsUnionMember0], SequenceNotStr[str]],
772+
documents: Union[Iterable[document_batch_add_params.DocumentsUnionMember0], SequenceNotStr[str]],
773773
container_tag: str | Omit = omit,
774774
container_tags: SequenceNotStr[str] | Omit = omit,
775775
content: None | Omit = omit,
@@ -780,7 +780,7 @@ async def batch_create(
780780
extra_query: Query | None = None,
781781
extra_body: Body | None = None,
782782
timeout: float | httpx.Timeout | None | NotGiven = not_given,
783-
) -> DocumentBatchCreateResponse:
783+
) -> DocumentBatchAddResponse:
784784
"""Add multiple documents in a single request.
785785
786786
Each document can have any content
@@ -819,12 +819,12 @@ async def batch_create(
819819
"content": content,
820820
"metadata": metadata,
821821
},
822-
document_batch_create_params.DocumentBatchCreateParams,
822+
document_batch_add_params.DocumentBatchAddParams,
823823
),
824824
options=make_request_options(
825825
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
826826
),
827-
cast_to=DocumentBatchCreateResponse,
827+
cast_to=DocumentBatchAddResponse,
828828
)
829829

830830
async def delete_bulk(
@@ -1008,8 +1008,8 @@ def __init__(self, documents: DocumentsResource) -> None:
10081008
self.add = to_raw_response_wrapper(
10091009
documents.add,
10101010
)
1011-
self.batch_create = to_raw_response_wrapper(
1012-
documents.batch_create,
1011+
self.batch_add = to_raw_response_wrapper(
1012+
documents.batch_add,
10131013
)
10141014
self.delete_bulk = to_raw_response_wrapper(
10151015
documents.delete_bulk,
@@ -1041,8 +1041,8 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
10411041
self.add = async_to_raw_response_wrapper(
10421042
documents.add,
10431043
)
1044-
self.batch_create = async_to_raw_response_wrapper(
1045-
documents.batch_create,
1044+
self.batch_add = async_to_raw_response_wrapper(
1045+
documents.batch_add,
10461046
)
10471047
self.delete_bulk = async_to_raw_response_wrapper(
10481048
documents.delete_bulk,
@@ -1074,8 +1074,8 @@ def __init__(self, documents: DocumentsResource) -> None:
10741074
self.add = to_streamed_response_wrapper(
10751075
documents.add,
10761076
)
1077-
self.batch_create = to_streamed_response_wrapper(
1078-
documents.batch_create,
1077+
self.batch_add = to_streamed_response_wrapper(
1078+
documents.batch_add,
10791079
)
10801080
self.delete_bulk = to_streamed_response_wrapper(
10811081
documents.delete_bulk,
@@ -1107,8 +1107,8 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
11071107
self.add = async_to_streamed_response_wrapper(
11081108
documents.add,
11091109
)
1110-
self.batch_create = async_to_streamed_response_wrapper(
1111-
documents.batch_create,
1110+
self.batch_add = async_to_streamed_response_wrapper(
1111+
documents.batch_add,
11121112
)
11131113
self.delete_bulk = async_to_streamed_response_wrapper(
11141114
documents.delete_bulk,

src/supermemory/types/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@
3636
from .connection_list_response import ConnectionListResponse as ConnectionListResponse
3737
from .document_update_response import DocumentUpdateResponse as DocumentUpdateResponse
3838
from .search_memories_response import SearchMemoriesResponse as SearchMemoriesResponse
39+
from .document_batch_add_params import DocumentBatchAddParams as DocumentBatchAddParams
3940
from .memory_upload_file_params import MemoryUploadFileParams as MemoryUploadFileParams
4041
from .search_documents_response import SearchDocumentsResponse as SearchDocumentsResponse
4142
from .connection_create_response import ConnectionCreateResponse as ConnectionCreateResponse
4243
from .connection_import_response import ConnectionImportResponse as ConnectionImportResponse
4344
from .connection_configure_params import ConnectionConfigureParams as ConnectionConfigureParams
4445
from .connection_resources_params import ConnectionResourcesParams as ConnectionResourcesParams
46+
from .document_batch_add_response import DocumentBatchAddResponse as DocumentBatchAddResponse
4547
from .document_delete_bulk_params import DocumentDeleteBulkParams as DocumentDeleteBulkParams
4648
from .document_upload_file_params import DocumentUploadFileParams as DocumentUploadFileParams
4749
from .memory_update_memory_params import MemoryUpdateMemoryParams as MemoryUpdateMemoryParams
4850
from .memory_upload_file_response import MemoryUploadFileResponse as MemoryUploadFileResponse
4951
from .connection_get_by_tag_params import ConnectionGetByTagParams as ConnectionGetByTagParams
50-
from .document_batch_create_params import DocumentBatchCreateParams as DocumentBatchCreateParams
5152
from .connection_configure_response import ConnectionConfigureResponse as ConnectionConfigureResponse
5253
from .connection_get_by_id_response import ConnectionGetByIDResponse as ConnectionGetByIDResponse
5354
from .connection_resources_response import ConnectionResourcesResponse as ConnectionResourcesResponse
5455
from .document_delete_bulk_response import DocumentDeleteBulkResponse as DocumentDeleteBulkResponse
5556
from .document_upload_file_response import DocumentUploadFileResponse as DocumentUploadFileResponse
5657
from .memory_update_memory_response import MemoryUpdateMemoryResponse as MemoryUpdateMemoryResponse
5758
from .connection_get_by_tag_response import ConnectionGetByTagResponse as ConnectionGetByTagResponse
58-
from .document_batch_create_response import DocumentBatchCreateResponse as DocumentBatchCreateResponse
5959
from .connection_delete_by_id_response import ConnectionDeleteByIDResponse as ConnectionDeleteByIDResponse
6060
from .connection_list_documents_params import ConnectionListDocumentsParams as ConnectionListDocumentsParams
6161
from .document_list_processing_response import DocumentListProcessingResponse as DocumentListProcessingResponse

src/supermemory/types/document_batch_create_params.py renamed to src/supermemory/types/document_batch_add_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["DocumentBatchCreateParams", "DocumentsUnionMember0"]
11+
__all__ = ["DocumentBatchAddParams", "DocumentsUnionMember0"]
1212

1313

14-
class DocumentBatchCreateParams(TypedDict, total=False):
14+
class DocumentBatchAddParams(TypedDict, total=False):
1515
documents: Required[Union[Iterable[DocumentsUnionMember0], SequenceNotStr[str]]]
1616

1717
container_tag: Annotated[str, PropertyInfo(alias="containerTag")]

src/supermemory/types/document_batch_create_response.py renamed to src/supermemory/types/document_batch_add_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
from .._models import BaseModel
77

8-
__all__ = ["DocumentBatchCreateResponse", "DocumentBatchCreateResponseItem"]
8+
__all__ = ["DocumentBatchAddResponse", "DocumentBatchAddResponseItem"]
99

1010

11-
class DocumentBatchCreateResponseItem(BaseModel):
11+
class DocumentBatchAddResponseItem(BaseModel):
1212
id: str
1313
"""Unique identifier of the document"""
1414

1515
status: str
1616
"""Status of the document"""
1717

1818

19-
DocumentBatchCreateResponse: TypeAlias = List[DocumentBatchCreateResponseItem]
19+
DocumentBatchAddResponse: TypeAlias = List[DocumentBatchAddResponseItem]

tests/api_resources/test_documents.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
DocumentGetResponse,
1515
DocumentListResponse,
1616
DocumentUpdateResponse,
17+
DocumentBatchAddResponse,
1718
DocumentDeleteBulkResponse,
1819
DocumentUploadFileResponse,
19-
DocumentBatchCreateResponse,
2020
DocumentListProcessingResponse,
2121
)
2222

@@ -236,16 +236,16 @@ def test_streaming_response_add(self, client: Supermemory) -> None:
236236

237237
@pytest.mark.skip(reason="Prism tests are disabled")
238238
@parametrize
239-
def test_method_batch_create(self, client: Supermemory) -> None:
240-
document = client.documents.batch_create(
239+
def test_method_batch_add(self, client: Supermemory) -> None:
240+
document = client.documents.batch_add(
241241
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
242242
)
243-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
243+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
244244

245245
@pytest.mark.skip(reason="Prism tests are disabled")
246246
@parametrize
247-
def test_method_batch_create_with_all_params(self, client: Supermemory) -> None:
248-
document = client.documents.batch_create(
247+
def test_method_batch_add_with_all_params(self, client: Supermemory) -> None:
248+
document = client.documents.batch_add(
249249
documents=[
250250
{
251251
"content": "This is a detailed article about machine learning concepts...",
@@ -274,31 +274,31 @@ def test_method_batch_create_with_all_params(self, client: Supermemory) -> None:
274274
"tag_2": "machine-learning",
275275
},
276276
)
277-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
277+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
278278

279279
@pytest.mark.skip(reason="Prism tests are disabled")
280280
@parametrize
281-
def test_raw_response_batch_create(self, client: Supermemory) -> None:
282-
response = client.documents.with_raw_response.batch_create(
281+
def test_raw_response_batch_add(self, client: Supermemory) -> None:
282+
response = client.documents.with_raw_response.batch_add(
283283
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
284284
)
285285

286286
assert response.is_closed is True
287287
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
288288
document = response.parse()
289-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
289+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
290290

291291
@pytest.mark.skip(reason="Prism tests are disabled")
292292
@parametrize
293-
def test_streaming_response_batch_create(self, client: Supermemory) -> None:
294-
with client.documents.with_streaming_response.batch_create(
293+
def test_streaming_response_batch_add(self, client: Supermemory) -> None:
294+
with client.documents.with_streaming_response.batch_add(
295295
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
296296
) as response:
297297
assert not response.is_closed
298298
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
299299

300300
document = response.parse()
301-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
301+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
302302

303303
assert cast(Any, response.is_closed) is True
304304

@@ -671,16 +671,16 @@ async def test_streaming_response_add(self, async_client: AsyncSupermemory) -> N
671671

672672
@pytest.mark.skip(reason="Prism tests are disabled")
673673
@parametrize
674-
async def test_method_batch_create(self, async_client: AsyncSupermemory) -> None:
675-
document = await async_client.documents.batch_create(
674+
async def test_method_batch_add(self, async_client: AsyncSupermemory) -> None:
675+
document = await async_client.documents.batch_add(
676676
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
677677
)
678-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
678+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
679679

680680
@pytest.mark.skip(reason="Prism tests are disabled")
681681
@parametrize
682-
async def test_method_batch_create_with_all_params(self, async_client: AsyncSupermemory) -> None:
683-
document = await async_client.documents.batch_create(
682+
async def test_method_batch_add_with_all_params(self, async_client: AsyncSupermemory) -> None:
683+
document = await async_client.documents.batch_add(
684684
documents=[
685685
{
686686
"content": "This is a detailed article about machine learning concepts...",
@@ -709,31 +709,31 @@ async def test_method_batch_create_with_all_params(self, async_client: AsyncSupe
709709
"tag_2": "machine-learning",
710710
},
711711
)
712-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
712+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
713713

714714
@pytest.mark.skip(reason="Prism tests are disabled")
715715
@parametrize
716-
async def test_raw_response_batch_create(self, async_client: AsyncSupermemory) -> None:
717-
response = await async_client.documents.with_raw_response.batch_create(
716+
async def test_raw_response_batch_add(self, async_client: AsyncSupermemory) -> None:
717+
response = await async_client.documents.with_raw_response.batch_add(
718718
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
719719
)
720720

721721
assert response.is_closed is True
722722
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
723723
document = await response.parse()
724-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
724+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
725725

726726
@pytest.mark.skip(reason="Prism tests are disabled")
727727
@parametrize
728-
async def test_streaming_response_batch_create(self, async_client: AsyncSupermemory) -> None:
729-
async with async_client.documents.with_streaming_response.batch_create(
728+
async def test_streaming_response_batch_add(self, async_client: AsyncSupermemory) -> None:
729+
async with async_client.documents.with_streaming_response.batch_add(
730730
documents=[{"content": "This is a detailed article about machine learning concepts..."}],
731731
) as response:
732732
assert not response.is_closed
733733
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
734734

735735
document = await response.parse()
736-
assert_matches_type(DocumentBatchCreateResponse, document, path=["response"])
736+
assert_matches_type(DocumentBatchAddResponse, document, path=["response"])
737737

738738
assert cast(Any, response.is_closed) is True
739739

0 commit comments

Comments
 (0)