pub struct ToolRegistry<Ctx> { /* private fields */ }Expand description
Registry of available tools
Implementations§
Source§impl<Ctx> ToolRegistry<Ctx>
impl<Ctx> ToolRegistry<Ctx>
pub fn new() -> Self
Sourcepub fn register<T: Tool<Ctx> + 'static>(&mut self, tool: T) -> &mut Self
pub fn register<T: Tool<Ctx> + 'static>(&mut self, tool: T) -> &mut Self
Register a tool in the registry
Sourcepub fn register_boxed(&mut self, tool: Arc<dyn Tool<Ctx>>) -> &mut Self
pub fn register_boxed(&mut self, tool: Arc<dyn Tool<Ctx>>) -> &mut Self
Register a boxed tool
Sourcepub fn to_llm_tools(&self) -> Vec<Tool>
pub fn to_llm_tools(&self) -> Vec<Tool>
Convert tools to LLM tool definitions
Trait Implementations§
Source§impl<Ctx> Clone for ToolRegistry<Ctx>
impl<Ctx> Clone for ToolRegistry<Ctx>
Auto Trait Implementations§
impl<Ctx> Freeze for ToolRegistry<Ctx>
impl<Ctx> !RefUnwindSafe for ToolRegistry<Ctx>
impl<Ctx> Send for ToolRegistry<Ctx>
impl<Ctx> Sync for ToolRegistry<Ctx>
impl<Ctx> Unpin for ToolRegistry<Ctx>
impl<Ctx> !UnwindSafe for ToolRegistry<Ctx>
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