pub struct BashTool {
pub working_dir: PathBuf,
pub max_output_chars: usize,
}Expand description
Execute shell commands.
Output is captured and truncated to a configurable maximum length, keeping the tail (so error messages at the end are preserved).
Fields§
§working_dir: PathBufWorking directory for commands. Defaults to current directory.
max_output_chars: usizeMaximum output length in characters.
Implementations§
Trait Implementations§
Source§impl Tool for BashTool
impl Tool for BashTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
One-line human-readable description shown to the model.
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema description of the parameters object.
Must be a valid JSON object schema, e.g.: Read more
Source§fn execute(&self, args: &Value) -> Result<ToolResult, AgentError>
fn execute(&self, args: &Value) -> Result<ToolResult, AgentError>
Execute the tool with the given JSON arguments.
Returns the tool output as a string (will be injected back into the
conversation as the tool result).
Source§fn requires_permission(&self) -> bool
fn requires_permission(&self) -> bool
Whether this tool requires user permission before execution.
Defaults to
true for safety.Source§fn is_dangerous(&self, args: &Value) -> bool
fn is_dangerous(&self, args: &Value) -> bool
Whether this tool is considered dangerous (shown as a warning).
Auto Trait Implementations§
impl Freeze for BashTool
impl RefUnwindSafe for BashTool
impl Send for BashTool
impl Sync for BashTool
impl Unpin for BashTool
impl UnsafeUnpin 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