pub struct Priced<M> { /* private fields */ }Expand description
Attaches pricing to any model, e.g. one built from a provider:model spec.
Implementations§
Trait Implementations§
Source§impl<M: Model> Model for Priced<M>
impl<M: Model> Model for Priced<M>
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelStream, ModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelStream, ModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream the response as it is generated. The stream always ends with
StreamEvent::Completed carrying the full response. The default
implementation calls Model::complete and replays it as deltas.Source§fn pricing(&self) -> Option<Pricing>
fn pricing(&self) -> Option<Pricing>
Prices for this model, if configured. Required for USD budgets.
Source§fn unpriced_models(&self) -> Vec<String>
fn unpriced_models(&self) -> Vec<String>
Ids of models (including any inside a composite) that have no
pricing. A USD budget cannot be enforced while this is non-empty.
Auto Trait Implementations§
impl<M> Freeze for Priced<M>where
M: Freeze,
impl<M> RefUnwindSafe for Priced<M>where
M: RefUnwindSafe,
impl<M> Send for Priced<M>where
M: Send,
impl<M> Sync for Priced<M>where
M: Sync,
impl<M> Unpin for Priced<M>where
M: Unpin,
impl<M> UnsafeUnpin for Priced<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Priced<M>where
M: UnwindSafe,
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