pub struct BatchRequestArgs { /* private fields */ }Expand description
Builder for BatchRequest.
Implementations§
Source§impl BatchRequestArgs
impl BatchRequestArgs
Sourcepub fn input_file_id<VALUE>(&mut self, value: VALUE) -> &mut BatchRequestArgs
pub fn input_file_id<VALUE>(&mut self, value: VALUE) -> &mut BatchRequestArgs
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>(&mut self, value: VALUE) -> &mut BatchRequestArgswhere
VALUE: Into<BatchEndpoint>,
pub fn endpoint<VALUE>(&mut self, value: VALUE) -> &mut BatchRequestArgswhere
VALUE: Into<BatchEndpoint>,
The endpoint to be used for all requests in the batch. Currently /v1/responses,
/v1/chat/completions, /v1/embeddings, /v1/completions, and /v1/moderations 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>(
&mut self,
value: VALUE,
) -> &mut BatchRequestArgswhere
VALUE: Into<BatchCompletionWindow>,
pub fn completion_window<VALUE>(
&mut self,
value: VALUE,
) -> &mut BatchRequestArgswhere
VALUE: Into<BatchCompletionWindow>,
The time frame within which the batch should be processed. Currently only 24h is supported.
Sourcepub fn metadata<VALUE>(&mut self, value: VALUE) -> &mut BatchRequestArgs
pub fn metadata<VALUE>(&mut self, value: VALUE) -> &mut BatchRequestArgs
Optional custom metadata for the batch.
Sourcepub fn output_expires_after<VALUE>(
&mut self,
value: VALUE,
) -> &mut BatchRequestArgswhere
VALUE: Into<BatchFileExpirationAfter>,
pub fn output_expires_after<VALUE>(
&mut self,
value: VALUE,
) -> &mut BatchRequestArgswhere
VALUE: Into<BatchFileExpirationAfter>,
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more