pub enum ModelErrorDecision {
Fail,
Retry {
after: Duration,
},
Recover {
response: ModelResponse,
},
Abort,
}Expand description
What an on_model_error hook decides about a failed model call.
Variants§
Fail
End the run with crate::RunStatus::ProviderFailed.
Retry
Wait, then run another turn. The transcript is untouched and
before_model runs again, so a hook can shrink the request or change
the model first. The wait stops on cancel and at the wall-clock
budget, and the retry counts as a turn: budgets bound the retries.
Recover
Carry on with this response as if the model had given it.
Fields
§
response: ModelResponseAbort
End the run, whatever any other hook asked for.
Trait Implementations§
Source§impl Clone for ModelErrorDecision
impl Clone for ModelErrorDecision
Source§fn clone(&self) -> ModelErrorDecision
fn clone(&self) -> ModelErrorDecision
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 ModelErrorDecision
impl Debug for ModelErrorDecision
Source§impl PartialEq for ModelErrorDecision
impl PartialEq for ModelErrorDecision
impl StructuralPartialEq for ModelErrorDecision
Auto Trait Implementations§
impl Forget for ModelErrorDecision
impl Freeze for ModelErrorDecision
impl Move for ModelErrorDecision
impl RefUnwindSafe for ModelErrorDecision
impl Send for ModelErrorDecision
impl Sync for ModelErrorDecision
impl Unpin for ModelErrorDecision
impl UnsafeUnpin for ModelErrorDecisionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ToolCall>: UnsafeUnpin,
impl UnwindSafe for ModelErrorDecision
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