pub enum ToolDecision {
Allow,
Modify(String),
RequireApproval,
Deny(String),
InjectContext(String),
}Expand description
The argument-aware dispatch-policy decision for one tool call (#67).
Returned by ToolExecutor::pre_dispatch — a decision document, not a
boolean: a policy can allow, gate, deny, or (from #539) transform a call.
Variants§
Allow
Execute the call as-is.
Modify(String)
Execute the call with these replacement arguments instead of the model’s.
The mutation + its signed record are wired in #539; treated as
Self::Allow until then.
RequireApproval
Route the call through the human-in-the-loop approval gate (equivalent to
the name-only needs_approval returning true).
Deny(String)
Block the call WITHOUT a human prompt; the carried reason is surfaced to the model as the tool result so it can adapt rather than stall.
InjectContext(String)
Prepend this context as an internal-only note before the call runs. The
injection + its signed record are wired in #539; treated as
Self::Allow until then.
Trait Implementations§
Source§impl Clone for ToolDecision
impl Clone for ToolDecision
Source§fn clone(&self) -> ToolDecision
fn clone(&self) -> ToolDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolDecision
impl Debug for ToolDecision
impl Eq for ToolDecision
Source§impl PartialEq for ToolDecision
impl PartialEq for ToolDecision
impl StructuralPartialEq for ToolDecision
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more