18
18
from ...._resource import SyncAPIResource , AsyncAPIResource
19
19
from ...._response import to_streamed_response_wrapper , async_to_streamed_response_wrapper
20
20
from ....pagination import SyncCursorPage , AsyncCursorPage
21
- from ...._base_client import (
22
- AsyncPaginator ,
23
- make_request_options ,
24
- )
21
+ from ....types .beta import FileChunkingStrategyParam
22
+ from ...._base_client import AsyncPaginator , make_request_options
25
23
from ....types .beta .vector_stores import file_list_params , file_create_params
24
+ from ....types .beta .file_chunking_strategy_param import FileChunkingStrategyParam
26
25
from ....types .beta .vector_stores .vector_store_file import VectorStoreFile
27
26
from ....types .beta .vector_stores .vector_store_file_deleted import VectorStoreFileDeleted
28
27
@@ -43,7 +42,7 @@ def create(
43
42
vector_store_id : str ,
44
43
* ,
45
44
file_id : str ,
46
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
45
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
47
46
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48
47
# The extra values given here take precedence over values defined on the client or passed to this method.
49
48
extra_headers : Headers | None = None ,
@@ -62,7 +61,7 @@ def create(
62
61
files.
63
62
64
63
chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
65
- strategy.
64
+ strategy. Only applicable if `file_ids` is non-empty.
66
65
67
66
extra_headers: Send extra headers
68
67
@@ -245,7 +244,7 @@ def create_and_poll(
245
244
* ,
246
245
vector_store_id : str ,
247
246
poll_interval_ms : int | NotGiven = NOT_GIVEN ,
248
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
247
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
249
248
) -> VectorStoreFile :
250
249
"""Attach a file to the given vector store and wait for it to be processed."""
251
250
self .create (vector_store_id = vector_store_id , file_id = file_id , chunking_strategy = chunking_strategy )
@@ -302,7 +301,7 @@ def upload(
302
301
* ,
303
302
vector_store_id : str ,
304
303
file : FileTypes ,
305
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
304
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
306
305
) -> VectorStoreFile :
307
306
"""Upload a file to the `files` API and then attach it to the given vector store.
308
307
@@ -318,7 +317,7 @@ def upload_and_poll(
318
317
vector_store_id : str ,
319
318
file : FileTypes ,
320
319
poll_interval_ms : int | NotGiven = NOT_GIVEN ,
321
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
320
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
322
321
) -> VectorStoreFile :
323
322
"""Add a file to a vector store and poll until processing is complete."""
324
323
file_obj = self ._client .files .create (file = file , purpose = "assistants" )
@@ -344,7 +343,7 @@ async def create(
344
343
vector_store_id : str ,
345
344
* ,
346
345
file_id : str ,
347
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
346
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
348
347
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349
348
# The extra values given here take precedence over values defined on the client or passed to this method.
350
349
extra_headers : Headers | None = None ,
@@ -363,7 +362,7 @@ async def create(
363
362
files.
364
363
365
364
chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
366
- strategy.
365
+ strategy. Only applicable if `file_ids` is non-empty.
367
366
368
367
extra_headers: Send extra headers
369
368
@@ -546,7 +545,7 @@ async def create_and_poll(
546
545
* ,
547
546
vector_store_id : str ,
548
547
poll_interval_ms : int | NotGiven = NOT_GIVEN ,
549
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
548
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
550
549
) -> VectorStoreFile :
551
550
"""Attach a file to the given vector store and wait for it to be processed."""
552
551
await self .create (vector_store_id = vector_store_id , file_id = file_id , chunking_strategy = chunking_strategy )
@@ -603,7 +602,7 @@ async def upload(
603
602
* ,
604
603
vector_store_id : str ,
605
604
file : FileTypes ,
606
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
605
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
607
606
) -> VectorStoreFile :
608
607
"""Upload a file to the `files` API and then attach it to the given vector store.
609
608
@@ -621,7 +620,7 @@ async def upload_and_poll(
621
620
vector_store_id : str ,
622
621
file : FileTypes ,
623
622
poll_interval_ms : int | NotGiven = NOT_GIVEN ,
624
- chunking_strategy : file_create_params . ChunkingStrategy | NotGiven = NOT_GIVEN ,
623
+ chunking_strategy : FileChunkingStrategyParam | NotGiven = NOT_GIVEN ,
625
624
) -> VectorStoreFile :
626
625
"""Add a file to a vector store and poll until processing is complete."""
627
626
file_obj = await self ._client .files .create (file = file , purpose = "assistants" )
0 commit comments