Exception: RubyLLM::Agents::Reliability::AllModelsExhaustedError

Inherits:
Error
  • Object
show all
Defined in:
lib/ruby_llm/agents/infrastructure/reliability.rb

Overview

Raised when all models in the fallback chain have been exhausted

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(models_tried, last_error, attempts: nil) ⇒ AllModelsExhaustedError

Returns a new instance of AllModelsExhaustedError.

Parameters:

  • models_tried (Array<String>)

    List of models that were attempted

  • last_error (Exception)

    The last error that occurred

  • attempts (Array<Hash>, nil) (defaults to: nil)

    Per-model attempt data from AttemptTracker



96
97
98
99
100
101
102
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 96

def initialize(models_tried, last_error, attempts: nil)
  @models_tried = models_tried
  @last_error = last_error
  @attempts = attempts
  @errors = build_errors
  super(build_message)
end

Instance Attribute Details

#attemptsObject (readonly)



91
92
93
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 91

def attempts
  @attempts
end

#errorsObject (readonly)



91
92
93
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 91

def errors
  @errors
end

#last_errorObject (readonly)



91
92
93
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 91

def last_error
  @last_error
end

#models_triedObject (readonly)



91
92
93
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 91

def models_tried
  @models_tried
end