Class: SkillBench::Tools::Dispatcher
- Inherits:
-
Object
- Object
- SkillBench::Tools::Dispatcher
- Defined in:
- lib/skill_bench/tools/dispatcher.rb
Overview
Dispatches tool execution based on the tool name, coordinating parsing and invocation.
Class Method Summary collapse
-
.call(name, arguments, working_dir, container_id = nil) ⇒ Object
Executes a specified tool with the given arguments within a working directory.
Class Method Details
.call(name, arguments, working_dir, container_id = nil) ⇒ Object
Executes a specified tool with the given arguments within a working directory.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/skill_bench/tools/dispatcher.rb', line 21 def self.call(name, arguments, working_dir, container_id = nil) args = ArgumentParser.call(arguments) return args if args.is_a?(Hash) && args[:success] == false working_dir_path = Pathname.new(working_dir). execute_tool(name, args, working_dir_path, container_id) rescue StandardError => e log_error(e) raise end |