BooleanMetric class
An EvaluationMetric with a boolean value (pass/fail or yes/no).
- Inheritance
-
- Object
- EvaluationMetric
- BooleanMetric
- Available extensions
- Annotations
-
- @Source(name: 'BooleanMetric.cs', namespace: 'Microsoft.Extensions.AI.Evaluation', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Evaluation/')
Constructors
- BooleanMetric(String name, {bool? value, String? reason})
-
Creates a BooleanMetric with the given
name, optionalvalue, and optionalreason.
Properties
-
context
↔ Map<
String, EvaluationContext> ? -
Contexts considered by the evaluator when producing this metric.
getter/setter pairinherited
-
diagnostics
↔ List<
EvaluationDiagnostic> ? -
Diagnostic messages associated with this metric.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- interpretation ↔ EvaluationMetricInterpretation?
-
Interpretation of whether this result is good or bad, passed or failed.
getter/setter pairinherited
-
metadata
↔ Map<
String, String> ? -
Arbitrary string metadata associated with this metric.
getter/setter pairinherited
- name ↔ String
-
The name of this metric.
getter/setter pairinherited
- reason ↔ String?
-
Optional commentary on the metric result.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ bool?
-
The boolean value of this metric.
getter/setter pair
Methods
-
addDiagnostic(
EvaluationDiagnostic diagnostic) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Addsdiagnosticto EvaluationMetric.diagnostics. -
addDiagnostics(
Iterable< EvaluationDiagnostic> newDiagnostics) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Adds allnewDiagnosticsto EvaluationMetric.diagnostics. -
addOrUpdateChatMetadata(
ChatResponse response, {Duration? duration}) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Records model ID and token counts from a ChatResponse as metadata. -
addOrUpdateContext(
EvaluationContext ctx) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Adds or replacesctxin EvaluationMetric.context by name. -
addOrUpdateContextAll(
Iterable< EvaluationContext> contexts) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Adds or replaces multiple contexts by name. -
addOrUpdateDurationMetadata(
Duration duration) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Records the evaluation duration in milliseconds as metadata. -
addOrUpdateMetadata(
String name, String value) → void -
Available on EvaluationMetric, provided by the EvaluationMetricExtensions extension
Sets a metadata entry. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited