pub enum DispatchAction {
Proceed,
Patch(EffectKind),
Deny(ErrorReport),
}Expand description
Dispatch-boundary action.
Variants§
Proceed
Dispatch as is.
Patch(EffectKind)
Dispatch this effect instead. A patch must keep the family; the stack rejects a family change as an internal error before later hooks observe it. Tool calls must also retain their target name; only their arguments may be patched.
Deny(ErrorReport)
Do not dispatch: the effect resolves failed with this report and
never reaches a handler. For a tool call a report of kind
Cancelled cancels the run; any other kind becomes the skipped
result the model sees. For a completion any report fails the turn.
Implementations§
Source§impl DispatchAction
impl DispatchAction
Sourcepub fn patch(kind: EffectKind) -> Self
pub fn patch(kind: EffectKind) -> Self
Dispatch this effect instead.
Sourcepub fn deny(report: ErrorReport) -> Self
pub fn deny(report: ErrorReport) -> Self
Deny with a report.
Sourcepub fn skip(reason: impl Into<String>) -> Self
pub fn skip(reason: impl Into<String>) -> Self
Deny a tool call so the model sees it as skipped with reason.
Sourcepub fn rewrite_tool_args(kind: &EffectKind, args: impl Into<Value>) -> Self
pub fn rewrite_tool_args(kind: &EffectKind, args: impl Into<Value>) -> Self
Patch a tool call’s arguments, keeping its name and context.
Proceed when kind is not a tool call.
Trait Implementations§
Source§impl Clone for DispatchAction
impl Clone for DispatchAction
Auto Trait Implementations§
impl Freeze for DispatchAction
impl RefUnwindSafe for DispatchAction
impl Send for DispatchAction
impl Sync for DispatchAction
impl Unpin for DispatchAction
impl UnsafeUnpin for DispatchAction
impl UnwindSafe for DispatchAction
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