Exception: Legion::Extensions::Llm::ModelNotAllowedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/legion/extensions/llm/error.rb

Overview

Raised when a request targets a model excluded by the configured model_whitelist / model_blacklist. This is a compliance guard enforced at the provider dispatch boundary (the last line before the model API call), so a denied model can never be reached regardless of caller. Non-retryable: retrying the same denied model must never succeed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ModelNotAllowedError.



38
39
40
41
42
# File 'lib/legion/extensions/llm/error.rb', line 38

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

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



36
37
38
# File 'lib/legion/extensions/llm/error.rb', line 36

def model
  @model
end

#providerObject (readonly)

Returns the value of attribute provider.



36
37
38
# File 'lib/legion/extensions/llm/error.rb', line 36

def provider
  @provider
end