Class: Aireview::LlmRouter::Route

Inherits:
Struct
  • Object
show all
Defined in:
lib/aireview/llm_router.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#candidate ⇒ Object

Returns the value of attribute candidate

Returns:

  • (Object) —

    the current value of candidate



16
17
18
# File 'lib/aireview/llm_router.rb', line 16

def candidate
  @candidate
end

#candidate_index ⇒ Object

Returns the value of attribute candidate_index

Returns:

  • (Object) —

    the current value of candidate_index



16
17
18
# File 'lib/aireview/llm_router.rb', line 16

def candidate_index
  @candidate_index
end

#key ⇒ Object

Returns the value of attribute key

Returns:

  • (Object) —

    the current value of key



16
17
18
# File 'lib/aireview/llm_router.rb', line 16

def key
  @key
end

#key_count ⇒ Object

Returns the value of attribute key_count

Returns:

  • (Object) —

    the current value of key_count



16
17
18
# File 'lib/aireview/llm_router.rb', line 16

def key_count
  @key_count
end

#key_index ⇒ Object

Returns the value of attribute key_index

Returns:

  • (Object) —

    the current value of key_index



16
17
18
# File 'lib/aireview/llm_router.rb', line 16

def key_index
  @key_index
end

Instance Method Details

#fallback? ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/aireview/llm_router.rb', line 17

def fallback?
  candidate_index.positive?
end

#to_s ⇒ Object



21
22
23
# File 'lib/aireview/llm_router.rb', line 21

def to_s
  key_count > 1 ? "#{candidate} (key #{key_index + 1}/#{key_count})" : candidate.to_s
end