pub struct ToolRegistry { /* private fields */ }Expand description
Thread-safe tool registry using Arc for efficient sharing
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn with_tools(tools: Vec<Arc<dyn Tool>>) -> Self
pub fn with_tools(tools: Vec<Arc<dyn Tool>>) -> Self
Create registry with pre-registered tools
Sourcepub fn list_tools(&self) -> Vec<String>
pub fn list_tools(&self) -> Vec<String>
List all registered tool names
Sourcepub fn list_by_capability(&self, capability: &str) -> Vec<Arc<dyn Tool>>
pub fn list_by_capability(&self, capability: &str) -> Vec<Arc<dyn Tool>>
List tools by capability
Sourcepub async fn execute(
&self,
tool_name: &str,
input: &str,
) -> RragResult<ToolResult>
pub async fn execute( &self, tool_name: &str, input: &str, ) -> RragResult<ToolResult>
Execute a tool by name
Sourcepub fn get_tool_schemas(&self) -> HashMap<String, Value>
pub fn get_tool_schemas(&self) -> HashMap<String, Value>
Get tool schemas for LLM context
Sourcepub fn get_tool_descriptions(&self) -> HashMap<String, String>
pub fn get_tool_descriptions(&self) -> HashMap<String, String>
Get tool descriptions for LLM context
Trait Implementations§
Source§impl Clone for ToolRegistry
impl Clone for ToolRegistry
Source§fn clone(&self) -> ToolRegistry
fn clone(&self) -> ToolRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ToolRegistry
impl !RefUnwindSafe for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl !UnwindSafe for ToolRegistry
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