pub struct CostMetrics {
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub total_tokens: u64,
pub cost_usd: Option<f64>,
pub latency_ms: u64,
}Available on crate feature
eval only.Expand description
Cost and latency metrics for a single evaluation turn.
Captures token usage, estimated cost, and wall-clock latency for a set of events produced during agent execution.
Fields§
§prompt_tokens: u64Number of prompt/input tokens used.
completion_tokens: u64Number of completion/output tokens generated.
total_tokens: u64Total token count (prompt + completion).
cost_usd: Option<f64>Estimated cost in USD (None if pricing unavailable for the model).
latency_ms: u64Wall-clock latency in milliseconds.
Trait Implementations§
Source§impl Clone for CostMetrics
impl Clone for CostMetrics
Source§fn clone(&self) -> CostMetrics
fn clone(&self) -> CostMetrics
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 CostMetrics
impl Debug for CostMetrics
Source§impl Default for CostMetrics
impl Default for CostMetrics
Source§fn default() -> CostMetrics
fn default() -> CostMetrics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CostMetrics
impl<'de> Deserialize<'de> for CostMetrics
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CostMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CostMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CostMetrics
impl Serialize for CostMetrics
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CostMetrics
impl RefUnwindSafe for CostMetrics
impl Send for CostMetrics
impl Sync for CostMetrics
impl Unpin for CostMetrics
impl UnsafeUnpin for CostMetrics
impl UnwindSafe for CostMetrics
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