@@ -47,6 +47,7 @@ def create(
47
47
vector_store_id : str ,
48
48
* ,
49
49
file_ids : List [str ],
50
+ chunking_strategy : file_batch_create_params .ChunkingStrategy | NotGiven = NOT_GIVEN ,
50
51
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
52
# The extra values given here take precedence over values defined on the client or passed to this method.
52
53
extra_headers : Headers | None = None ,
@@ -62,6 +63,9 @@ def create(
62
63
the vector store should use. Useful for tools like `file_search` that can access
63
64
files.
64
65
66
+ chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
67
+ strategy.
68
+
65
69
extra_headers: Send extra headers
66
70
67
71
extra_query: Add additional query parameters to the request
@@ -75,7 +79,13 @@ def create(
75
79
extra_headers = {"OpenAI-Beta" : "assistants=v2" , ** (extra_headers or {})}
76
80
return self ._post (
77
81
f"/vector_stores/{ vector_store_id } /file_batches" ,
78
- body = maybe_transform ({"file_ids" : file_ids }, file_batch_create_params .FileBatchCreateParams ),
82
+ body = maybe_transform (
83
+ {
84
+ "file_ids" : file_ids ,
85
+ "chunking_strategy" : chunking_strategy ,
86
+ },
87
+ file_batch_create_params .FileBatchCreateParams ,
88
+ ),
79
89
options = make_request_options (
80
90
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
81
91
),
@@ -351,6 +361,7 @@ async def create(
351
361
vector_store_id : str ,
352
362
* ,
353
363
file_ids : List [str ],
364
+ chunking_strategy : file_batch_create_params .ChunkingStrategy | NotGiven = NOT_GIVEN ,
354
365
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
355
366
# The extra values given here take precedence over values defined on the client or passed to this method.
356
367
extra_headers : Headers | None = None ,
@@ -366,6 +377,9 @@ async def create(
366
377
the vector store should use. Useful for tools like `file_search` that can access
367
378
files.
368
379
380
+ chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
381
+ strategy.
382
+
369
383
extra_headers: Send extra headers
370
384
371
385
extra_query: Add additional query parameters to the request
@@ -379,7 +393,13 @@ async def create(
379
393
extra_headers = {"OpenAI-Beta" : "assistants=v2" , ** (extra_headers or {})}
380
394
return await self ._post (
381
395
f"/vector_stores/{ vector_store_id } /file_batches" ,
382
- body = await async_maybe_transform ({"file_ids" : file_ids }, file_batch_create_params .FileBatchCreateParams ),
396
+ body = await async_maybe_transform (
397
+ {
398
+ "file_ids" : file_ids ,
399
+ "chunking_strategy" : chunking_strategy ,
400
+ },
401
+ file_batch_create_params .FileBatchCreateParams ,
402
+ ),
383
403
options = make_request_options (
384
404
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
385
405
),
0 commit comments