pub struct ModelPricing {
pub input_per_mtok: f64,
pub output_per_mtok: f64,
}Expand description
USD pricing per 1M tokens.
Fields§
§input_per_mtok: f64USD per 1M input tokens.
output_per_mtok: f64USD per 1M output tokens.
Implementations§
Source§impl ModelPricing
impl ModelPricing
Sourcepub fn cost_for(&self, usage: TokenUsage) -> CostEstimate
pub fn cost_for(&self, usage: TokenUsage) -> CostEstimate
Cost for the given usage under this pricing.
Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§fn clone(&self) -> ModelPricing
fn clone(&self) -> ModelPricing
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelPricing
Source§impl Debug for ModelPricing
impl Debug for ModelPricing
Source§impl PartialEq for ModelPricing
impl PartialEq for ModelPricing
Source§fn eq(&self, other: &ModelPricing) -> bool
fn eq(&self, other: &ModelPricing) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ModelPricing
Auto Trait Implementations§
impl Freeze for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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