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