pub struct ToolManager { /* private fields */ }
Expand description
Tool manager for registering and executing tools
Implementations§
Source§impl ToolManager
impl ToolManager
Sourcepub fn register_tool(
&self,
tool: Tool,
handler: impl Fn(Value) -> Result<ToolCallResult> + Send + Sync + 'static,
)
pub fn register_tool( &self, tool: Tool, handler: impl Fn(Value) -> Result<ToolCallResult> + Send + Sync + 'static, )
Register a new tool
Sourcepub async fn list_tools(&self) -> Vec<Tool>
pub async fn list_tools(&self) -> Vec<Tool>
Get all registered tools
Sourcepub async fn execute_tool(
&self,
name: &str,
arguments: Value,
) -> Result<ToolCallResult>
pub async fn execute_tool( &self, name: &str, arguments: Value, ) -> Result<ToolCallResult>
Execute a tool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolManager
impl !RefUnwindSafe for ToolManager
impl Send for ToolManager
impl Sync for ToolManager
impl Unpin for ToolManager
impl !UnwindSafe for ToolManager
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