Trait ToolExecutor

Source
pub trait ToolExecutor: Send + Sync {
    // Required methods
    fn exec_cmd<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cmd: &'life1 Command,
    ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream_files<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Path,
        extensions: Option<Vec<String>>,
    ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A ToolExecutor provides an interface for agents to interact with a system in an isolated context.

When starting up an agent, it’s context expects an executor. For example, you might want your coding agent to work with a fresh, isolated set of files, separated from the rest of the system.

See swiftide-docker-executor for an executor that uses Docker. By default the executor is a local executor.

Additionally, the executor can be used stream files files for indexing.

Required Methods§

Source

fn exec_cmd<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Command, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a command in the executor

Source

fn stream_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, extensions: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stream files from the executor

Trait Implementations§

Source§

impl ToolExecutor for &dyn ToolExecutor

Source§

fn exec_cmd<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Command, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a command in the executor
Source§

fn stream_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, extensions: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stream files from the executor
Source§

impl ToolExecutor for Box<dyn ToolExecutor>

Source§

fn exec_cmd<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Command, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a command in the executor
Source§

fn stream_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, extensions: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stream files from the executor

Implementations on Foreign Types§

Source§

impl ToolExecutor for Box<dyn ToolExecutor>

Source§

fn exec_cmd<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Command, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn stream_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, extensions: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<T: ToolExecutor> ToolExecutor for &T

Source§

fn exec_cmd<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Command, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn stream_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, extensions: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<IndexingStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§