pub struct SelfHealingRetry {
pub max_attempts: u8,
pub attempts_used: u8,
}Expand description
Self-healing retry mechanism — re-prompts the LLM with error context after tool failures. Inspired by Unthinkclaw’s loop_runner self-healing (3 attempts).
Fields§
§max_attempts: u8§attempts_used: u8Implementations§
Source§impl SelfHealingRetry
impl SelfHealingRetry
pub fn new(max_attempts: u8) -> Self
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Returns true if more healing attempts are available.
Sourcepub fn build_healing_message(&mut self, errors: &[String]) -> String
pub fn build_healing_message(&mut self, errors: &[String]) -> String
Build the healing message to re-prompt the LLM. Increments attempts_used.
Trait Implementations§
Source§impl Clone for SelfHealingRetry
impl Clone for SelfHealingRetry
Source§fn clone(&self) -> SelfHealingRetry
fn clone(&self) -> SelfHealingRetry
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 SelfHealingRetry
impl Debug for SelfHealingRetry
Auto Trait Implementations§
impl Freeze for SelfHealingRetry
impl RefUnwindSafe for SelfHealingRetry
impl Send for SelfHealingRetry
impl Sync for SelfHealingRetry
impl Unpin for SelfHealingRetry
impl UnsafeUnpin for SelfHealingRetry
impl UnwindSafe for SelfHealingRetry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more