pub struct PlanBudget {
pub max_steps: Option<u32>,
pub max_estimated_tokens: Option<u64>,
pub max_estimated_cost_usd: Option<f64>,
pub cost_per_token: f64,
}Expand description
Budget constraints that a serializable plan must satisfy before execution
begins. Used in TaskAgentConfig::plan_budget.
Fields§
§max_steps: Option<u32>Reject plans with more steps than this limit.
max_estimated_tokens: Option<u64>Reject plans whose total estimated tokens exceed this ceiling.
max_estimated_cost_usd: Option<f64>Reject plans whose estimated cost (USD) exceeds this ceiling.
cost_per_token: f64Cost per token used for the USD estimate. Default: 0.000003 ($3/M).
Implementations§
Source§impl PlanBudget
impl PlanBudget
Sourcepub fn with_max_steps(self, max: u32) -> Self
pub fn with_max_steps(self, max: u32) -> Self
Set the maximum allowed step count.
Sourcepub fn with_max_tokens(self, max: u64) -> Self
pub fn with_max_tokens(self, max: u64) -> Self
Set the maximum allowed estimated token count.
Sourcepub fn with_max_cost_usd(self, max: f64) -> Self
pub fn with_max_cost_usd(self, max: f64) -> Self
Set the maximum allowed estimated cost in USD.
Trait Implementations§
Source§impl Clone for PlanBudget
impl Clone for PlanBudget
Source§fn clone(&self) -> PlanBudget
fn clone(&self) -> PlanBudget
Returns a duplicate of the value. Read more
1.0.0 · 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 PlanBudget
impl Debug for PlanBudget
Source§impl Default for PlanBudget
impl Default for PlanBudget
Source§impl<'de> Deserialize<'de> for PlanBudget
impl<'de> Deserialize<'de> for PlanBudget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PlanBudget
impl RefUnwindSafe for PlanBudget
impl Send for PlanBudget
impl Sync for PlanBudget
impl Unpin for PlanBudget
impl UnsafeUnpin for PlanBudget
impl UnwindSafe for PlanBudget
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