Class: Legion::Extensions::Llm::Inventory::OperationEvidence

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

Overview

Evidence that a provider instance supports (or is not known to support) a canonical operation. stream_chat stays stream_chat; it never canonicalizes into capability streaming.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation:, status:, source:, observed_at: nil, metadata: {}) ⇒ OperationEvidence

Returns a new instance of OperationEvidence.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 53

def initialize(operation:, status:, source:, observed_at: nil, metadata: {})
  canonical_operation = Taxonomies.normalize_operation(value: operation, allow_aliases: false)
  Evidence.validate_evidence_status(status: status, allowed: Taxonomies::OPERATION_EVIDENCE_STATES)
  Evidence.validate_evidence_source(source: source)
  Evidence.enforce_unknown_only_source!(status: status, source: source)

  super(
    operation: canonical_operation,
    status: status,
    source: source,
    observed_at: Evidence.normalize_observed_at(observed_at),
    metadata: ImmutableValue.copy_and_freeze(value: , field: :metadata)
  )
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



52
53
54
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52

def 
  @metadata
end

#observed_atObject (readonly)

Returns the value of attribute observed_at

Returns:

  • (Object)

    the current value of observed_at



52
53
54
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52

def observed_at
  @observed_at
end

#operationObject (readonly)

Returns the value of attribute operation

Returns:

  • (Object)

    the current value of operation



52
53
54
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52

def operation
  @operation
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



52
53
54
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



52
53
54
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52

def status
  @status
end

Instance Method Details

#supported?Boolean

Returns:

  • (Boolean)


68
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 68

def supported? = status == :supported

#unknown?Boolean

Returns:

  • (Boolean)


70
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 70

def unknown? = status == :unknown

#unsupported?Boolean

Returns:

  • (Boolean)


69
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 69

def unsupported? = status == :unsupported