Class: Legion::Extensions::Llm::Inventory::CapabilityEvidence
- Inherits:
-
Data
- Object
- Data
- Legion::Extensions::Llm::Inventory::CapabilityEvidence
- Defined in:
- lib/legion/extensions/llm/inventory/evidence.rb
Overview
Evidence that a provider instance supports (or is not known to support) a canonical capability. Config permission, absent fields, default_false, failed probes, and guesses must be constructed as :unknown, never :unsupported.
Instance Attribute Summary collapse
-
#capability ⇒ Object
readonly
Returns the value of attribute capability.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#observed_at ⇒ Object
readonly
Returns the value of attribute observed_at.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(capability:, status:, source:, observed_at: nil, metadata: {}) ⇒ CapabilityEvidence
constructor
A new instance of CapabilityEvidence.
- #supported? ⇒ Boolean
- #unknown? ⇒ Boolean
- #unsupported? ⇒ Boolean
Constructor Details
#initialize(capability:, status:, source:, observed_at: nil, metadata: {}) ⇒ CapabilityEvidence
Returns a new instance of CapabilityEvidence.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 78 def initialize(capability:, status:, source:, observed_at: nil, metadata: {}) canonical_capability = Legion::Extensions::Llm::Capabilities.canonical(capability) raise Errors::ValidationError, "capability #{canonical_capability} is not canonical" unless Legion::Extensions::Llm::Capabilities::CANONICAL.include?(canonical_capability) Evidence.validate_evidence_status(status: status, allowed: Taxonomies::CAPABILITY_EVIDENCE_STATES) Evidence.validate_evidence_source(source: source) Evidence.enforce_unknown_only_source!(status: status, source: source) super( capability: canonical_capability, status: status, source: source, observed_at: Evidence.normalize_observed_at(observed_at), metadata: ImmutableValue.copy_and_freeze(value: , field: :metadata) ) end |
Instance Attribute Details
#capability ⇒ Object (readonly)
Returns the value of attribute capability
77 78 79 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 77 def capability @capability end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
77 78 79 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 77 def @metadata end |
#observed_at ⇒ Object (readonly)
Returns the value of attribute observed_at
77 78 79 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 77 def observed_at @observed_at end |
#source ⇒ Object (readonly)
Returns the value of attribute source
77 78 79 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 77 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status
77 78 79 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 77 def status @status end |
Instance Method Details
#supported? ⇒ Boolean
95 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 95 def supported? = status == :supported |
#unknown? ⇒ Boolean
97 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 97 def unknown? = status == :unknown |
#unsupported? ⇒ Boolean
96 |
# File 'lib/legion/extensions/llm/inventory/evidence.rb', line 96 def unsupported? = status == :unsupported |