Class: Legion::LLM::Router::OutcomeClassifier::GlobalTransition

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/llm/router/outcome_classifier.rb

Overview

Immutable global-availability transition. The only accepted kind is :instance_unavailable; identity/token/reason come from the AttemptContext and normalized outcome.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_key:, publisher_token_id:, reason:, kind: :instance_unavailable) ⇒ GlobalTransition

Returns a new instance of GlobalTransition.

Raises:

  • (ArgumentError)


18
19
20
21
22
23
24
25
26
# File 'lib/legion/llm/router/outcome_classifier.rb', line 18

def initialize(instance_key:, publisher_token_id:, reason:, kind: :instance_unavailable)
  raise ArgumentError, "unsupported global transition kind: #{kind.inspect}" unless kind == :instance_unavailable

  @kind = kind
  @instance_key = instance_key
  @publisher_token_id = publisher_token_id
  @reason = reason
  freeze
end

Instance Attribute Details

#instance_keyObject (readonly)

Returns the value of attribute instance_key.



16
17
18
# File 'lib/legion/llm/router/outcome_classifier.rb', line 16

def instance_key
  @instance_key
end

#kindObject (readonly)

Returns the value of attribute kind.



16
17
18
# File 'lib/legion/llm/router/outcome_classifier.rb', line 16

def kind
  @kind
end

#publisher_token_idObject (readonly)

Returns the value of attribute publisher_token_id.



16
17
18
# File 'lib/legion/llm/router/outcome_classifier.rb', line 16

def publisher_token_id
  @publisher_token_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



16
17
18
# File 'lib/legion/llm/router/outcome_classifier.rb', line 16

def reason
  @reason
end