Available on crate feature
eval only.Expand description
Cost and latency tracking for evaluation runs.
This module provides CostTracker which extracts token usage from agent
event streams and computes estimated dollar costs using configurable
per-model pricing tables.
§Example
use adk_eval::cost_tracker::{CostTracker, CostMetrics};
let tracker = CostTracker::new();
// Compute cost for a known model
let cost = tracker.compute_cost("gpt-4o", 1000, 500);
assert!(cost.is_some());
// Unknown models return None
let cost = tracker.compute_cost("unknown-model", 100, 50);
assert!(cost.is_none());Structs§
- Cost
Metrics - Cost and latency metrics for a single evaluation turn.
- Cost
Tracker - Tracks cost and latency metrics from agent event streams.