Skip to main content

ThinkingUsage

Defined in the thinking module.
Rust AI Agent SDK Usage statistics for a single thinking session.

Fields

NameTypeDescription
tokens_usedusizeTokens used in this session
time_secondsf64Time taken in seconds
budget_tokensusizeToken budget for this session
budget_timeOption<f64>Time budget for this session (optional)
complexityf64Task complexity (0.0 to 1.0)
started_atOption<Instant>When the session started
ended_atOption<Instant>When the session ended

Methods

tokens_remaining

fn tokens_remaining(&self) -> usize
Get remaining token budget.

time_remaining

fn time_remaining(&self) -> Option<f64>
Get remaining time budget.

token_utilization

fn token_utilization(&self) -> f64
Get token utilization percentage.

is_over_budget

fn is_over_budget(&self) -> bool
Check if over token budget.

is_over_time

fn is_over_time(&self) -> bool
Check if over time budget.

to_map

fn to_map(&self) -> HashMap<String, serde_json::Value>
Convert to HashMap for serialization.

Source

View on GitHub

praisonai/src/thinking/mod.rs at line 301