pub struct CreateBatchRequest {
pub input_file_id: String,
pub endpoint: BatchEndpoint,
pub completion_window: CompletionWindow,
pub metadata: Option<HashMap<String, String>>,
}Expand description
Request to create a new batch job.
Fields§
§input_file_id: StringThe ID of an uploaded file that contains requests for the batch. The file must be uploaded with purpose “batch”.
endpoint: BatchEndpointThe endpoint to use for all requests in the batch.
completion_window: CompletionWindowThe time window in which the batch must be completed.
metadata: Option<HashMap<String, String>>Optional metadata to attach to the batch.
Implementations§
Source§impl CreateBatchRequest
impl CreateBatchRequest
Sourcepub fn new(input_file_id: impl Into<String>, endpoint: BatchEndpoint) -> Self
pub fn new(input_file_id: impl Into<String>, endpoint: BatchEndpoint) -> Self
Creates a new batch request with the given input file ID and endpoint.
§Arguments
input_file_id- The ID of the uploaded input fileendpoint- The API endpoint to use for the batch
§Example
use openai_tools::batch::request::{CreateBatchRequest, BatchEndpoint};
let request = CreateBatchRequest::new("file-abc123", BatchEndpoint::ChatCompletions);Trait Implementations§
Source§impl Clone for CreateBatchRequest
impl Clone for CreateBatchRequest
Source§fn clone(&self) -> CreateBatchRequest
fn clone(&self) -> CreateBatchRequest
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 CreateBatchRequest
impl Debug for CreateBatchRequest
Auto Trait Implementations§
impl Freeze for CreateBatchRequest
impl RefUnwindSafe for CreateBatchRequest
impl Send for CreateBatchRequest
impl Sync for CreateBatchRequest
impl Unpin for CreateBatchRequest
impl UnwindSafe for CreateBatchRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more