TaskAdherenceEvaluator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An IEvaluator that evaluates an AI system's effectiveness at adhering to the task assigned to it.
public ref class TaskAdherenceEvaluator sealed : Microsoft::Extensions::AI::Evaluation::IEvaluator
[System.Diagnostics.CodeAnalysis.Experimental("AIEVAL001")]
public sealed class TaskAdherenceEvaluator : Microsoft.Extensions.AI.Evaluation.IEvaluator
public sealed class TaskAdherenceEvaluator : Microsoft.Extensions.AI.Evaluation.IEvaluator
[<System.Diagnostics.CodeAnalysis.Experimental("AIEVAL001")>]
type TaskAdherenceEvaluator = class
interface IEvaluator
type TaskAdherenceEvaluator = class
interface IEvaluator
Public NotInheritable Class TaskAdherenceEvaluator
Implements IEvaluator
- Inheritance
-
TaskAdherenceEvaluator
- Attributes
- Implements
Remarks
TaskAdherenceEvaluator measures how accurately an AI system adheres to the task assigned to it by examining the alignment of the supplied response with instructions and definitions present in the conversation history, the accuracy and clarity of the response, and the proper use of tool definitions supplied via ToolDefinitions.
Note that at the moment, TaskAdherenceEvaluator only supports evaluating calls to tools that are defined as AIFunctions. Any other AITool definitions that are supplied via ToolDefinitions will be ignored.
TaskAdherenceEvaluator returns a NumericMetric that contains a score for 'Task Adherence'. The score is a number between 1 and 5, with 1 indicating a poor score, and 5 indicating an excellent score.
Note: TaskAdherenceEvaluator is an AI-based evaluator that uses an AI model to perform its evaluation. While the prompt that this evaluator uses to perform its evaluation is designed to be model-agnostic, the performance of this prompt (and the resulting evaluation) can vary depending on the model used, and can be especially poor when a smaller / local model is used.
The prompt that TaskAdherenceEvaluator uses has been tested against (and tuned to work well with) the following models. So, using this evaluator with a model from the following list is likely to produce the best results. (The model to be used can be configured via ChatClient.)
GPT-4o
Constructors
TaskAdherenceEvaluator() |
Properties
EvaluationMetricNames |
Gets the Names of the EvaluationMetrics produced by this IEvaluator. |
TaskAdherenceMetricName |
Gets the Name of the NumericMetric returned by TaskAdherenceEvaluator. |
Methods
EvaluateAsync(IEnumerable<ChatMessage>, ChatResponse, ChatConfiguration, IEnumerable<EvaluationContext>, CancellationToken) |
Evaluates the supplied |