pub struct ContextBudgetConfig {
pub l0: usize,
pub l1: usize,
pub l2: usize,
pub l3: usize,
pub channel_minimum: String,
pub soul_max_context_pct: f64,
}Fields§
§l0: usizeToken budget for L0 (trivial) complexity.
l1: usizeToken budget for L1 (low) complexity.
l2: usizeToken budget for L2 (moderate) complexity.
l3: usizeToken budget for L3 (high) complexity.
channel_minimum: StringMinimum complexity level for channel (non-web) messages.
soul_max_context_pct: f64Maximum percentage (0.0–1.0) of context budget the personality soul can consume. Values outside [0.05, 1.0] are clamped on validation.
Implementations§
Source§impl ContextBudgetConfig
impl ContextBudgetConfig
Sourcepub const MIN_BUDGET: usize = 512
pub const MIN_BUDGET: usize = 512
Minimum allowed token budget for any tier.
Sourcepub const MAX_BUDGET: usize = 2_000_000
pub const MAX_BUDGET: usize = 2_000_000
Maximum allowed token budget for any tier.
Sourcepub fn validate_and_clamp(&mut self)
pub fn validate_and_clamp(&mut self)
Clamp all tier budgets and soul_max_context_pct to safe ranges and
enforce that tiers are non-decreasing (l0 ≤ l1 ≤ l2 ≤ l3).
Sourcepub fn channel_minimum_level(&self) -> u8
pub fn channel_minimum_level(&self) -> u8
Parse channel_minimum string to a complexity level index (0–3).
Returns the level as a u8 so callers can compare with
ComplexityLevel variants without pulling in the agent crate.
Unrecognized values default to 1 (L1).
Sourcepub fn soul_token_cap(&self, total_budget: usize) -> usize
pub fn soul_token_cap(&self, total_budget: usize) -> usize
Return the maximum tokens the soul personality may consume given
total_budget. Returns 0 if total_budget is 0 to avoid
division-by-zero.
Trait Implementations§
Source§impl Clone for ContextBudgetConfig
impl Clone for ContextBudgetConfig
Source§fn clone(&self) -> ContextBudgetConfig
fn clone(&self) -> ContextBudgetConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more