pub struct ToolQuota {
pub max_calls: Option<u32>,
pub max_duration_us: Option<u64>,
pub max_result_bytes: Option<usize>,
}Expand description
Per-tool quota (v0.3 M3).
Limits imposed on a specific tool for the duration of a single
Agent::step invocation. Counters reset at the start of each step.
All fields are optional — unset means unlimited.
§Example
ⓘ
use agnt_core::agent::ToolQuota;
let mut agent = AgentBuilder::new(backend).build()?;
agent.tool_quotas.insert(
"shell".to_string(),
ToolQuota {
max_calls: Some(3),
max_duration_us: Some(5_000_000), // 5s total shell time
max_result_bytes: Some(16 * 1024),
},
);Fields§
§max_calls: Option<u32>Maximum number of times this tool may be called during one step.
None means unlimited.
max_duration_us: Option<u64>Total wall-clock time across all calls to this tool during one step,
in microseconds. None means unlimited.
max_result_bytes: Option<usize>Maximum raw bytes of output per individual call. Enforced AFTER the
tool runs but BEFORE envelope framing. None means use the
agent-wide Agent::max_tool_result_bytes default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolQuota
impl RefUnwindSafe for ToolQuota
impl Send for ToolQuota
impl Sync for ToolQuota
impl Unpin for ToolQuota
impl UnsafeUnpin for ToolQuota
impl UnwindSafe for ToolQuota
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