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.



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

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#provider_mappingsObject (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_hObject



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