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 200 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/responses, /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 output_expires_after<VALUE: Into<BatchFileExpirationAfter>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn output_expires_after<VALUE: Into<BatchFileExpirationAfter>>( &mut self, value: VALUE, ) -> &mut Self
The expiration policy for the output and/or error file that are generated for a 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more