Compartilhar via


ChatConversationEvaluator Class

Definition

An abstract base class that can be used to implement an AI-based IEvaluator.

public ref class ChatConversationEvaluator abstract : Microsoft::Extensions::AI::Evaluation::IEvaluator
public abstract class ChatConversationEvaluator : Microsoft.Extensions.AI.Evaluation.IEvaluator
type ChatConversationEvaluator = class
    interface IEvaluator
Public MustInherit Class ChatConversationEvaluator
Implements IEvaluator
Inheritance
ChatConversationEvaluator
Derived
Implements

Constructors

ChatConversationEvaluator()

Properties

EvaluationMetricNames

Gets the Names of the EvaluationMetrics produced by this IEvaluator.

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.

SystemPrompt

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

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.

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

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

InitializeResult()

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

PerformEvaluationAsync(ChatConfiguration, IList<ChatMessage>, EvaluationResult, CancellationToken)

Invokes the supplied ChatClient with the supplied evaluationMessages to perform the evaluation, and includes the results as one or more EvaluationMetrics in the supplied result.

RenderAsync(ChatMessage, CancellationToken)

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

RenderAsync(ChatResponse, CancellationToken)

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

RenderEvaluationPromptAsync(ChatMessage, ChatResponse, IEnumerable<ChatMessage>, IEnumerable<EvaluationContext>, CancellationToken)

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

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, ChatResponse, 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, ChatResponse, 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