Class: AgentHarness::ToolDefinition
- Inherits:
-
Object
- Object
- AgentHarness::ToolDefinition
- Defined in:
- lib/agent_harness/configuration.rb
Overview
Provider-agnostic tool definition used during sub-agent translation.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#provider_mappings ⇒ Object
readonly
Returns the value of attribute provider_mappings.
Instance Method Summary collapse
-
#initialize(name:, description: nil, provider_mappings: {}) ⇒ ToolDefinition
constructor
A new instance of ToolDefinition.
- #mapping_for(provider) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(name:, description: nil, provider_mappings: {}) ⇒ ToolDefinition
Returns a new instance of ToolDefinition.
413 414 415 416 417 418 419 |
# File 'lib/agent_harness/configuration.rb', line 413 def initialize(name:, description: nil, provider_mappings: {}) @name = name.to_sym @description = description @provider_mappings = deep_dup(provider_mappings).each_with_object({}) do |(provider, value), mappings| mappings[provider.to_sym] = value end.freeze end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
411 412 413 |
# File 'lib/agent_harness/configuration.rb', line 411 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
411 412 413 |
# File 'lib/agent_harness/configuration.rb', line 411 def name @name end |
#provider_mappings ⇒ Object (readonly)
Returns the value of attribute provider_mappings.
411 412 413 |
# File 'lib/agent_harness/configuration.rb', line 411 def provider_mappings @provider_mappings end |
Instance Method Details
#mapping_for(provider) ⇒ Object
421 422 423 |
# File 'lib/agent_harness/configuration.rb', line 421 def mapping_for(provider) deep_dup(@provider_mappings[provider.to_sym]) end |
#to_h ⇒ Object
425 426 427 |
# File 'lib/agent_harness/configuration.rb', line 425 def to_h {name: @name, description: @description, provider_mappings: deep_dup(@provider_mappings)} end |