Module: SkillBench::Tools

Defined in:
lib/skill_bench/tools.rb,
lib/skill_bench/tools/base.rb,
lib/skill_bench/tools/registry.rb,
lib/skill_bench/tools/read_file.rb,
lib/skill_bench/tools/dispatcher.rb,
lib/skill_bench/tools/write_file.rb,
lib/skill_bench/tools/run_command.rb,
lib/skill_bench/tools/argument_parser.rb

Overview

Contains tool implementations for the evaluator.

Defined Under Namespace

Classes: ArgumentParser, Base, Dispatcher, ReadFile, Registry, RunCommand, WriteFile

Class Method Summary collapse

Class Method Details

.definitionsArray<Hash>

Returns an array of tool definitions in the format expected by the LLM API.

Returns:

  • (Array<Hash>)

    The list of available tools with their names, descriptions, and schemas.



18
19
20
# File 'lib/skill_bench/tools.rb', line 18

def self.definitions
  Registry.definitions
end

.execute(name, arguments, working_dir, container_id = nil) ⇒ String

Executes a specified tool with the given arguments within a working directory.

Parameters:

  • name (String)

    The name of the tool to execute (e.g., ‘read_file’).

  • arguments (String)

    A JSON string containing the arguments for the tool.

  • working_dir (String)

    The base directory in which the tool should operate.

  • container_id (String, nil) (defaults to: nil)

    The Docker container ID for isolated execution.

Returns:

  • (String)

    The result of the tool execution, or an error message.



29
30
31
# File 'lib/skill_bench/tools.rb', line 29

def self.execute(name, arguments, working_dir, container_id = nil)
  Dispatcher.call(name, arguments, working_dir, container_id)
end