#[non_exhaustive]pub enum ToolDecision {
Allow,
Deny(String),
Rewrite(Value),
Ask(ApprovalRequest),
Abort(String),
}Expand description
What Hooks::before_tool decides for a tool 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.
Allow
Run the call as the model made it.
Deny(String)
Do not run it; the model reads reason as the call’s result.
Rewrite(Value)
Run it with these arguments instead.
Ask(ApprovalRequest)
Run it if the agent’s Approver
approves request; a denial reaches the model like
Deny. Without an approver the run fails.
Abort(String)
End the run with this reason as its error.
Trait Implementations§
Source§impl Clone for ToolDecision
impl Clone for ToolDecision
Auto Trait Implementations§
impl Forget for ToolDecision
impl Freeze for ToolDecision
impl Move 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