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§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