EvaluationMetric<T> Class

Definition

An base class that represents the result of an evaluation containing a value of type T.

generic <typename T>
public ref class EvaluationMetric : Microsoft::Extensions::AI::Evaluation::EvaluationMetric
public class EvaluationMetric<T> : Microsoft.Extensions.AI.Evaluation.EvaluationMetric
type EvaluationMetric<'T> = class
    inherit EvaluationMetric
Public Class EvaluationMetric(Of T)
Inherits EvaluationMetric

Type Parameters

T

The type of the Value.

Inheritance
EvaluationMetric<T>
Derived

Constructors

EvaluationMetric<T>(String, T, String)

Initializes a new instance of the EvaluationMetric<T> class.

Properties

Context

Gets or sets any EvaluationContexts that were considered by the IEvaluator as part of the evaluation that produced the current EvaluationMetric.

(Inherited from EvaluationMetric)
Diagnostics

Gets or sets a collection of zero or more EvaluationDiagnostics associated with the current EvaluationMetric.

(Inherited from EvaluationMetric)
Interpretation

Gets or sets an EvaluationMetricInterpretation that identifies whether the result of the evaluation represented by the current EvaluationMetric is considered good or bad, passed or failed etc.

(Inherited from EvaluationMetric)
Metadata

Gets or sets a collection of zero or more string metadata associated with the current EvaluationMetric.

(Inherited from EvaluationMetric)
Name

Gets or sets the name of the EvaluationMetric.

(Inherited from EvaluationMetric)
Reason

Gets or sets a string that can optionally be used to provide some commentary around the result represented by this EvaluationMetric.

(Inherited from EvaluationMetric)
Value

Gets or sets the value of the EvaluationMetric<T>.

Extension Methods

AddDiagnostics(EvaluationMetric, EvaluationDiagnostic[])

Adds the supplied EvaluationDiagnostics to the supplied EvaluationMetric's Diagnostics collection.

AddDiagnostics(EvaluationMetric, IEnumerable<EvaluationDiagnostic>)

Adds the supplied EvaluationDiagnostics to the supplied EvaluationMetric's Diagnostics collection.

AddOrUpdateChatMetadata(EvaluationMetric, ChatResponse, Nullable<TimeSpan>)

Adds or updates metadata available as part of the evaluation response produced by an AI model, in the supplied metric's Metadata dictionary.

AddOrUpdateContext(EvaluationMetric, EvaluationContext[])

Adds or updates the supplied context objects in the supplied metric's Context dictionary.

AddOrUpdateContext(EvaluationMetric, IEnumerable<EvaluationContext>)

Adds or updates the supplied context objects in the supplied metric's Context dictionary.

AddOrUpdateMetadata(EvaluationMetric, IDictionary<String,String>)

Adds or updates the supplied metadata in the supplied metric's Metadata dictionary.

AddOrUpdateMetadata(EvaluationMetric, String, String)

Adds or updates metadata with the specified name and value in the supplied metric's Metadata dictionary.

ContainsDiagnostics(EvaluationMetric, Func<EvaluationDiagnostic,Boolean>)

Determines if the supplied metric contains any EvaluationDiagnostic matching the supplied predicate.

Applies to