Skip to main content

Module tool

Module tool 

Source
Expand description

Tool contract for LLM integration Tool trait and BashTool implementation

§Public Library Contract

The Tool trait is a public contract - breaking changes require a major version bump. See specs/009-tool-contract.md for the full specification.

§Architecture

  • Tool trait: Contract that all tools must implement
  • BashTool: Sandboxed bash interpreter implementing Tool
  • BashToolBuilder: Builder pattern for configuring BashTool

§Example

use bashkit::{BashTool, Tool, ToolRequest};

let mut tool = BashTool::default();

// Introspection
assert_eq!(tool.name(), "bashkit");
assert!(!tool.help().is_empty());

// Execution
let resp = tool.execute(ToolRequest {
    commands: "echo hello".to_string(),
}).await;
assert_eq!(resp.stdout, "hello\n");

Structs§

BashTool
Sandboxed bash interpreter implementing the Tool trait
BashToolBuilder
Builder for configuring BashTool
ToolRequest
Request to execute bash commands
ToolResponse
Response from executing a bash script
ToolStatus
Status update during tool execution

Constants§

VERSION
Library version from Cargo.toml

Traits§

Tool
Tool contract for LLM integration.