Class: RobotLab::To::Tools::FileTool
- Inherits:
-
RobotLab::Tool
- Object
- RobotLab::Tool
- RobotLab::To::Tools::FileTool
- Defined in:
- lib/robot_lab/to/tools/file_tool.rb
Overview
Base for robot_lab-to's built-in workspace tools. RubyLLM derives a fully-namespaced tool name (e.g. "robot_lab--to--tools--read"); small models do far better with the short, conventional names the guards and skill docs reference, so we expose the bare last segment ("read", "write", "edit", "bash", ...).
Class Method Summary collapse
-
.name_segment ⇒ String?
Subclasses may override the derived short name.
-
.short_name ⇒ String
Last class path segment, snake_cased.
Instance Method Summary collapse
-
#name ⇒ String
The short, lowercase tool name.
Class Method Details
.name_segment ⇒ String?
Subclasses may override the derived short name.
28 |
# File 'lib/robot_lab/to/tools/file_tool.rb', line 28 def self.name_segment = nil |
.short_name ⇒ String
Returns last class path segment, snake_cased.
18 19 20 21 22 23 24 |
# File 'lib/robot_lab/to/tools/file_tool.rb', line 18 def self.short_name name_segment || to_s.split("::").last .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .downcase end |
Instance Method Details
#name ⇒ String
Returns the short, lowercase tool name.
13 14 15 |
# File 'lib/robot_lab/to/tools/file_tool.rb', line 13 def name self.class.short_name end |