Class: RubyLLM::Agents::Transcriber::ReliabilityConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/agents/audio/transcriber.rb

Overview

Configuration class for reliability options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReliabilityConfig

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

#backoffObject



202
203
204
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202

def backoff
  @backoff
end

#fallback_models_listObject



202
203
204
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202

def fallback_models_list
  @fallback_models_list
end

#max_retriesObject



202
203
204
# File 'lib/ruby_llm/agents/audio/transcriber.rb', line 202

def max_retries
  @max_retries
end

#total_timeout_secondsObject



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_hObject



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