#[non_exhaustive]pub struct Pricing {
pub input: f64,
pub output: f64,
pub cache_read: Option<f64>,
pub cache_write: Option<f64>,
}Expand description
Prices in USD per million tokens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input: f64Uncached input.
output: f64Output, reasoning included.
cache_read: Option<f64>Input read from the cache, or None when unknown.
cache_write: Option<f64>Input written to the cache, or None when unknown.
Implementations§
Source§impl Pricing
impl Pricing
Sourcepub fn cost(&self, usage: &Usage) -> Option<Cost>
pub fn cost(&self, usage: &Usage) -> Option<Cost>
What usage costs at these prices, or None unless it reports both
its input and output tokens. Uncached input is the input tokens less
those read from and written to the cache; cache reads and writes
with no price of their own are charged at Self::input. Every
cache write is charged at one price, so a provider that bills longer
retention higher costs more than this says. It is the standard-tier
list price of the tokens: the service tier, long-context price tiers
and hosted-tool fees (web search, code execution) are not in it.
Trait Implementations§
impl Copy for Pricing
impl StructuralPartialEq for Pricing
Auto Trait Implementations§
impl Freeze for Pricing
impl RefUnwindSafe for Pricing
impl Send for Pricing
impl Sync for Pricing
impl Unpin for Pricing
impl UnsafeUnpin for Pricing
impl UnwindSafe for Pricing
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more