Token usage data for a single agent turn.
Tracks input/output token counts, cache statistics, and estimated cost.
Constructed by the provider after each turn completes, then accumulated
into the session's total via add/2.
Summary
Functions
Adds two usage records together, combining all counters.
Formats the usage as a short summary string for display.
Creates a new empty usage record.
Creates a usage record from the given values.
Types
@type t() :: %MingaAgent.TurnUsage{ cache_read: non_neg_integer(), cache_write: non_neg_integer(), cost: float(), input: non_neg_integer(), output: non_neg_integer() }
Per-turn token usage.
Functions
Adds two usage records together, combining all counters.
Used to accumulate per-turn usage into a session total.
Formats the usage as a short summary string for display.
@spec new() :: t()
Creates a new empty usage record.
@spec new( non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer(), float() ) :: t()
Creates a usage record from the given values.