pub struct BudgetConfig {
pub max_tool_calls: Option<usize>,
pub max_tokens: Option<usize>,
pub max_duration: Option<Duration>,
pub max_iterations: Option<usize>,
pub max_cost_usd: Option<f64>,
}Expand description
Hard budget for the agent control loop. A None field means that item is unlimited.
Fields§
§max_tool_calls: Option<usize>Cumulative tool-call cap (parallel calls included; stops when exceeded).
max_tokens: Option<usize>Cumulative LLM output-token cap (reads AgentMetrics.total_tokens; has no effect
when the agent does not report tokens).
max_duration: Option<Duration>Loop wall-clock cap (timed from run_agent_loop).
max_iterations: Option<usize>Iteration cap (tightens AgentExecutor::max_iterations; hitting it returns an error
instead of the placeholder return path used at the iteration limit).
max_cost_usd: Option<f64>Cumulative USD spend cap (read from the shared
lc_core::cost::CostTracker; has no effect when the executor carries no
cost tracker). Measured after each LLM call.
Trait Implementations§
Source§impl Clone for BudgetConfig
impl Clone for BudgetConfig
Source§fn clone(&self) -> BudgetConfig
fn clone(&self) -> BudgetConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BudgetConfig
impl Debug for BudgetConfig
Source§impl Default for BudgetConfig
impl Default for BudgetConfig
Source§fn default() -> BudgetConfig
fn default() -> BudgetConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BudgetConfig
impl RefUnwindSafe for BudgetConfig
impl Send for BudgetConfig
impl Sync for BudgetConfig
impl Unpin for BudgetConfig
impl UnsafeUnpin for BudgetConfig
impl UnwindSafe for BudgetConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more