Class: RubyLLM::Agents::Transcriber::ReliabilityConfig
- Inherits:
-
Object
- Object
- RubyLLM::Agents::Transcriber::ReliabilityConfig
- Defined in:
- lib/ruby_llm/agents/audio/transcriber.rb
Overview
Configuration class for reliability options
Instance Attribute Summary collapse
- #backoff ⇒ Object
- #fallback_models_list ⇒ Object
- #max_retries ⇒ Object
- #total_timeout_seconds ⇒ Object
Instance Method Summary collapse
- #fallback_models(*models) ⇒ Object
-
#initialize ⇒ ReliabilityConfig
constructor
A new instance of ReliabilityConfig.
- #retries(max: 3, backoff: :exponential) ⇒ Object
- #to_h ⇒ Object
- #total_timeout(seconds) ⇒ Object
Constructor Details
#initialize ⇒ ReliabilityConfig
Returns a new instance of ReliabilityConfig.
204 205 206 207 208 209 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 204 def initialize @max_retries = 3 @backoff = :exponential @fallback_models_list = [] @total_timeout_seconds = nil end |
Instance Attribute Details
#backoff ⇒ Object
202 203 204 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202 def backoff @backoff end |
#fallback_models_list ⇒ Object
202 203 204 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202 def fallback_models_list @fallback_models_list end |
#max_retries ⇒ Object
202 203 204 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202 def max_retries @max_retries end |
#total_timeout_seconds ⇒ Object
202 203 204 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202 def total_timeout_seconds @total_timeout_seconds end |
Instance Method Details
#fallback_models(*models) ⇒ Object
216 217 218 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 216 def fallback_models(*models) @fallback_models_list = models.flatten end |
#retries(max: 3, backoff: :exponential) ⇒ Object
211 212 213 214 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 211 def retries(max: 3, backoff: :exponential) @max_retries = max @backoff = backoff end |
#to_h ⇒ Object
224 225 226 227 228 229 230 231 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 224 def to_h { max_retries: max_retries, backoff: backoff, fallback_models: fallback_models_list, total_timeout: total_timeout_seconds } end |
#total_timeout(seconds) ⇒ Object
220 221 222 |
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 220 def total_timeout(seconds) @total_timeout_seconds = seconds end |