#[non_exhaustive]pub enum HookAction {
Continue,
Terminate {
reason: String,
},
}Expand description
Decision returned from
ChatMiddleware::on_run_started to optionally short-circuit a
run before any provider call.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Continue
Default: let the run proceed.
Terminate
Abort the run before the first provider call. The engine
surfaces the reason as
crate::FinishReason::Aborted(reason) and still fires
ChatMiddleware::on_run_finished.
Auto Trait Implementations§
impl Freeze for HookAction
impl RefUnwindSafe for HookAction
impl Send for HookAction
impl Sync for HookAction
impl Unpin for HookAction
impl UnsafeUnpin for HookAction
impl UnwindSafe for HookAction
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