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.



362
363
364
365
366
367
368
# File 'lib/agent_harness/configuration.rb', line 362

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.



360
361
362
# File 'lib/agent_harness/configuration.rb', line 360

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



360
361
362
# File 'lib/agent_harness/configuration.rb', line 360

def name
  @name
end

#provider_mappingsObject (readonly)

Returns the value of attribute provider_mappings.



360
361
362
# File 'lib/agent_harness/configuration.rb', line 360

def provider_mappings
  @provider_mappings
end

Instance Method Details

#mapping_for(provider) ⇒ Object



370
371
372
# File 'lib/agent_harness/configuration.rb', line 370

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

#to_hObject



374
375
376
# File 'lib/agent_harness/configuration.rb', line 374

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