pub struct ToolRegistry { /* private fields */ }Expand description
Registry of available tools.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn register(&mut self, tool: Arc<dyn Tool>)
pub fn register(&mut self, tool: Arc<dyn Tool>)
Register a tool, keyed by its name. Overwrites any existing tool with the same name.
Sourcepub fn to_openai_schema(&self) -> Value
pub fn to_openai_schema(&self) -> Value
Serialize all registered tools into an OpenAI-compatible function-calling schema.
Sourcepub fn tool_descriptions(&self) -> String
pub fn tool_descriptions(&self) -> String
Return a human-readable, sorted list of tool names and their descriptions.
Trait Implementations§
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