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.
346 347 348 349 350 351 352 |
# File 'lib/agent_harness/configuration.rb', line 346 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.
344 345 346 |
# File 'lib/agent_harness/configuration.rb', line 344 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
344 345 346 |
# File 'lib/agent_harness/configuration.rb', line 344 def name @name end |
#provider_mappings ⇒ Object (readonly)
Returns the value of attribute provider_mappings.
344 345 346 |
# File 'lib/agent_harness/configuration.rb', line 344 def provider_mappings @provider_mappings end |
Instance Method Details
#mapping_for(provider) ⇒ Object
354 355 356 |
# File 'lib/agent_harness/configuration.rb', line 354 def mapping_for(provider) deep_dup(@provider_mappings[provider.to_sym]) end |
#to_h ⇒ Object
358 359 360 |
# File 'lib/agent_harness/configuration.rb', line 358 def to_h {name: @name, description: @description, provider_mappings: deep_dup(@provider_mappings)} end |