pub struct BashTool { /* private fields */ }Expand description
Tool for executing shell commands.
Uses bash on Unix, cmd on Windows.
Implementations§
Source§impl BashTool
impl BashTool
Sourcepub fn with_default_timeout(self, timeout: Duration) -> Self
pub fn with_default_timeout(self, timeout: Duration) -> Self
Sets the default timeout for commands.
This timeout is used when timeout_ms is not provided in the tool arguments.
Sourcepub fn with_default_workdir(self, workdir: impl Into<PathBuf>) -> Self
pub fn with_default_workdir(self, workdir: impl Into<PathBuf>) -> Self
Sets the default working directory.
This directory is used when workdir is not provided in the tool arguments.
Trait Implementations§
Source§impl<Deps: Send + Sync> Tool<Deps> for BashTool
impl<Deps: Send + Sync> Tool<Deps> for BashTool
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Get the tool’s definition. Read more
Source§fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with given arguments. Read more
Source§fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Prepare the tool definition at runtime. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Get the tool description.
Auto Trait Implementations§
impl Freeze for BashTool
impl RefUnwindSafe for BashTool
impl Send for BashTool
impl Sync for BashTool
impl Unpin for BashTool
impl UnwindSafe for BashTool
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