pub struct ToolSet { /* private fields */ }Implementations§
Source§impl ToolSet
impl ToolSet
pub fn new() -> Self
Sourcepub fn add<T: Tool + 'static>(&mut self, tool: T) -> &mut Self
pub fn add<T: Tool + 'static>(&mut self, tool: T) -> &mut Self
Register a tool. T::NAME is used as the lookup key.
Sourcepub fn definitions(&self) -> Vec<ToolDefinition>
pub fn definitions(&self) -> Vec<ToolDefinition>
Schema list to include in each CompletionRequest.
Sourcepub async fn call(&self, name: &str, args: Value) -> Result<Value, ToolError>
pub async fn call(&self, name: &str, args: Value) -> Result<Value, ToolError>
Dispatch a tool call by name.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ToolSet
impl !Send for ToolSet
impl !Sync for ToolSet
impl !UnwindSafe for ToolSet
impl Freeze for ToolSet
impl Unpin for ToolSet
impl UnsafeUnpin 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