pub struct Tool {
pub name: String,
pub description: String,
pub input_schema: ToolInputSchema,
pub requires_approval: bool,
pub defer_loading: bool,
pub allowed_callers: Vec<ToolCaller>,
pub input_examples: Vec<Value>,
}Expand description
A tool that can be used by the AI agent
Fields§
§name: StringName of the tool
description: StringDescription of what the tool does
input_schema: ToolInputSchemaInput schema (JSON Schema)
requires_approval: boolWhether this tool requires user approval before execution
defer_loading: boolWhether this tool should be deferred from initial context loading.
allowed_callers: Vec<ToolCaller>Specifies which contexts can call this tool.
input_examples: Vec<Value>Example inputs that teach the AI proper parameter usage.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
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 Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl UnwindSafe for Tool
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