pub struct Batches<'c, C: Config> { /* private fields */ }
Expand description
Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.
Related guide: Batch
Implementations§
Source§impl<'c, C: Config> Batches<'c, C>
impl<'c, C: Config> Batches<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn create(&self, request: BatchRequest) -> Result<Batch, OpenAIError>
pub async fn create(&self, request: BatchRequest) -> Result<Batch, OpenAIError>
Creates and executes a batch from an uploaded file of requests
Sourcepub async fn list<Q>(
&self,
query: &Q,
) -> Result<ListBatchesResponse, OpenAIError>
pub async fn list<Q>( &self, query: &Q, ) -> Result<ListBatchesResponse, OpenAIError>
List your organization’s batches.
Auto Trait Implementations§
impl<'c, C> Freeze for Batches<'c, C>
impl<'c, C> !RefUnwindSafe for Batches<'c, C>
impl<'c, C> Send for Batches<'c, C>where
C: Sync,
impl<'c, C> Sync for Batches<'c, C>where
C: Sync,
impl<'c, C> Unpin for Batches<'c, C>
impl<'c, C> !UnwindSafe for Batches<'c, C>
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