Exception: Legion::LLM::ModelNotAllowed

Inherits:
LLMError
  • Object
show all
Defined in:
lib/legion/llm/errors.rb

Overview

Raised when a request targets a model excluded by a provider’s configured model_whitelist / model_blacklist. This is a terminal policy outcome, not a provider failure: it is non-retryable (inherited) and must not be escalated, must not trip a circuit breaker, and must not deny-record the model — the escalation loop re-raises it immediately rather than trying the next model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LLMError

#retryable?

Constructor Details

#initialize(message = nil, provider: nil, model: nil) ⇒ ModelNotAllowed

Returns a new instance of ModelNotAllowed.



42
43
44
45
46
# File 'lib/legion/llm/errors.rb', line 42

def initialize(message = nil, provider: nil, model: nil)
  @provider = provider
  @model = model
  super(message || "model #{model.inspect} is not permitted by the configured policy for provider #{provider.inspect}")
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



40
41
42
# File 'lib/legion/llm/errors.rb', line 40

def model
  @model
end

#providerObject (readonly)

Returns the value of attribute provider.



40
41
42
# File 'lib/legion/llm/errors.rb', line 40

def provider
  @provider
end