pub struct CircuitBreaker;Expand description
The denied-action circuit breaker.
When the model re-emits an action a human already denied, the turn loop
auto-denies it (a synthetic result, never executed) and republishes the “saw
a signature-matching denial” signal onto the ctx. This step counts each such
re-emit and, once the model has done it MAX_DENIAL_REPROMPTS times, reports
StepOutcome::Done so the turn ends cleanly with the last stop reason
instead of burning the rest of the step budget looping the same dead-end.
Trait Implementations§
Source§impl<P, T> TurnStep<P, T> for CircuitBreaker
impl<P, T> TurnStep<P, T> for CircuitBreaker
Source§fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut TurnCtx<'life2, P, T>,
) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut TurnCtx<'life2, P, T>,
) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run this step against the turn context. Read more
Auto Trait Implementations§
impl Freeze for CircuitBreaker
impl RefUnwindSafe for CircuitBreaker
impl Send for CircuitBreaker
impl Sync for CircuitBreaker
impl Unpin for CircuitBreaker
impl UnsafeUnpin for CircuitBreaker
impl UnwindSafe for CircuitBreaker
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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