Class: Legion::LLM::Routing::Rank::RankedLane

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/llm/routing/rank.rb

Overview

Immutable result of ranking one eligible lane: the lane plus the scalar ranking inputs that produced its effective weight and its rendezvous score.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lane:, weight_inputs:, base_weight:, preference_ppm:, effective_weight:, rendezvous_score:) ⇒ RankedLane

Returns a new instance of RankedLane.



35
36
37
38
39
40
41
42
43
44
# File 'lib/legion/llm/routing/rank.rb', line 35

def initialize(lane:, weight_inputs:, base_weight:, preference_ppm:,
               effective_weight:, rendezvous_score:, **)
  @lane             = lane
  @weight_inputs    = weight_inputs&.freeze
  @base_weight      = base_weight
  @preference_ppm   = preference_ppm
  @effective_weight = effective_weight
  @rendezvous_score = rendezvous_score
  freeze
end

Instance Attribute Details

#base_weightObject (readonly)

Returns the value of attribute base_weight.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def base_weight
  @base_weight
end

#effective_weightObject (readonly)

Returns the value of attribute effective_weight.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def effective_weight
  @effective_weight
end

#laneObject (readonly)

Returns the value of attribute lane.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def lane
  @lane
end

#preference_ppmObject (readonly)

Returns the value of attribute preference_ppm.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def preference_ppm
  @preference_ppm
end

#rendezvous_scoreObject (readonly)

Returns the value of attribute rendezvous_score.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def rendezvous_score
  @rendezvous_score
end

#weight_inputsObject (readonly)

Returns the value of attribute weight_inputs.



32
33
34
# File 'lib/legion/llm/routing/rank.rb', line 32

def weight_inputs
  @weight_inputs
end