pub struct BatchClient<'a, T = ()> { /* private fields */ }Expand description
Client for batch API.
Implementations§
Source§impl<T: Default + Send + Sync> BatchClient<'_, T>
impl<T: Default + Send + Sync> BatchClient<'_, T>
Sourcepub async fn create(&self, builder: BatchJobBuilder) -> Result<Batch>
pub async fn create(&self, builder: BatchJobBuilder) -> Result<Batch>
Create a new batch job.
§Example
ⓘ
use openai_ergonomic::Client;
use openai_ergonomic::builders::batch::{BatchJobBuilder, BatchEndpoint};
let client = Client::from_env()?;
let builder = BatchJobBuilder::new("file-batch-input", BatchEndpoint::ChatCompletions);
let batch = client.batch().create(builder).await?;
println!("Created batch: {}", batch.id);Sourcepub async fn list(
&self,
after: Option<&str>,
limit: Option<i32>,
) -> Result<ListBatchesResponse>
pub async fn list( &self, after: Option<&str>, limit: Option<i32>, ) -> Result<ListBatchesResponse>
Trait Implementations§
Source§impl<'a, T: Clone> Clone for BatchClient<'a, T>
impl<'a, T: Clone> Clone for BatchClient<'a, T>
Source§fn clone(&self) -> BatchClient<'a, T>
fn clone(&self) -> BatchClient<'a, T>
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<'a, T: Debug> Debug for BatchClient<'a, T>
impl<'a, T: Debug> Debug for BatchClient<'a, T>
impl<'a, T: Copy> Copy for BatchClient<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for BatchClient<'a, T>
impl<'a, T = ()> !RefUnwindSafe for BatchClient<'a, T>
impl<'a, T> Send for BatchClient<'a, T>
impl<'a, T> Sync for BatchClient<'a, T>
impl<'a, T> Unpin for BatchClient<'a, T>
impl<'a, T = ()> !UnwindSafe for BatchClient<'a, T>
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