Dela via


GroundednessEvaluator Class

Definition

An IEvaluator that evaluates the 'Groundedness' of a response produced by an AI model.

public ref class GroundednessEvaluator sealed : Microsoft::Extensions::AI::Evaluation::Quality::SingleNumericMetricEvaluator
public sealed class GroundednessEvaluator : Microsoft.Extensions.AI.Evaluation.Quality.SingleNumericMetricEvaluator
type GroundednessEvaluator = class
    inherit SingleNumericMetricEvaluator
Public NotInheritable Class GroundednessEvaluator
Inherits SingleNumericMetricEvaluator
Inheritance

Remarks

The GroundednessEvaluator measures the degree to which the response being evaluated is grounded in the information present in the supplied GroundingContext. It returns a NumericMetric that contains a score for the 'Groundedness'. The score is a number between 1 and 5, with 1 indicating a poor score, and 5 indicating an excellent score.

Constructors

GroundednessEvaluator()

Properties

ChatOptions

Gets the ChatOptions that this IEvaluator uses when performing evaluations.

(Inherited from SingleNumericMetricEvaluator)
EvaluationMetricNames

Gets the Names of the EvaluationMetrics produced by this IEvaluator.

(Inherited from SingleNumericMetricEvaluator)
GroundednessMetricName

Gets the Name of the NumericMetric returned by GroundednessEvaluator.

IgnoresHistory

Gets a value indicating whether this IEvaluator considers the entire conversation history (in addition to the request and response being evaluated) as part of the evaluation it performs.

(Inherited from ChatConversationEvaluator)
MetricName

Gets the Name of the NumericMetric produced by this IEvaluator.

(Inherited from SingleNumericMetricEvaluator)
SystemPrompt

Gets the system prompt that this IEvaluator uses when performing evaluations.

(Inherited from SingleNumericMetricEvaluator)

Methods

CanRenderAsync(ChatMessage, Int32, ChatConfiguration, CancellationToken)

Determines if there is sufficient tokenBudget remaining to render the supplied message as part of the evaluation prompt that this IEvaluator uses.

(Inherited from ChatConversationEvaluator)
EvaluateAsync(IEnumerable<ChatMessage>, ChatMessage, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

(Inherited from ChatConversationEvaluator)
InitializeResult()

Returns an EvaluationResult that includes default values for all the EvaluationMetrics supported by this IEvaluator.

(Inherited from SingleNumericMetricEvaluator)
ParseEvaluationResponseAsync(String, EvaluationResult, ChatConfiguration, CancellationToken)

Parses the evaluation result present in modelResponseForEvaluationPrompt into the EvaluationMetrics present in the supplied result.

(Inherited from SingleNumericMetricEvaluator)
RenderAsync(ChatMessage, CancellationToken)

Renders the supplied message to a string that can be included as part of the evaluation prompt that this IEvaluator uses.

(Inherited from ChatConversationEvaluator)
RenderEvaluationPromptAsync(ChatMessage, ChatMessage, IEnumerable<ChatMessage>, IEnumerable<EvaluationContext>, CancellationToken)

Renders the information present in the supplied parameters into a prompt that this IEvaluator uses to perform the evaluation.

(Inherited from ChatConversationEvaluator)

Extension Methods

EvaluateAsync(IEvaluator, ChatMessage, ChatMessage, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(IEvaluator, ChatMessage, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(IEvaluator, String, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(IEvaluator, String, String, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

Applies to