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.
447 448 449 |
# File 'lib/agent_harness/configuration.rb', line 447 def initialize @tools = {} end |
Instance Method Details
#fetch(name) ⇒ Object
459 460 461 462 463 |
# File 'lib/agent_harness/configuration.rb', line 459 def fetch(name) @tools.fetch(name.to_sym) do raise ConfigurationError, "Unknown tool: #{name}" end end |
#register(name, description: nil, **provider_mappings) ⇒ Object
451 452 453 454 455 456 457 |
# File 'lib/agent_harness/configuration.rb', line 451 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
465 466 467 |
# File 'lib/agent_harness/configuration.rb', line 465 def registered?(name) @tools.key?(name.to_sym) end |