18
18
)
19
19
from ...pagination import SyncOpenAICursorPage , AsyncOpenAICursorPage
20
20
from ..._base_client import AsyncPaginator , make_request_options
21
- from ...types .vector_stores import file_batch_list_params , file_batch_create_params
21
+ from ...types .vector_stores import file_batch_create_params , file_batch_list_files_params
22
22
from ...types .vector_stores .vector_store_file import VectorStoreFile
23
23
from ...types .vector_stores .vector_store_file_batches import VectorStoreFileBatches
24
24
@@ -131,7 +131,43 @@ def retrieve(
131
131
cast_to = VectorStoreFileBatches ,
132
132
)
133
133
134
- def list (
134
+ def cancel (
135
+ self ,
136
+ batch_id : str ,
137
+ * ,
138
+ vector_store_id : str ,
139
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140
+ # The extra values given here take precedence over values defined on the client or passed to this method.
141
+ extra_headers : Headers | None = None ,
142
+ extra_query : Query | None = None ,
143
+ extra_body : Body | None = None ,
144
+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
145
+ ) -> VectorStoreFileBatches :
146
+ """
147
+ Cancels a vector store file batch.
148
+
149
+ Args:
150
+ extra_headers: Send extra headers
151
+
152
+ extra_query: Add additional query parameters to the request
153
+
154
+ extra_body: Add additional JSON properties to the request
155
+
156
+ timeout: Override the client-level default timeout for this request, in seconds
157
+ """
158
+ if not vector_store_id :
159
+ raise ValueError (f"Expected a non-empty value for `vector_store_id` but received { vector_store_id !r} " )
160
+ if not batch_id :
161
+ raise ValueError (f"Expected a non-empty value for `batch_id` but received { batch_id !r} " )
162
+ return self ._post (
163
+ f"/v1/vector_stores/{ vector_store_id } /file_batches/{ batch_id } /cancel" ,
164
+ options = make_request_options (
165
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
166
+ ),
167
+ cast_to = VectorStoreFileBatches ,
168
+ )
169
+
170
+ def list_files (
135
171
self ,
136
172
batch_id : str ,
137
173
* ,
@@ -194,48 +230,12 @@ def list(
194
230
"limit" : limit ,
195
231
"order" : order ,
196
232
},
197
- file_batch_list_params . FileBatchListParams ,
233
+ file_batch_list_files_params . FileBatchListFilesParams ,
198
234
),
199
235
),
200
236
model = VectorStoreFile ,
201
237
)
202
238
203
- def cancel (
204
- self ,
205
- batch_id : str ,
206
- * ,
207
- vector_store_id : str ,
208
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
209
- # The extra values given here take precedence over values defined on the client or passed to this method.
210
- extra_headers : Headers | None = None ,
211
- extra_query : Query | None = None ,
212
- extra_body : Body | None = None ,
213
- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
214
- ) -> VectorStoreFileBatches :
215
- """
216
- Cancels a vector store file batch.
217
-
218
- Args:
219
- extra_headers: Send extra headers
220
-
221
- extra_query: Add additional query parameters to the request
222
-
223
- extra_body: Add additional JSON properties to the request
224
-
225
- timeout: Override the client-level default timeout for this request, in seconds
226
- """
227
- if not vector_store_id :
228
- raise ValueError (f"Expected a non-empty value for `vector_store_id` but received { vector_store_id !r} " )
229
- if not batch_id :
230
- raise ValueError (f"Expected a non-empty value for `batch_id` but received { batch_id !r} " )
231
- return self ._post (
232
- f"/v1/vector_stores/{ vector_store_id } /file_batches/{ batch_id } /cancel" ,
233
- options = make_request_options (
234
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
235
- ),
236
- cast_to = VectorStoreFileBatches ,
237
- )
238
-
239
239
240
240
class AsyncFileBatchesResource (AsyncAPIResource ):
241
241
@cached_property
@@ -343,7 +343,43 @@ async def retrieve(
343
343
cast_to = VectorStoreFileBatches ,
344
344
)
345
345
346
- def list (
346
+ async def cancel (
347
+ self ,
348
+ batch_id : str ,
349
+ * ,
350
+ vector_store_id : str ,
351
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
352
+ # The extra values given here take precedence over values defined on the client or passed to this method.
353
+ extra_headers : Headers | None = None ,
354
+ extra_query : Query | None = None ,
355
+ extra_body : Body | None = None ,
356
+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
357
+ ) -> VectorStoreFileBatches :
358
+ """
359
+ Cancels a vector store file batch.
360
+
361
+ Args:
362
+ extra_headers: Send extra headers
363
+
364
+ extra_query: Add additional query parameters to the request
365
+
366
+ extra_body: Add additional JSON properties to the request
367
+
368
+ timeout: Override the client-level default timeout for this request, in seconds
369
+ """
370
+ if not vector_store_id :
371
+ raise ValueError (f"Expected a non-empty value for `vector_store_id` but received { vector_store_id !r} " )
372
+ if not batch_id :
373
+ raise ValueError (f"Expected a non-empty value for `batch_id` but received { batch_id !r} " )
374
+ return await self ._post (
375
+ f"/v1/vector_stores/{ vector_store_id } /file_batches/{ batch_id } /cancel" ,
376
+ options = make_request_options (
377
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
378
+ ),
379
+ cast_to = VectorStoreFileBatches ,
380
+ )
381
+
382
+ def list_files (
347
383
self ,
348
384
batch_id : str ,
349
385
* ,
@@ -406,48 +442,12 @@ def list(
406
442
"limit" : limit ,
407
443
"order" : order ,
408
444
},
409
- file_batch_list_params . FileBatchListParams ,
445
+ file_batch_list_files_params . FileBatchListFilesParams ,
410
446
),
411
447
),
412
448
model = VectorStoreFile ,
413
449
)
414
450
415
- async def cancel (
416
- self ,
417
- batch_id : str ,
418
- * ,
419
- vector_store_id : str ,
420
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
421
- # The extra values given here take precedence over values defined on the client or passed to this method.
422
- extra_headers : Headers | None = None ,
423
- extra_query : Query | None = None ,
424
- extra_body : Body | None = None ,
425
- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
426
- ) -> VectorStoreFileBatches :
427
- """
428
- Cancels a vector store file batch.
429
-
430
- Args:
431
- extra_headers: Send extra headers
432
-
433
- extra_query: Add additional query parameters to the request
434
-
435
- extra_body: Add additional JSON properties to the request
436
-
437
- timeout: Override the client-level default timeout for this request, in seconds
438
- """
439
- if not vector_store_id :
440
- raise ValueError (f"Expected a non-empty value for `vector_store_id` but received { vector_store_id !r} " )
441
- if not batch_id :
442
- raise ValueError (f"Expected a non-empty value for `batch_id` but received { batch_id !r} " )
443
- return await self ._post (
444
- f"/v1/vector_stores/{ vector_store_id } /file_batches/{ batch_id } /cancel" ,
445
- options = make_request_options (
446
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
447
- ),
448
- cast_to = VectorStoreFileBatches ,
449
- )
450
-
451
451
452
452
class FileBatchesResourceWithRawResponse :
453
453
def __init__ (self , file_batches : FileBatchesResource ) -> None :
@@ -459,12 +459,12 @@ def __init__(self, file_batches: FileBatchesResource) -> None:
459
459
self .retrieve = to_raw_response_wrapper (
460
460
file_batches .retrieve ,
461
461
)
462
- self .list = to_raw_response_wrapper (
463
- file_batches .list ,
464
- )
465
462
self .cancel = to_raw_response_wrapper (
466
463
file_batches .cancel ,
467
464
)
465
+ self .list_files = to_raw_response_wrapper (
466
+ file_batches .list_files ,
467
+ )
468
468
469
469
470
470
class AsyncFileBatchesResourceWithRawResponse :
@@ -477,12 +477,12 @@ def __init__(self, file_batches: AsyncFileBatchesResource) -> None:
477
477
self .retrieve = async_to_raw_response_wrapper (
478
478
file_batches .retrieve ,
479
479
)
480
- self .list = async_to_raw_response_wrapper (
481
- file_batches .list ,
482
- )
483
480
self .cancel = async_to_raw_response_wrapper (
484
481
file_batches .cancel ,
485
482
)
483
+ self .list_files = async_to_raw_response_wrapper (
484
+ file_batches .list_files ,
485
+ )
486
486
487
487
488
488
class FileBatchesResourceWithStreamingResponse :
@@ -495,12 +495,12 @@ def __init__(self, file_batches: FileBatchesResource) -> None:
495
495
self .retrieve = to_streamed_response_wrapper (
496
496
file_batches .retrieve ,
497
497
)
498
- self .list = to_streamed_response_wrapper (
499
- file_batches .list ,
500
- )
501
498
self .cancel = to_streamed_response_wrapper (
502
499
file_batches .cancel ,
503
500
)
501
+ self .list_files = to_streamed_response_wrapper (
502
+ file_batches .list_files ,
503
+ )
504
504
505
505
506
506
class AsyncFileBatchesResourceWithStreamingResponse :
@@ -513,9 +513,9 @@ def __init__(self, file_batches: AsyncFileBatchesResource) -> None:
513
513
self .retrieve = async_to_streamed_response_wrapper (
514
514
file_batches .retrieve ,
515
515
)
516
- self .list = async_to_streamed_response_wrapper (
517
- file_batches .list ,
518
- )
519
516
self .cancel = async_to_streamed_response_wrapper (
520
517
file_batches .cancel ,
521
518
)
519
+ self .list_files = async_to_streamed_response_wrapper (
520
+ file_batches .list_files ,
521
+ )
0 commit comments