Class: Legion::Extensions::Llm::Inventory::OperationEvidence
- Inherits:
-
Data
- Object
- Data
- Legion::Extensions::Llm::Inventory::OperationEvidence
- 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
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#observed_at ⇒ Object
readonly
Returns the value of attribute observed_at.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(operation:, status:, source:, observed_at: nil, metadata: {}) ⇒ OperationEvidence
constructor
A new instance of OperationEvidence.
- #supported? ⇒ Boolean
- #unknown? ⇒ Boolean
- #unsupported? ⇒ Boolean
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
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
52 53 54 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52 def @metadata end |
#observed_at ⇒ Object (readonly)
Returns the value of attribute observed_at
52 53 54 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52 def observed_at @observed_at end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation
52 53 54 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52 def operation @operation end |
#source ⇒ Object (readonly)
Returns the value of attribute source
52 53 54 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status
52 53 54 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 52 def status @status end |
Instance Method Details
#supported? ⇒ Boolean
68 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 68 def supported? = status == :supported |
#unknown? ⇒ Boolean
70 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 70 def unknown? = status == :unknown |
#unsupported? ⇒ Boolean
69 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 69 def unsupported? = status == :unsupported |