Class: ActiveHarness::ModelConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/active_harness/agent.rb

Overview


Internal helper — collects the ‘use` + `fallback` entries inside a `model` block.


Instance Method Summary collapse

Constructor Details

#initializeModelConfig

Returns a new instance of ModelConfig.



241
242
243
# File 'lib/active_harness/agent.rb', line 241

def initialize
  @config = { fallbacks: [] }
end

Instance Method Details

#fallback(provider:, model:) ⇒ Object



249
250
251
# File 'lib/active_harness/agent.rb', line 249

def fallback(provider:, model:)
  @config[:fallbacks] << { provider: provider, model: model }
end

#to_hObject



253
254
255
# File 'lib/active_harness/agent.rb', line 253

def to_h
  @config
end

#use(provider:, model:) ⇒ Object



245
246
247
# File 'lib/active_harness/agent.rb', line 245

def use(provider:, model:)
  @config[:use] = { provider: provider, model: model }
end