Ask a question to get started
Enter to sendā¢Shift+Enter new line
Stats accumulated over a single agent turn (or full session).
SessionStats( self, request_count: int = 0, input_tokens: int = 0, output_tokens: int
Total LLM API requests made.
Each chunk with usage_metadata counts as one completed request.
usage_metadata
Cumulative input tokens across all LLM requests.
Cumulative output tokens across all LLM requests.
Wall-clock duration from stream start to end.
Per-model breakdown keyed by (provider, model_name).
(provider, model_name)
Populated only when record_request receives a non-empty model_name. Empty dict means no named-model requests were recorded; print_usage_table omits the model table in that case and shows only the wall-time line (if applicable).
record_request
model_name
print_usage_table
Accumulate token counts for one completed LLM request.
Updates both the session totals and the per-model breakdown.
Merge another SessionStats into this one (mutates self).
SessionStats
Used to accumulate per-turn stats into a session-level total.