pub struct Bash<G: ToolGate> {
gate: G,
}Expand description
Execute commands through a shell. The shell is non-interactive: there is no terminal and no stdin, so anything that would prompt (passwords, pagers, …) fails immediately instead of waiting.
The command runs asynchronously: awaiting execute does not block the runtime, and
dropping the future (e.g. when the tool call is interrupted) kills the child.
Fields§
§gate: GGate for receiving permissions to execute bash commands
Implementations§
Trait Implementations§
Source§impl<G: ToolGate> CallableTool for Bash<G>
impl<G: ToolGate> CallableTool for Bash<G>
Source§async fn execute(
&self,
_agent: &Agent,
params: BashParams,
) -> Result<BashResult>
async fn execute( &self, _agent: &Agent, params: BashParams, ) -> Result<BashResult>
Execute a tool call.
Source§impl<G: ToolGate> Tool for Bash<G>
impl<G: ToolGate> Tool for Bash<G>
Source§fn description(&self) -> Option<String>
fn description(&self) -> Option<String>
Tool description, if any
Source§fn execute_unparsed<'a>(
&'a self,
agent: &'a Agent,
arguments: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String>> + 'a>>
fn execute_unparsed<'a>( &'a self, agent: &'a Agent, arguments: &'a str, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'a>>
Execute this tool, arguments given in JSON format (unparsed)
Source§impl<G: ToolGate> ToolState for Bash<G>
impl<G: ToolGate> ToolState for Bash<G>
Source§type ParamType = BashParams
type ParamType = BashParams
Associated parameter type.
Source§type ResultType = BashResult
type ResultType = BashResult
Associated return type.
Auto Trait Implementations§
impl<G> Freeze for Bash<G>where
G: Freeze,
impl<G> RefUnwindSafe for Bash<G>where
G: RefUnwindSafe,
impl<G> Send for Bash<G>
impl<G> Sync for Bash<G>
impl<G> Unpin for Bash<G>where
G: Unpin,
impl<G> UnsafeUnpin for Bash<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for Bash<G>where
G: UnwindSafe,
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