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.
460 461 462 |
# File 'lib/agent_harness/configuration.rb', line 460 def initialize @tools = {} end |
Instance Method Details
#fetch(name) ⇒ Object
472 473 474 475 476 |
# File 'lib/agent_harness/configuration.rb', line 472 def fetch(name) @tools.fetch(name.to_sym) do raise ConfigurationError, "Unknown tool: #{name}" end end |
#register(name, description: nil, **provider_mappings) ⇒ Object
464 465 466 467 468 469 470 |
# File 'lib/agent_harness/configuration.rb', line 464 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
478 479 480 |
# File 'lib/agent_harness/configuration.rb', line 478 def registered?(name) @tools.key?(name.to_sym) end |