pub struct ToolSet(pub Vec<Box<dyn Tool>>, pub ExecutionStrategy);
Tuple Fields§
§0: Vec<Box<dyn Tool>>
§1: ExecutionStrategy
Implementations§
Source§impl ToolSet
impl ToolSet
Sourcepub fn remove_tool(&mut self, name: &str) -> Result<(), ToolSetError>
pub fn remove_tool(&mut self, name: &str) -> Result<(), ToolSetError>
Sourcepub fn list_tools(&self) -> Vec<Box<dyn Tool>>
pub fn list_tools(&self) -> Vec<Box<dyn Tool>>
Get the tools from a toolset
Sourcepub async fn call(
&self,
id: &str,
name: &str,
args: &str,
states: &DashMap<TypeId, Box<dyn Any + Send + Sync>>,
) -> Result<ToolResponse, ToolSetError>
pub async fn call( &self, id: &str, name: &str, args: &str, states: &DashMap<TypeId, Box<dyn Any + Send + Sync>>, ) -> Result<ToolResponse, ToolSetError>
Executes a tool with the given arguments and state context.
§Arguments
id
: identifier for this tool callname
: The registered name of the tool to executeargs
: JSON-formatted string containing tool argumentsstates
: Shared application state available to all tools (thread-safe)
§Errors
- returns
ToolSetError
: If execution fails
Auto Trait Implementations§
impl Freeze for ToolSet
impl !RefUnwindSafe for ToolSet
impl Send for ToolSet
impl Sync for ToolSet
impl Unpin for ToolSet
impl !UnwindSafe for ToolSet
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