Thinking Usage • Rust AI Agent SDK

ThinkingUsage: Usage statistics for a single thinking session.

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

rust
fn tokens_remaining(&self) -> usize

Get remaining token budget.

time_remaining

rust
fn time_remaining(&self) -> Option<f64>

Get remaining time budget.

token_utilization

rust
fn token_utilization(&self) -> f64

Get token utilization percentage.

is_over_budget

rust
fn is_over_budget(&self) -> bool

Check if over token budget.

is_over_time

rust
fn is_over_time(&self) -> bool

Check if over time budget.

to_map

rust
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


Related Documentation