#[non_exhaustive]pub enum BudgetError {
Show 15 variants
AgentExhausted {
agent_id: String,
spent: f64,
limit: f64,
},
TaskExhausted {
task_id: String,
spent: f64,
limit: f64,
},
SessionExhausted {
session_id: String,
spent: f64,
limit: f64,
},
FleetExhausted {
spent: f64,
limit: f64,
},
KillSwitchActivated {
agent_id: String,
reason: String,
},
ModelDowngraded {
from: ModelTier,
to: ModelTier,
remaining: f64,
},
NoFallbackAvailable {
from: ModelTier,
},
AllocationFailed {
agent_id: String,
requested: f64,
available: f64,
},
ReallocationFailed {
from: String,
to: String,
amount: f64,
available: f64,
},
UnknownAgent(String),
PersistenceError(String),
InvalidConfig(String),
UnknownModel(String),
RateLimited {
retry_after_ms: u64,
},
Tokenizer(String),
}Expand description
Every error this crate returns.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AgentExhausted
The agent has exhausted its per-agent spend limit.
TaskExhausted
A task-scoped budget envelope has been depleted.
SessionExhausted
A session-scoped budget envelope has been depleted.
FleetExhausted
The fleet-wide budget cap has been reached.
KillSwitchActivated
The kill switch was triggered; execution must halt.
ModelDowngraded
A model downgrade was required due to budget pressure.
Fields
NoFallbackAvailable
No lower-cost model is available for downgrade.
AllocationFailed
Budget allocation failed: requested amount exceeds available fleet budget.
Fields
ReallocationFailed
Reallocation failed because the source agent has insufficient budget.
Fields
UnknownAgent(String)
Agent ID not found in the fleet registry.
PersistenceError(String)
Persistence I/O failure.
InvalidConfig(String)
Invalid configuration (e.g. negative limit).
UnknownModel(String)
The model is not in the price table, so its cost cannot be computed.
RateLimited
A tokens-per-minute or requests-per-minute limit would be crossed
(feature ratelimit).
Tokenizer(String)
The tokenizer could not be loaded or used (feature tokens).
Trait Implementations§
Source§impl Clone for BudgetError
impl Clone for BudgetError
Source§impl Debug for BudgetError
impl Debug for BudgetError
Source§impl Display for BudgetError
impl Display for BudgetError
Source§impl Error for BudgetError
impl Error for BudgetError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()