Class: SwarmSDK::V3::Tools::Base
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- SwarmSDK::V3::Tools::Base
- Defined in:
- lib/swarm_sdk/v3/tools/base.rb
Overview
Base class for all V3 tools
Provides:
-
Declarative removability control
-
Common path resolution
-
Standard error formatting
Direct Known Subclasses
Bash, Clock, Edit, Glob, Grep, MessageTeammate, MessageUser, Read, SubTask, Think, Write
Class Method Summary collapse
-
.creation_requirements ⇒ Array<Symbol>
Declare what parameters this tool needs for instantiation.
Instance Method Summary collapse
-
#name ⇒ String
Derive a clean tool name from the unqualified class name.
Class Method Details
.creation_requirements ⇒ Array<Symbol>
Declare what parameters this tool needs for instantiation
Override in subclasses to declare constructor requirements. The Registry uses this to inject the right parameters.
26 27 28 |
# File 'lib/swarm_sdk/v3/tools/base.rb', line 26 def creation_requirements [] end |
Instance Method Details
#name ⇒ String
Derive a clean tool name from the unqualified class name
RubyLLM’s default converts ‘SwarmSDK::V3::Tools::Read` into `swarm_s_d_k–v3–tools–read`. This override returns just the final class name (e.g., `“Read”`), keeping tool names short and avoiding wasted tokens on every tool call round-trip.
43 44 45 |
# File 'lib/swarm_sdk/v3/tools/base.rb', line 43 def name self.class.name.split("::").last end |