WorkflowEvaluationExtensions.EvaluateAsync Method

Definition

Evaluates a completed workflow run.

public static System.Threading.Tasks.Task<Microsoft.Agents.AI.AgentEvaluationResults> EvaluateAsync(this Microsoft.Agents.AI.Workflows.Run run, Microsoft.Agents.AI.IAgentEvaluator evaluator, bool includeOverall = true, bool includePerAgent = true, string evalName = "Workflow Eval", Microsoft.Agents.AI.IConversationSplitter? splitter = default, string? expectedOutput = default, System.Threading.CancellationToken cancellationToken = default);
static member EvaluateAsync : Microsoft.Agents.AI.Workflows.Run * Microsoft.Agents.AI.IAgentEvaluator * bool * bool * string * Microsoft.Agents.AI.IConversationSplitter * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.AI.AgentEvaluationResults>
<Extension()>
Public Function EvaluateAsync (run As Run, evaluator As IAgentEvaluator, Optional includeOverall As Boolean = true, Optional includePerAgent As Boolean = true, Optional evalName As String = "Workflow Eval", Optional splitter As IConversationSplitter = Nothing, Optional expectedOutput As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AgentEvaluationResults)

Parameters

run
Run

The completed workflow run.

evaluator
IAgentEvaluator

The evaluator to score results.

includeOverall
Boolean

Whether to include an overall evaluation.

includePerAgent
Boolean

Whether to include per-agent breakdowns.

evalName
String

Display name for this evaluation run.

splitter
IConversationSplitter

Optional conversation splitter to apply to all items. Use LastTurn, Full, or a custom IConversationSplitter implementation.

expectedOutput
String

Optional ground-truth/expected output for the workflow's overall final answer. When provided, it is stamped onto the overall ExpectedOutput so reference-based evaluators (for example, similarity) can compare the workflow's response against a golden answer. Ground truth is only applied to the overall item; per-agent items are intentionally left without an expected output, since ground truth is defined against the final response. When using a reference-based evaluator that requires ground truth, set includePerAgent to false to avoid invoking the evaluator on per-agent items that have no expected output.

cancellationToken
CancellationToken

Cancellation token.

Returns

Evaluation results with optional per-agent sub-results.

Applies to