pub enum ToolDecision {
Proceed,
Block(String),
Modify(Value),
}Expand description
Decision returned by ToolPolicy::before_call to control tool execution.
This extends the simple Ok/Err model with the ability to modify tool arguments before execution — enabling hooks that auto-inject flags, rewrite paths, or sanitize inputs without blocking the call.
Variants§
Proceed
Proceed with the original arguments.
Block(String)
Block the tool call entirely. The string is surfaced to the LLM as an error message so it can correct its approach.
Modify(Value)
Proceed, but replace the tool’s arguments with the provided value.
The tool executes as if the LLM had sent modified_args originally.
Trait Implementations§
Source§impl Clone for ToolDecision
impl Clone for ToolDecision
Source§fn clone(&self) -> ToolDecision
fn clone(&self) -> ToolDecision
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 moreAuto 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