Class: AgentHarness::ToolDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_harness/configuration.rb

Overview

Provider-agnostic tool definition used during sub-agent translation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, description: nil, provider_mappings: {}) ⇒ ToolDefinition

Returns a new instance of ToolDefinition.



414
415
416
417
418
419
420
# File 'lib/agent_harness/configuration.rb', line 414

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

#descriptionObject (readonly)

Returns the value of attribute description.



412
413
414
# File 'lib/agent_harness/configuration.rb', line 412

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



412
413
414
# File 'lib/agent_harness/configuration.rb', line 412

def name
  @name
end

#provider_mappingsObject (readonly)

Returns the value of attribute provider_mappings.



412
413
414
# File 'lib/agent_harness/configuration.rb', line 412

def provider_mappings
  @provider_mappings
end

Instance Method Details

#mapping_for(provider) ⇒ Object



422
423
424
# File 'lib/agent_harness/configuration.rb', line 422

def mapping_for(provider)
  deep_dup(@provider_mappings[provider.to_sym])
end

#to_hObject



426
427
428
# File 'lib/agent_harness/configuration.rb', line 426

def to_h
  {name: @name, description: @description, provider_mappings: deep_dup(@provider_mappings)}
end