#[non_exhaustive]pub enum ToolDecision {
Continue,
Skip {
reason: String,
},
Terminate {
reason: String,
},
}Expand description
Decision returned from
ChatMiddleware::on_before_tool_call to optionally bypass or
abort a tool invocation.
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: execute the tool.
Skip
Skip execution. The engine synthesizes an is_error: true
crate::ToolResultContent carrying reason and feeds it
back to the model so the loop can continue. Use when a single
tool call should be denied (rate limit, policy violation) but
the run as a whole should keep going.
Fields
Terminate
Abort the run before executing this tool. The engine surfaces
the reason as crate::FinishReason::Aborted(reason) and
fires ChatMiddleware::on_run_finished; partial tool
results from earlier tool calls in the same step are preserved
in new_messages.
Auto Trait Implementations§
impl Freeze for ToolDecision
impl RefUnwindSafe for ToolDecision
impl Send for ToolDecision
impl Sync for ToolDecision
impl Unpin for ToolDecision
impl UnsafeUnpin for ToolDecision
impl UnwindSafe for ToolDecision
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