pub struct ToolRegister { /* private fields */ }Implementations§
Source§impl ToolRegister
impl ToolRegister
pub fn new() -> Self
pub fn init<I: Iterator<Item = Box<dyn Tool>>>(tools: I) -> Self
pub fn len(&self) -> usize
pub fn get_tool(&self, name: &str) -> Option<&Box<dyn Tool>>
pub fn add_tool<T: Tool + 'static>(&mut self, tool: T)
pub fn add_tool_box(&mut self, tool: Box<dyn Tool>)
pub fn has_tool(&self, tool_name: &str) -> bool
Sourcepub async fn execute(
&self,
name: String,
arguments: Value,
) -> ToolResult<ToolCallResult>
pub async fn execute( &self, name: String, arguments: Value, ) -> ToolResult<ToolCallResult>
Return tool execute error if tool inner error
pub fn to_function_defines(&self) -> Vec<ToolDefinition>
pub fn add_tools<I: Iterator<Item = Box<dyn Tool>>>(&mut self, tools: I)
Auto Trait Implementations§
impl Freeze for ToolRegister
impl !RefUnwindSafe for ToolRegister
impl Send for ToolRegister
impl Sync for ToolRegister
impl Unpin for ToolRegister
impl UnsafeUnpin for ToolRegister
impl !UnwindSafe for ToolRegister
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