pub struct ToolExecutor { /* private fields */ }Expand description
Manages the execution of tools called by the AI model
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn with_workspace(workspace: Arc<dyn Workspace>) -> Self
pub fn with_workspace(workspace: Arc<dyn Workspace>) -> Self
Create a ToolExecutor with a workspace for workspace tools
Sourcepub fn with_components(
workspace: Arc<dyn Workspace>,
backend_registry: Arc<BackendRegistry>,
validators: Arc<ValidatorRegistry>,
) -> Self
pub fn with_components( workspace: Arc<dyn Workspace>, backend_registry: Arc<BackendRegistry>, validators: Arc<ValidatorRegistry>, ) -> Self
Create a ToolExecutor with custom components
Sourcepub fn with_all_components(
workspace: Arc<dyn Workspace>,
backend_registry: Arc<BackendRegistry>,
validators: Arc<ValidatorRegistry>,
llm_config_provider: LlmConfigProvider,
) -> Self
pub fn with_all_components( workspace: Arc<dyn Workspace>, backend_registry: Arc<BackendRegistry>, validators: Arc<ValidatorRegistry>, llm_config_provider: LlmConfigProvider, ) -> Self
Create a ToolExecutor with all components including LLM config provider
pub async fn requires_approval(&self, tool_name: &str) -> Result<bool>
pub async fn get_tool_schemas(&self) -> Vec<ToolSchema>
Sourcepub async fn supported_tools(&self) -> Vec<String>
pub async fn supported_tools(&self) -> Vec<String>
Get the list of supported tools
Sourcepub fn backend_registry(&self) -> &Arc<BackendRegistry>
pub fn backend_registry(&self) -> &Arc<BackendRegistry>
Get the backend registry
pub async fn execute_tool_with_cancellation( &self, tool_call: &ToolCall, token: CancellationToken, ) -> Result<ToolResult, ToolError>
Sourcepub async fn execute_tool_direct(
&self,
tool_call: &ToolCall,
token: CancellationToken,
) -> Result<ToolResult, ToolError>
pub async fn execute_tool_direct( &self, tool_call: &ToolCall, token: CancellationToken, ) -> Result<ToolResult, ToolError>
Execute a tool directly without validation - for user-initiated bash commands
Trait Implementations§
Source§impl Clone for ToolExecutor
impl Clone for ToolExecutor
Source§fn clone(&self) -> ToolExecutor
fn clone(&self) -> ToolExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request