Class: AgentHarness::ToolRegistry
- Inherits:
-
Object
- Object
- AgentHarness::ToolRegistry
- Defined in:
- lib/agent_harness/configuration.rb
Overview
Registry for canonical tool definitions referenced by sub-agents.
Instance Method Summary collapse
- #fetch(name) ⇒ Object
-
#initialize ⇒ ToolRegistry
constructor
A new instance of ToolRegistry.
- #register(name, description: nil, **provider_mappings) ⇒ Object
- #registered?(name) ⇒ Boolean
Constructor Details
#initialize ⇒ ToolRegistry
Returns a new instance of ToolRegistry.
380 381 382 |
# File 'lib/agent_harness/configuration.rb', line 380 def initialize @tools = {} end |
Instance Method Details
#fetch(name) ⇒ Object
392 393 394 395 396 |
# File 'lib/agent_harness/configuration.rb', line 392 def fetch(name) @tools.fetch(name.to_sym) do raise ConfigurationError, "Unknown tool: #{name}" end end |
#register(name, description: nil, **provider_mappings) ⇒ Object
384 385 386 387 388 389 390 |
# File 'lib/agent_harness/configuration.rb', line 384 def register(name, description: nil, **provider_mappings) @tools[name.to_sym] = ToolDefinition.new( name: name, description: description, provider_mappings: provider_mappings ) end |
#registered?(name) ⇒ Boolean
398 399 400 |
# File 'lib/agent_harness/configuration.rb', line 398 def registered?(name) @tools.key?(name.to_sym) end |