pub struct ChatCostSummary {
pub total_messages: i64,
pub assistant_messages: i64,
pub total_tokens: i64,
pub total_input_tokens: i64,
pub total_output_tokens: i64,
pub total_cost_usd: f64,
pub by_model: Vec<(String, i64, i64, f64)>,
pub primary_model: Option<String>,
pub primary_agent: Option<String>,
}Expand description
Cost summary for a chat session.
Fields§
§total_messages: i64Total number of messages (user + assistant)
assistant_messages: i64Total number of assistant messages (responses from LLM)
total_tokens: i64Total tokens used across all messages
total_input_tokens: i64Input tokens from assistant messages.
total_output_tokens: i64Output tokens from assistant messages.
total_cost_usd: f64Total estimated cost in USD
by_model: Vec<(String, i64, i64, f64)>Breakdown by model (model name -> (message_count, tokens, cost))
primary_model: Option<String>The most frequently used model
primary_agent: Option<String>The agent used (typically consistent per session)
Trait Implementations§
Source§impl Clone for ChatCostSummary
impl Clone for ChatCostSummary
Source§impl Debug for ChatCostSummary
impl Debug for ChatCostSummary
Auto Trait Implementations§
impl Freeze for ChatCostSummary
impl RefUnwindSafe for ChatCostSummary
impl Send for ChatCostSummary
impl Sync for ChatCostSummary
impl Unpin for ChatCostSummary
impl UnsafeUnpin for ChatCostSummary
impl UnwindSafe for ChatCostSummary
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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