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
| Name | Type | Description |
|---|---|---|
tokens_used | usize | Tokens used in this session |
time_seconds | f64 | Time taken in seconds |
budget_tokens | usize | Token budget for this session |
budget_time | Option<f64> | Time budget for this session (optional) |
complexity | f64 | Task complexity (0.0 to 1.0) |
started_at | Option<Instant> | When the session started |
ended_at | Option<Instant> | When the session ended |
Methods
tokens_remaining
fn tokens_remaining(&self) -> usizeGet remaining token budget.
time_remaining
fn time_remaining(&self) -> Option<f64>Get remaining time budget.
token_utilization
fn token_utilization(&self) -> f64Get token utilization percentage.
is_over_budget
fn is_over_budget(&self) -> boolCheck if over token budget.
is_over_time
fn is_over_time(&self) -> boolCheck if over time budget.
to_map
fn to_map(&self) -> HashMap<String, serde_json::Value>Convert to HashMap for serialization.
Source
View on GitHubpraisonai/src/thinking/mod.rs at line 301