pub struct Budgets {
pub max_cycles: u32,
pub max_agents_per_cycle: Option<u32>,
pub max_facts: u32,
pub time_limit: Option<Duration>,
pub max_tokens: Option<u64>,
}Expand description
Execution budgets that guarantee termination.
Fields§
§max_cycles: u32Maximum execution cycles.
max_agents_per_cycle: Option<u32>Maximum agents that can run per cycle.
max_facts: u32Maximum total facts in context.
time_limit: Option<Duration>Time limit for the entire job.
max_tokens: Option<u64>Maximum LLM tokens to consume.
Implementations§
Source§impl Budgets
impl Budgets
Sourcepub fn with_max_cycles(self, max: u32) -> Self
pub fn with_max_cycles(self, max: u32) -> Self
Creates budgets with custom cycle limit.
Sourcepub fn with_max_facts(self, max: u32) -> Self
pub fn with_max_facts(self, max: u32) -> Self
Creates budgets with custom fact limit.
Sourcepub fn with_time_limit(self, limit: Duration) -> Self
pub fn with_time_limit(self, limit: Duration) -> Self
Sets a time limit.
Sourcepub fn with_max_tokens(self, max: u64) -> Self
pub fn with_max_tokens(self, max: u64) -> Self
Sets a token limit.
Sourcepub fn to_engine_budget(&self) -> Budget
pub fn to_engine_budget(&self) -> Budget
Converts to engine Budget.
Trait Implementations§
impl Eq for Budgets
impl StructuralPartialEq for Budgets
Auto Trait Implementations§
impl Freeze for Budgets
impl RefUnwindSafe for Budgets
impl Send for Budgets
impl Sync for Budgets
impl Unpin for Budgets
impl UnwindSafe for Budgets
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