Class: ActiveHarness::ModelConfig
- Inherits:
-
Object
- Object
- ActiveHarness::ModelConfig
- Defined in:
- lib/active_harness/agent.rb
Overview
Internal helper — collects the ‘use` + `fallback` entries inside a `model` block.
Instance Method Summary collapse
- #fallback(provider:, model:) ⇒ Object
-
#initialize ⇒ ModelConfig
constructor
A new instance of ModelConfig.
- #to_h ⇒ Object
- #use(provider:, model:) ⇒ Object
Constructor Details
#initialize ⇒ ModelConfig
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_h ⇒ Object
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 |