@@ -42,6 +42,7 @@ def create(
42
42
vector_store_id : str ,
43
43
* ,
44
44
file_ids : List [str ],
45
+ chunking_strategy : file_batch_create_params .ChunkingStrategy | NotGiven = NOT_GIVEN ,
45
46
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
47
# The extra values given here take precedence over values defined on the client or passed to this method.
47
48
extra_headers : Headers | None = None ,
@@ -57,6 +58,9 @@ def create(
57
58
the vector store should use. Useful for tools like `file_search` that can access
58
59
files.
59
60
61
+ chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
62
+ strategy.
63
+
60
64
extra_headers: Send extra headers
61
65
62
66
extra_query: Add additional query parameters to the request
@@ -70,7 +74,13 @@ def create(
70
74
extra_headers = {"OpenAI-Beta" : "assistants=v2" , ** (extra_headers or {})}
71
75
return self ._post (
72
76
f"/vector_stores/{ vector_store_id } /file_batches" ,
73
- body = maybe_transform ({"file_ids" : file_ids }, file_batch_create_params .FileBatchCreateParams ),
77
+ body = maybe_transform (
78
+ {
79
+ "file_ids" : file_ids ,
80
+ "chunking_strategy" : chunking_strategy ,
81
+ },
82
+ file_batch_create_params .FileBatchCreateParams ,
83
+ ),
74
84
options = make_request_options (
75
85
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
76
86
),
@@ -242,6 +252,7 @@ async def create(
242
252
vector_store_id : str ,
243
253
* ,
244
254
file_ids : List [str ],
255
+ chunking_strategy : file_batch_create_params .ChunkingStrategy | NotGiven = NOT_GIVEN ,
245
256
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
257
# The extra values given here take precedence over values defined on the client or passed to this method.
247
258
extra_headers : Headers | None = None ,
@@ -257,6 +268,9 @@ async def create(
257
268
the vector store should use. Useful for tools like `file_search` that can access
258
269
files.
259
270
271
+ chunking_strategy: The chunking strategy used to chunk the file(s). If not set, will use the `auto`
272
+ strategy.
273
+
260
274
extra_headers: Send extra headers
261
275
262
276
extra_query: Add additional query parameters to the request
@@ -270,7 +284,13 @@ async def create(
270
284
extra_headers = {"OpenAI-Beta" : "assistants=v2" , ** (extra_headers or {})}
271
285
return await self ._post (
272
286
f"/vector_stores/{ vector_store_id } /file_batches" ,
273
- body = await async_maybe_transform ({"file_ids" : file_ids }, file_batch_create_params .FileBatchCreateParams ),
287
+ body = await async_maybe_transform (
288
+ {
289
+ "file_ids" : file_ids ,
290
+ "chunking_strategy" : chunking_strategy ,
291
+ },
292
+ file_batch_create_params .FileBatchCreateParams ,
293
+ ),
274
294
options = make_request_options (
275
295
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
276
296
),
0 commit comments