pub struct CostReport {
pub scope: Option<String>,
pub calls: usize,
pub prompt_tokens: usize,
pub completion_tokens: usize,
pub total_cost_usd: f64,
pub by_model: HashMap<String, ModelSpend>,
}Expand description
Point-in-time aggregate report of a CostTracker.
Fields§
§scope: Option<String>Optional run/session label the tracker was scoped with.
calls: usizeTotal calls recorded.
prompt_tokens: usizeTotal prompt tokens.
completion_tokens: usizeTotal completion tokens.
total_cost_usd: f64Total USD spend across all models.
by_model: HashMap<String, ModelSpend>Per-model breakdown keyed "<provider>/<model>" (or "<model>" when no
provider was declared).
Trait Implementations§
Source§impl Clone for CostReport
impl Clone for CostReport
Source§fn clone(&self) -> CostReport
fn clone(&self) -> CostReport
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 CostReport
impl Debug for CostReport
Source§impl<'de> Deserialize<'de> for CostReport
impl<'de> Deserialize<'de> for CostReport
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 CostReport
impl PartialEq for CostReport
Source§impl Serialize for CostReport
impl Serialize for CostReport
impl StructuralPartialEq for CostReport
Auto Trait Implementations§
impl Freeze for CostReport
impl RefUnwindSafe for CostReport
impl Send for CostReport
impl Sync for CostReport
impl Unpin for CostReport
impl UnsafeUnpin for CostReport
impl UnwindSafe for CostReport
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