pub struct ToolExecutor { /* private fields */ }Implementations§
Source§impl ToolExecutor
impl ToolExecutor
pub fn new() -> Self
pub fn add_tool<T: ToolImplementation + 'static>(&mut self, tool: T)
pub fn add_tool_arc(&mut self, tool: Arc<dyn ToolImplementation>)
pub async fn has_tool(&self, name: &str) -> Result<bool>
pub fn get_all_tools(&self) -> Vec<Tool>
pub fn is_tool_auto_approved(&self, name: &str) -> bool
pub async fn remove_tool( &mut self, name: &str, ) -> Result<Option<Arc<dyn ToolImplementation>>>
pub async fn reset_tools(&mut self)
pub async fn execute_tool(&self, tool_call: &ToolCall) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl !UnwindSafe for ToolExecutor
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