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.
396 397 398 |
# File 'lib/agent_harness/configuration.rb', line 396 def initialize @tools = {} end |
Instance Method Details
#fetch(name) ⇒ Object
408 409 410 411 412 |
# File 'lib/agent_harness/configuration.rb', line 408 def fetch(name) @tools.fetch(name.to_sym) do raise ConfigurationError, "Unknown tool: #{name}" end end |
#register(name, description: nil, **provider_mappings) ⇒ Object
400 401 402 403 404 405 406 |
# File 'lib/agent_harness/configuration.rb', line 400 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
414 415 416 |
# File 'lib/agent_harness/configuration.rb', line 414 def registered?(name) @tools.key?(name.to_sym) end |