pub struct BatchJobBuilder { /* private fields */ }Expand description
Builder for creating batch jobs.
Batch jobs allow you to process multiple requests asynchronously at a lower cost with longer processing time (up to 24 hours).
Implementations§
Source§impl BatchJobBuilder
impl BatchJobBuilder
Sourcepub fn new(input_file_id: impl Into<String>, endpoint: BatchEndpoint) -> Self
pub fn new(input_file_id: impl Into<String>, endpoint: BatchEndpoint) -> Self
Create a new batch job builder.
§Examples
use openai_ergonomic::builders::batch::{BatchJobBuilder, BatchEndpoint};
let builder = BatchJobBuilder::new("file-batch-input", BatchEndpoint::ChatCompletions);Sourcepub fn completion_window(self, window: BatchCompletionWindow) -> Self
pub fn completion_window(self, window: BatchCompletionWindow) -> Self
Set the completion window for the batch job.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add metadata to the batch job.
Sourcepub fn input_file_id(&self) -> &str
pub fn input_file_id(&self) -> &str
Get the input file ID.
Sourcepub fn endpoint(&self) -> &BatchEndpoint
pub fn endpoint(&self) -> &BatchEndpoint
Get the endpoint for this batch job.
Sourcepub fn completion_window_ref(&self) -> &BatchCompletionWindow
pub fn completion_window_ref(&self) -> &BatchCompletionWindow
Get the completion window.
Sourcepub fn metadata_ref(&self) -> &HashMap<String, String>
pub fn metadata_ref(&self) -> &HashMap<String, String>
Get the metadata.
Sourcepub fn has_metadata(&self) -> bool
pub fn has_metadata(&self) -> bool
Check if metadata is empty.
Trait Implementations§
Source§impl Clone for BatchJobBuilder
impl Clone for BatchJobBuilder
Source§fn clone(&self) -> BatchJobBuilder
fn clone(&self) -> BatchJobBuilder
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 moreAuto Trait Implementations§
impl Freeze for BatchJobBuilder
impl RefUnwindSafe for BatchJobBuilder
impl Send for BatchJobBuilder
impl Sync for BatchJobBuilder
impl Unpin for BatchJobBuilder
impl UnwindSafe for BatchJobBuilder
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