pub struct Price {
pub input: f64,
pub output: f64,
pub cache_write_5m: f64,
pub cache_write_1h: f64,
pub cache_read: f64,
}Fields§
§input: f64§output: f64§cache_write_5m: f64§cache_write_1h: f64§cache_read: f64Implementations§
Source§impl Price
impl Price
Sourcepub fn cost(&self, usage: &TokenUsage) -> f64
pub fn cost(&self, usage: &TokenUsage) -> f64
Cost in USD of usage at this price.
Sourcepub fn breakdown(&self, usage: &TokenUsage) -> CostBreakdown
pub fn breakdown(&self, usage: &TokenUsage) -> CostBreakdown
The same cost, one line per kind of token.
Trait Implementations§
impl Copy for Price
impl StructuralPartialEq for Price
Auto Trait Implementations§
impl Freeze for Price
impl RefUnwindSafe for Price
impl Send for Price
impl Sync for Price
impl Unpin for Price
impl UnsafeUnpin for Price
impl UnwindSafe for Price
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