pub struct ToolExecutor { /* private fields */ }
Expand description
High-level tool executor that coordinates tool execution.
The executor handles multiple tool calls, retry logic, error recovery, and provides higher-level abstractions for tool management.
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn new(registry: Arc<ToolRegistry>) -> Self
pub fn new(registry: Arc<ToolRegistry>) -> Self
Create a new tool executor with the given registry.
Sourcepub fn with_config(
registry: Arc<ToolRegistry>,
config: ToolExecutionConfig,
) -> Self
pub fn with_config( registry: Arc<ToolRegistry>, config: ToolExecutionConfig, ) -> Self
Create a new tool executor with custom configuration.
Sourcepub async fn execute_with_retry(
&self,
tool_use: &ToolUse,
) -> ToolOperationResult<ToolResult>
pub async fn execute_with_retry( &self, tool_use: &ToolUse, ) -> ToolOperationResult<ToolResult>
Sourcepub async fn execute_multiple(
&self,
tool_uses: &[ToolUse],
) -> Vec<ToolOperationResult<ToolResult>> ⓘ
pub async fn execute_multiple( &self, tool_uses: &[ToolUse], ) -> Vec<ToolOperationResult<ToolResult>> ⓘ
Sourcepub fn extract_tool_uses(&self, message: &Message) -> Vec<ToolUse>
pub fn extract_tool_uses(&self, message: &Message) -> Vec<ToolUse>
Sourcepub fn registry(&self) -> &Arc<ToolRegistry>
pub fn registry(&self) -> &Arc<ToolRegistry>
Get the underlying tool registry.
Sourcepub fn config(&self) -> &ToolExecutionConfig
pub fn config(&self) -> &ToolExecutionConfig
Get the current execution configuration.
Sourcepub fn set_config(&mut self, config: ToolExecutionConfig)
pub fn set_config(&mut self, config: ToolExecutionConfig)
Update the execution configuration.
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin 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