Struct TurnUsageTotals
pub struct TurnUsageTotals {
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
pub tokens_used: Option<u64>,
pub cost_usd: Option<f64>,
pub provider_ref: Option<String>,
pub model: Option<String>,
pub last_input_tokens: Option<u64>,
pub max_context_tokens: Option<u64>,
pub model_context_window: Option<u64>,
pub usage_by_provider: Vec<ProviderUsageTotals>,
}Expand description
Turn-wide usage totals on TurnComplete, the RPC counterpart of the
gateway chat socket’s done frame. Totals and usage_by_provider
include every billable attempt; the last_* fields and context
limits describe the accepted call that served the turn.
Fields§
§input_tokens: Option<u64>§output_tokens: Option<u64>§tokens_used: Option<u64>§cost_usd: Option<f64>Sum of usage_by_provider[*].cost_usd; absent when the sum is
not positive (an unpriced turn).
provider_ref: Option<String>§model: Option<String>§last_input_tokens: Option<u64>§max_context_tokens: Option<u64>Proactive-trim budget of the serving route.
model_context_window: Option<u64>Configured context window of the serving model.
usage_by_provider: Vec<ProviderUsageTotals>Trait Implementations§
Source§impl Clone for TurnUsageTotals
impl Clone for TurnUsageTotals
Source§fn clone(&self) -> TurnUsageTotals
fn clone(&self) -> TurnUsageTotals
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurnUsageTotals
impl Debug for TurnUsageTotals
Source§impl Default for TurnUsageTotals
impl Default for TurnUsageTotals
Source§fn default() -> TurnUsageTotals
fn default() -> TurnUsageTotals
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TurnUsageTotals
impl<'de> Deserialize<'de> for TurnUsageTotals
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TurnUsageTotals
impl PartialEq for TurnUsageTotals
Source§impl Serialize for TurnUsageTotals
impl Serialize for TurnUsageTotals
impl StructuralPartialEq for TurnUsageTotals
Auto Trait Implementations§
impl Freeze for TurnUsageTotals
impl RefUnwindSafe for TurnUsageTotals
impl Send for TurnUsageTotals
impl Sync for TurnUsageTotals
impl Unpin for TurnUsageTotals
impl UnsafeUnpin for TurnUsageTotals
impl UnwindSafe for TurnUsageTotals
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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