Class: Legion::Extensions::Llm::Inventory::OfferingDraft

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

Overview

An off-registry provider draft of one offering. Carries the validated write-time weight pair, but no provider family, instance ID, offering ID, lane ID, callable, health, or default model. See section 10.1.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ OfferingDraft

Returns a new instance of OfferingDraft.



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/legion/extensions/llm/inventory/records.rb', line 292

def initialize(**kwargs)
  kwargs = { capability_evidence: {}, quota_domains: {}, metadata: {} }.merge(kwargs)
  RecordSupport.check_unknown_kwargs!(kwargs: kwargs, members: self.class.members)
  weight_inputs, base_weight = RecordSupport.validated_weight_pair(
    weight_inputs: kwargs[:weight_inputs], base_weight: kwargs[:base_weight]
  )

  super(
    provider_native_key: Identity.normalize_text(value: kwargs[:provider_native_key], field: :provider_native_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]),
    publication_source: RecordSupport.publication_source!(value: kwargs[:publication_source]),
    weight_inputs: weight_inputs,
    base_weight: base_weight,
    **RecordSupport.scalar_value_evidences(kwargs)
  )
end

Instance Attribute Details

#base_weightObject (readonly)

Returns the value of attribute base_weight

Returns:

  • (Object)

    the current value of base_weight



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def base_weight
  @base_weight
end

#capability_evidenceObject (readonly)

Returns the value of attribute capability_evidence

Returns:

  • (Object)

    the current value of capability_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def capability_evidence
  @capability_evidence
end

#context_evidenceObject (readonly)

Returns the value of attribute context_evidence

Returns:

  • (Object)

    the current value of context_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def context_evidence
  @context_evidence
end

#embedding_dimensions_evidenceObject (readonly)

Returns the value of attribute embedding_dimensions_evidence

Returns:

  • (Object)

    the current value of embedding_dimensions_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def embedding_dimensions_evidence
  @embedding_dimensions_evidence
end

#max_output_evidenceObject (readonly)

Returns the value of attribute max_output_evidence

Returns:

  • (Object)

    the current value of max_output_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def max_output_evidence
  @max_output_evidence
end

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def 
  @metadata
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def model
  @model
end

#model_revision_evidenceObject (readonly)

Returns the value of attribute model_revision_evidence

Returns:

  • (Object)

    the current value of model_revision_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def model_revision_evidence
  @model_revision_evidence
end

#operation_evidenceObject (readonly)

Returns the value of attribute operation_evidence

Returns:

  • (Object)

    the current value of operation_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def operation_evidence
  @operation_evidence
end

#provider_native_keyObject (readonly)

Returns the value of attribute provider_native_key

Returns:

  • (Object)

    the current value of provider_native_key



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def provider_native_key
  @provider_native_key
end

#publication_sourceObject (readonly)

Returns the value of attribute publication_source

Returns:

  • (Object)

    the current value of publication_source



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def publication_source
  @publication_source
end

#quota_domainsObject (readonly)

Returns the value of attribute quota_domains

Returns:

  • (Object)

    the current value of quota_domains



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def quota_domains
  @quota_domains
end

#tierObject (readonly)

Returns the value of attribute tier

Returns:

  • (Object)

    the current value of tier



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def tier
  @tier
end

#tokenizer_evidenceObject (readonly)

Returns the value of attribute tokenizer_evidence

Returns:

  • (Object)

    the current value of tokenizer_evidence



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def tokenizer_evidence
  @tokenizer_evidence
end

#weight_inputsObject (readonly)

Returns the value of attribute weight_inputs

Returns:

  • (Object)

    the current value of weight_inputs



286
287
288
# File 'lib/legion/extensions/llm/inventory/records.rb', line 286

def weight_inputs
  @weight_inputs
end