1818)
1919from ...pagination import SyncOpenAICursorPage , AsyncOpenAICursorPage
2020from ..._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
2222from ...types .vector_stores .vector_store_file import VectorStoreFile
2323from ...types .vector_stores .vector_store_file_batches import VectorStoreFileBatches
2424
@@ -131,7 +131,43 @@ def retrieve(
131131 cast_to = VectorStoreFileBatches ,
132132 )
133133
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 (
135171 self ,
136172 batch_id : str ,
137173 * ,
@@ -194,48 +230,12 @@ def list(
194230 "limit" : limit ,
195231 "order" : order ,
196232 },
197- file_batch_list_params . FileBatchListParams ,
233+ file_batch_list_files_params . FileBatchListFilesParams ,
198234 ),
199235 ),
200236 model = VectorStoreFile ,
201237 )
202238
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-
239239
240240class AsyncFileBatchesResource (AsyncAPIResource ):
241241 @cached_property
@@ -343,7 +343,43 @@ async def retrieve(
343343 cast_to = VectorStoreFileBatches ,
344344 )
345345
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 (
347383 self ,
348384 batch_id : str ,
349385 * ,
@@ -406,48 +442,12 @@ def list(
406442 "limit" : limit ,
407443 "order" : order ,
408444 },
409- file_batch_list_params . FileBatchListParams ,
445+ file_batch_list_files_params . FileBatchListFilesParams ,
410446 ),
411447 ),
412448 model = VectorStoreFile ,
413449 )
414450
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-
451451
452452class FileBatchesResourceWithRawResponse :
453453 def __init__ (self , file_batches : FileBatchesResource ) -> None :
@@ -459,12 +459,12 @@ def __init__(self, file_batches: FileBatchesResource) -> None:
459459 self .retrieve = to_raw_response_wrapper (
460460 file_batches .retrieve ,
461461 )
462- self .list = to_raw_response_wrapper (
463- file_batches .list ,
464- )
465462 self .cancel = to_raw_response_wrapper (
466463 file_batches .cancel ,
467464 )
465+ self .list_files = to_raw_response_wrapper (
466+ file_batches .list_files ,
467+ )
468468
469469
470470class AsyncFileBatchesResourceWithRawResponse :
@@ -477,12 +477,12 @@ def __init__(self, file_batches: AsyncFileBatchesResource) -> None:
477477 self .retrieve = async_to_raw_response_wrapper (
478478 file_batches .retrieve ,
479479 )
480- self .list = async_to_raw_response_wrapper (
481- file_batches .list ,
482- )
483480 self .cancel = async_to_raw_response_wrapper (
484481 file_batches .cancel ,
485482 )
483+ self .list_files = async_to_raw_response_wrapper (
484+ file_batches .list_files ,
485+ )
486486
487487
488488class FileBatchesResourceWithStreamingResponse :
@@ -495,12 +495,12 @@ def __init__(self, file_batches: FileBatchesResource) -> None:
495495 self .retrieve = to_streamed_response_wrapper (
496496 file_batches .retrieve ,
497497 )
498- self .list = to_streamed_response_wrapper (
499- file_batches .list ,
500- )
501498 self .cancel = to_streamed_response_wrapper (
502499 file_batches .cancel ,
503500 )
501+ self .list_files = to_streamed_response_wrapper (
502+ file_batches .list_files ,
503+ )
504504
505505
506506class AsyncFileBatchesResourceWithStreamingResponse :
@@ -513,9 +513,9 @@ def __init__(self, file_batches: AsyncFileBatchesResource) -> None:
513513 self .retrieve = async_to_streamed_response_wrapper (
514514 file_batches .retrieve ,
515515 )
516- self .list = async_to_streamed_response_wrapper (
517- file_batches .list ,
518- )
519516 self .cancel = async_to_streamed_response_wrapper (
520517 file_batches .cancel ,
521518 )
519+ self .list_files = async_to_streamed_response_wrapper (
520+ file_batches .list_files ,
521+ )
0 commit comments