pub struct LoopDetector { /* private fields */ }Expand description
Tracks agent outputs and detects repetitive loops.
Implementations§
Source§impl LoopDetector
impl LoopDetector
Sourcepub fn with_config(config: LoopConfig) -> Self
pub fn with_config(config: LoopConfig) -> Self
Create a new loop detector with custom config.
Sourcepub fn check(&mut self, output: &str) -> LoopStatus
pub fn check(&mut self, output: &str) -> LoopStatus
Check if the given output indicates a loop.
Sourcepub fn record_success(&mut self) -> bool
pub fn record_success(&mut self) -> bool
Record iteration success and return whether the agent should halt.
Sourcepub fn record_failure(&mut self) -> bool
pub fn record_failure(&mut self) -> bool
Record iteration failure and return whether the agent should halt.
Sourcepub fn config(&self) -> &LoopConfig
pub fn config(&self) -> &LoopConfig
Access current configuration.
Trait Implementations§
Source§impl Clone for LoopDetector
impl Clone for LoopDetector
Source§fn clone(&self) -> LoopDetector
fn clone(&self) -> LoopDetector
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 LoopDetector
impl Debug for LoopDetector
Auto Trait Implementations§
impl Freeze for LoopDetector
impl RefUnwindSafe for LoopDetector
impl Send for LoopDetector
impl Sync for LoopDetector
impl Unpin for LoopDetector
impl UnsafeUnpin for LoopDetector
impl UnwindSafe for LoopDetector
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