Class: Legion::Extensions::Llm::Routing::AttemptTargetKey

Inherits:
Data
  • Object
show all
Defined in:
lib/legion/extensions/llm/routing/records.rb

Overview

The canonical request-local exclusion target: provider family, exact instance ID, and model. No operation, offering/lane ID, generation, tier, weight, or affinity. See section 15.1.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider_family:, instance_id:, model:) ⇒ AttemptTargetKey

Returns a new instance of AttemptTargetKey.



24
25
26
27
28
29
30
# File 'lib/legion/extensions/llm/routing/records.rb', line 24

def initialize(provider_family:, instance_id:, model:)
  key = Legion::Extensions::Llm::Inventory::Identity::InstanceKey.new(
    provider_family: provider_family, instance_id: instance_id
  )
  model_text = Legion::Extensions::Llm::Inventory::Identity.normalize_text(value: model, field: :model)
  super(provider_family: key.provider_family, instance_id: key.instance_id, model: model_text)
end

Instance Attribute Details

#instance_idObject (readonly)

Returns the value of attribute instance_id

Returns:

  • (Object)

    the current value of instance_id



23
24
25
# File 'lib/legion/extensions/llm/routing/records.rb', line 23

def instance_id
  @instance_id
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



23
24
25
# File 'lib/legion/extensions/llm/routing/records.rb', line 23

def model
  @model
end

#provider_familyObject (readonly)

Returns the value of attribute provider_family

Returns:

  • (Object)

    the current value of provider_family



23
24
25
# File 'lib/legion/extensions/llm/routing/records.rb', line 23

def provider_family
  @provider_family
end