Class: Legion::LLM::Routing::Outcome::GlobalTransition

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/llm/routing/outcome.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)


23
24
25
26
27
28
29
30
31
# File 'lib/legion/llm/routing/outcome.rb', line 23

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.



21
22
23
# File 'lib/legion/llm/routing/outcome.rb', line 21

def instance_key
  @instance_key
end

#kindObject (readonly)

Returns the value of attribute kind.



21
22
23
# File 'lib/legion/llm/routing/outcome.rb', line 21

def kind
  @kind
end

#publisher_token_idObject (readonly)

Returns the value of attribute publisher_token_id.



21
22
23
# File 'lib/legion/llm/routing/outcome.rb', line 21

def publisher_token_id
  @publisher_token_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



21
22
23
# File 'lib/legion/llm/routing/outcome.rb', line 21

def reason
  @reason
end