pub struct BatchRequestBuilder { /* private fields */ }
Expand description
Builder for BatchRequest
.
Implementations§
Source§impl BatchRequestBuilder
impl BatchRequestBuilder
Sourcepub fn input_file_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn input_file_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The ID of an uploaded file that contains requests for the new batch.
See upload file for how to upload a file.
Your input file must be formatted as a JSONL file, and must be uploaded with the purpose batch
. The file can contain up to 50,000 requests, and can be up to 100 MB in size.
Sourcepub fn endpoint<VALUE: Into<BatchEndpoint>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn endpoint<VALUE: Into<BatchEndpoint>>( &mut self, value: VALUE, ) -> &mut Self
The endpoint to be used for all requests in the batch. Currently /v1/chat/completions
, /v1/embeddings
, and /v1/completions
are supported. Note that /v1/embeddings
batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.
Sourcepub fn completion_window<VALUE: Into<BatchCompletionWindow>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn completion_window<VALUE: Into<BatchCompletionWindow>>( &mut self, value: VALUE, ) -> &mut Self
The time frame within which the batch should be processed. Currently only 24h
is supported.
Sourcepub fn metadata<VALUE: Into<HashMap<String, Value>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn metadata<VALUE: Into<HashMap<String, Value>>>( &mut self, value: VALUE, ) -> &mut Self
Optional custom metadata for the batch.
Sourcepub fn build(&self) -> Result<BatchRequest, OpenAIError>
pub fn build(&self) -> Result<BatchRequest, OpenAIError>
Trait Implementations§
Source§impl Clone for BatchRequestBuilder
impl Clone for BatchRequestBuilder
Source§fn clone(&self) -> BatchRequestBuilder
fn clone(&self) -> BatchRequestBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BatchRequestBuilder
impl Debug for BatchRequestBuilder
Auto Trait Implementations§
impl Freeze for BatchRequestBuilder
impl RefUnwindSafe for BatchRequestBuilder
impl Send for BatchRequestBuilder
impl Sync for BatchRequestBuilder
impl Unpin for BatchRequestBuilder
impl UnwindSafe for BatchRequestBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more