pub enum ToolDecision {
Allow {
updated_input: Option<Value>,
updated_permissions: Option<Vec<Value>>,
},
Deny {
message: String,
interrupt: Option<bool>,
},
}Expand description
Answer to a can_use_tool request.
Source: binary can_use_tool response schema (behavior, updatedInput,
updatedPermissions, message, interrupt)
Variants§
Allow
updated_input: None → the original input is sent back unchanged.
updated_permissions: permission updates to apply, e.g. the
request’s permission_suggestions for “always allow”.
Deny
Implementations§
Source§impl ToolDecision
impl ToolDecision
pub fn allow() -> Self
Sourcepub fn allow_with_input(input: Value) -> Self
pub fn allow_with_input(input: Value) -> Self
Allow with a rewritten input.
Sourcepub fn allow_and_remember(updates: Vec<Value>) -> Self
pub fn allow_and_remember(updates: Vec<Value>) -> Self
Allow and apply permission updates, so the CLI stops asking (pass the
request’s permission_suggestions for “always allow”).
pub fn deny(message: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ToolDecision
impl Clone for ToolDecision
Source§impl Debug for ToolDecision
impl Debug for ToolDecision
Source§impl<'de> Deserialize<'de> for ToolDecision
impl<'de> Deserialize<'de> for ToolDecision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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