pub struct BatchRequestArgs { /* private fields */ }
Expand description
Builder for BatchRequest
.
Implementations§
Source§impl BatchRequestArgs
impl BatchRequestArgs
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 BatchRequestArgs
impl Clone for BatchRequestArgs
Source§fn clone(&self) -> BatchRequestArgs
fn clone(&self) -> BatchRequestArgs
Returns a copy 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 BatchRequestArgs
impl Debug for BatchRequestArgs
Auto Trait Implementations§
impl Freeze for BatchRequestArgs
impl RefUnwindSafe for BatchRequestArgs
impl Send for BatchRequestArgs
impl Sync for BatchRequestArgs
impl Unpin for BatchRequestArgs
impl UnwindSafe for BatchRequestArgs
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