pub struct ToolCallingGuard {
pub max_iterations: u32,
pub timeout: Duration,
/* private fields */
}Expand description
Guard for tracking tool call processing limits and preventing infinite loops
Fields§
§max_iterations: u32Maximum number of iterations allowed in the tool calling loop
timeout: DurationTimeout duration for the entire tool calling loop
Implementations§
Source§impl ToolCallingGuard
impl ToolCallingGuard
Sourcepub fn with_limits(max_iterations: u32, timeout: Duration) -> Self
pub fn with_limits(max_iterations: u32, timeout: Duration) -> Self
Create a new ToolCallingGuard with custom limits
Sourcepub fn from_config(config: &ToolCallingConfig) -> Self
pub fn from_config(config: &ToolCallingConfig) -> Self
Create a new ToolCallingGuard from a config
Sourcepub fn increment_iteration(&mut self) -> Result<(), LlmError>
pub fn increment_iteration(&mut self) -> Result<(), LlmError>
Increment iteration count and check if limit is exceeded
Sourcepub fn current_iteration(&self) -> u32
pub fn current_iteration(&self) -> u32
Get current iteration count
Trait Implementations§
Source§impl Clone for ToolCallingGuard
impl Clone for ToolCallingGuard
Source§fn clone(&self) -> ToolCallingGuard
fn clone(&self) -> ToolCallingGuard
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 ToolCallingGuard
impl Debug for ToolCallingGuard
Auto Trait Implementations§
impl Freeze for ToolCallingGuard
impl RefUnwindSafe for ToolCallingGuard
impl Send for ToolCallingGuard
impl Sync for ToolCallingGuard
impl Unpin for ToolCallingGuard
impl UnwindSafe for ToolCallingGuard
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