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 (const: unstable) · 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 UnsafeUnpin 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