pub struct FunctionTool { /* private fields */ }Expand description
FunctionTool - wraps an async closure as a tool
Implementations§
Trait Implementations§
Source§impl Tool for FunctionTool
impl Tool for FunctionTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Tool description
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON schema for tool parameters
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with the given arguments
Source§fn requires_network(&self) -> bool
fn requires_network(&self) -> bool
Whether this tool requires network access.
Default is
true (conservative).
Override to false for local-only tools (e.g., file, calculator).Auto Trait Implementations§
impl Freeze for FunctionTool
impl !RefUnwindSafe for FunctionTool
impl Send for FunctionTool
impl Sync for FunctionTool
impl Unpin for FunctionTool
impl UnsafeUnpin for FunctionTool
impl !UnwindSafe for FunctionTool
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