Class: Legion::Extensions::Llm::Inventory::Identity::InstanceKey
- Inherits:
-
Data
- Object
- Data
- Legion::Extensions::Llm::Inventory::Identity::InstanceKey
- Defined in:
- lib/legion/extensions/llm/inventory/identity.rb
Overview
A mandatory, immutable provider_family + instance_id pair. Provider family alone is never executable; two instances of the same provider are independent targets. See section 8.1.
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#provider_family ⇒ Object
readonly
Returns the value of attribute provider_family.
Instance Method Summary collapse
-
#initialize(provider_family:, instance_id:) ⇒ InstanceKey
constructor
A new instance of InstanceKey.
Constructor Details
#initialize(provider_family:, instance_id:) ⇒ InstanceKey
Returns a new instance of InstanceKey.
105 106 107 108 109 110 111 112 113 |
# File 'lib/legion/extensions/llm/inventory/identity.rb', line 105 def initialize(provider_family:, instance_id:) family = Identity.normalize_text(value: provider_family, field: :provider_family).downcase raise Errors::ValidationError, 'provider_family must match /\A[a-z][a-z0-9_]*\z/' unless family.match?(/\A[a-z][a-z0-9_]*\z/) instance = Identity.normalize_text(value: instance_id, field: :instance_id) raise Errors::ValidationError, 'instance_id must not be the reserved value "default"' if instance == 'default' super(provider_family: family.to_sym, instance_id: instance) end |
Instance Attribute Details
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id
104 105 106 |
# File 'lib/legion/extensions/llm/inventory/identity.rb', line 104 def instance_id @instance_id end |
#provider_family ⇒ Object (readonly)
Returns the value of attribute provider_family
104 105 106 |
# File 'lib/legion/extensions/llm/inventory/identity.rb', line 104 def provider_family @provider_family end |