Class: Legion::Extensions::Llm::Inventory::OfferingRecord
- Inherits:
-
Data
- Object
- Data
- Legion::Extensions::Llm::Inventory::OfferingRecord
- Defined in:
- lib/legion/extensions/llm/inventory/records.rb
Overview
A registry-owned offering with canonical identity and captured callable. Only Inventory::Publisher/Registry constructs it. See section 10.2.
Instance Attribute Summary collapse
-
#callable_handle ⇒ Object
readonly
Returns the value of attribute callable_handle.
-
#capability_evidence ⇒ Object
readonly
Returns the value of attribute capability_evidence.
-
#context_evidence ⇒ Object
readonly
Returns the value of attribute context_evidence.
-
#embedding_dimensions_evidence ⇒ Object
readonly
Returns the value of attribute embedding_dimensions_evidence.
-
#instance_key ⇒ Object
readonly
Returns the value of attribute instance_key.
-
#max_output_evidence ⇒ Object
readonly
Returns the value of attribute max_output_evidence.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#model_revision_evidence ⇒ Object
readonly
Returns the value of attribute model_revision_evidence.
-
#offering_id ⇒ Object
readonly
Returns the value of attribute offering_id.
-
#operation_evidence ⇒ Object
readonly
Returns the value of attribute operation_evidence.
-
#provider_native_key ⇒ Object
readonly
Returns the value of attribute provider_native_key.
-
#publication_source ⇒ Object
readonly
Returns the value of attribute publication_source.
-
#quota_domains ⇒ Object
readonly
Returns the value of attribute quota_domains.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
-
#tokenizer_evidence ⇒ Object
readonly
Returns the value of attribute tokenizer_evidence.
Instance Method Summary collapse
- #capability_evidence_for(capability:) ⇒ Object
- #capability_status(capability:) ⇒ Object
-
#initialize(**kwargs) ⇒ OfferingRecord
constructor
A new instance of OfferingRecord.
- #operation_status(operation:) ⇒ Object
- #quota_domain(operation:) ⇒ Object
- #supported_operations ⇒ Object
- #unknown_operations ⇒ Object
- #unsupported_operations ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ OfferingRecord
Returns a new instance of OfferingRecord.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 281 def initialize(**kwargs) RecordSupport.check_unknown_kwargs!(kwargs: kwargs, members: self.class.members) instance_key = kwargs[:instance_key] callable_handle = kwargs[:callable_handle] raise Errors::ValidationError, 'instance_key must be an InstanceKey' unless instance_key.is_a?(Identity::InstanceKey) raise Errors::ValidationError, 'callable_handle must be a CallableHandle' unless callable_handle.is_a?(CallableHandle) native_key = Identity.normalize_text(value: kwargs[:provider_native_key], field: :provider_native_key) Identity.validate_offering_id!(value: kwargs[:offering_id], instance_key: instance_key, provider_native_key: native_key) super( offering_id: kwargs[:offering_id].dup.freeze, provider_native_key: native_key, instance_key: instance_key, model: Identity.normalize_text(value: kwargs[:model], field: :model), tier: Identity.normalize_enum(value: kwargs[:tier], field: :tier, allowed: Taxonomies::TIERS), operation_evidence: RecordSupport.validate_operation_evidence!(kwargs[:operation_evidence]), capability_evidence: RecordSupport.validate_capability_evidence!(kwargs[:capability_evidence]), quota_domains: RecordSupport.validate_quota_domains!(kwargs[:quota_domains]), metadata: RecordSupport.(value: kwargs[:metadata]), callable_handle: callable_handle, publication_source: RecordSupport.publication_source!(value: kwargs[:publication_source]), **RecordSupport.scalar_value_evidences(kwargs) ) end |
Instance Attribute Details
#callable_handle ⇒ Object (readonly)
Returns the value of attribute callable_handle
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def callable_handle @callable_handle end |
#capability_evidence ⇒ Object (readonly)
Returns the value of attribute capability_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def capability_evidence @capability_evidence end |
#context_evidence ⇒ Object (readonly)
Returns the value of attribute context_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def context_evidence @context_evidence end |
#embedding_dimensions_evidence ⇒ Object (readonly)
Returns the value of attribute embedding_dimensions_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def @embedding_dimensions_evidence end |
#instance_key ⇒ Object (readonly)
Returns the value of attribute instance_key
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def instance_key @instance_key end |
#max_output_evidence ⇒ Object (readonly)
Returns the value of attribute max_output_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def max_output_evidence @max_output_evidence end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def @metadata end |
#model ⇒ Object (readonly)
Returns the value of attribute model
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def model @model end |
#model_revision_evidence ⇒ Object (readonly)
Returns the value of attribute model_revision_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def model_revision_evidence @model_revision_evidence end |
#offering_id ⇒ Object (readonly)
Returns the value of attribute offering_id
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def offering_id @offering_id end |
#operation_evidence ⇒ Object (readonly)
Returns the value of attribute operation_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def operation_evidence @operation_evidence end |
#provider_native_key ⇒ Object (readonly)
Returns the value of attribute provider_native_key
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def provider_native_key @provider_native_key end |
#publication_source ⇒ Object (readonly)
Returns the value of attribute publication_source
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def publication_source @publication_source end |
#quota_domains ⇒ Object (readonly)
Returns the value of attribute quota_domains
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def quota_domains @quota_domains end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def tier @tier end |
#tokenizer_evidence ⇒ Object (readonly)
Returns the value of attribute tokenizer_evidence
275 276 277 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 275 def tokenizer_evidence @tokenizer_evidence end |
Instance Method Details
#capability_evidence_for(capability:) ⇒ Object
323 324 325 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 323 def capability_evidence_for(capability:) capability_evidence[Legion::Extensions::Llm::Capabilities.canonical(capability)] end |
#capability_status(capability:) ⇒ Object
327 328 329 330 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 327 def capability_status(capability:) evidence = capability_evidence_for(capability: capability) evidence.nil? ? :unknown : evidence.status end |
#operation_status(operation:) ⇒ Object
319 320 321 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 319 def operation_status(operation:) operation_evidence.fetch(Taxonomies.normalize_operation(value: operation, allow_aliases: false)).status end |
#quota_domain(operation:) ⇒ Object
332 333 334 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 332 def quota_domain(operation:) quota_domains[Taxonomies.normalize_operation(value: operation, allow_aliases: false)] end |
#supported_operations ⇒ Object
307 308 309 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 307 def supported_operations operation_evidence.select { |_op, evidence| evidence.supported? }.keys.sort end |
#unknown_operations ⇒ Object
315 316 317 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 315 def unknown_operations operation_evidence.select { |_op, evidence| evidence.unknown? }.keys.sort end |
#unsupported_operations ⇒ Object
311 312 313 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 311 def unsupported_operations operation_evidence.select { |_op, evidence| evidence.unsupported? }.keys.sort end |