Class: Legion::LLM::Router::Resolution
- Inherits:
-
Object
- Object
- Legion::LLM::Router::Resolution
- Defined in:
- lib/legion/llm/router/resolution.rb
Instance Attribute Summary collapse
-
#compress_level ⇒ Object
readonly
Returns the value of attribute compress_level.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Instance Method Summary collapse
- #cloud? ⇒ Boolean
- #fleet? ⇒ Boolean
-
#initialize(tier:, provider:, model:, rule: nil, metadata: {}, compress_level: 0) ⇒ Resolution
constructor
A new instance of Resolution.
- #local? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(tier:, provider:, model:, rule: nil, metadata: {}, compress_level: 0) ⇒ Resolution
Returns a new instance of Resolution.
9 10 11 12 13 14 15 16 |
# File 'lib/legion/llm/router/resolution.rb', line 9 def initialize(tier:, provider:, model:, rule: nil, metadata: {}, compress_level: 0) @tier = tier.to_sym @provider = provider.to_sym @model = model @rule = rule @metadata = @compress_level = compress_level.to_i end |
Instance Attribute Details
#compress_level ⇒ Object (readonly)
Returns the value of attribute compress_level.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def compress_level @compress_level end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def @metadata end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def model @model end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def provider @provider end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def rule @rule end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
7 8 9 |
# File 'lib/legion/llm/router/resolution.rb', line 7 def tier @tier end |
Instance Method Details
#cloud? ⇒ Boolean
26 27 28 |
# File 'lib/legion/llm/router/resolution.rb', line 26 def cloud? @tier == :cloud end |
#fleet? ⇒ Boolean
22 23 24 |
# File 'lib/legion/llm/router/resolution.rb', line 22 def fleet? @tier == :fleet end |
#local? ⇒ Boolean
18 19 20 |
# File 'lib/legion/llm/router/resolution.rb', line 18 def local? @tier == :local end |
#to_h ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/legion/llm/router/resolution.rb', line 30 def to_h { tier: @tier, provider: @provider, model: @model, rule: @rule, metadata: @metadata, compress_level: @compress_level } end |