pub struct InvocationMetrics {
pub cost_usd: Option<f64>,
}Expand description
Per-invocation telemetry returned alongside an AI response.
Decouples call telemetry from the response payload so more fields (token
counts, cache hits, …) can be added without touching every backend’s
return type. cost_usd is None when the backend cannot determine a
price (missing usage data, an unpriced model, or a backend that does not
yet populate it) — callers fall back to reporting the cost as unknown.
Fields§
§cost_usd: Option<f64>Total billed cost of the invocation in USD, if known.
Trait Implementations§
Source§impl Clone for InvocationMetrics
impl Clone for InvocationMetrics
Source§fn clone(&self) -> InvocationMetrics
fn clone(&self) -> InvocationMetrics
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 moreSource§impl Debug for InvocationMetrics
impl Debug for InvocationMetrics
Source§impl Default for InvocationMetrics
impl Default for InvocationMetrics
Source§fn default() -> InvocationMetrics
fn default() -> InvocationMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for InvocationMetrics
impl PartialEq for InvocationMetrics
impl StructuralPartialEq for InvocationMetrics
Auto Trait Implementations§
impl Freeze for InvocationMetrics
impl RefUnwindSafe for InvocationMetrics
impl Send for InvocationMetrics
impl Sync for InvocationMetrics
impl Unpin for InvocationMetrics
impl UnsafeUnpin for InvocationMetrics
impl UnwindSafe for InvocationMetrics
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