pub struct ToolExecutor { /* private fields */ }Expand description
工具执行器 — 按名称分派 ToolCall 到实际工具函数。
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
pub fn new() -> Self
pub fn register(&mut self, name: &str, reg: ToolRegistration)
pub fn safety_for(&self, name: &str) -> ParallelSafety
pub async fn execute(&self, call: &ToolCall) -> ToolCallResult
pub async fn execute_batch(&self, calls: &[ToolCall]) -> Vec<Message>
Trait Implementations§
Source§impl Default for ToolExecutor
impl Default for ToolExecutor
Source§fn default() -> ToolExecutor
fn default() -> ToolExecutor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnsafeUnpin for ToolExecutor
impl !UnwindSafe for ToolExecutor
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