Exception: Legion::LLM::ModelNotAllowed
- 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
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(message = nil, provider: nil, model: nil) ⇒ ModelNotAllowed
constructor
A new instance of ModelNotAllowed.
Methods inherited from LLMError
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( = nil, provider: nil, model: nil) @provider = provider @model = model super( || "model #{model.inspect} is not permitted by the configured policy for provider #{provider.inspect}") end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
40 41 42 |
# File 'lib/legion/llm/errors.rb', line 40 def model @model end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
40 41 42 |
# File 'lib/legion/llm/errors.rb', line 40 def provider @provider end |