pub struct ToolRegistry { /* private fields */ }Expand description
Tool registry for storing and managing multiple tool instances.
Provides name-based lookup and execution functionality.
§Example
ⓘ
use langchainrust::ToolRegistry;
use langchainrust::Calculator;
use std::sync::Arc;
let registry = ToolRegistry::new();
registry.register(Arc::new(Calculator::new()));
let tool = registry.get("calculator").unwrap();Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
Returns all tool names.
Sourcepub fn describe_tools(&self) -> String
pub fn describe_tools(&self) -> String
Generates tool description for LLM.
Used to show available tools to the LLM.
Trait Implementations§
Source§impl Debug for ToolRegistry
impl Debug for ToolRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ToolRegistry
impl !UnwindSafe for ToolRegistry
impl Freeze for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin 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