EvalItem.PerTurnItems Method

Definition

Splits a multi-turn conversation into one EvalItem per user turn.

public static System.Collections.Generic.IReadOnlyList<Microsoft.Agents.AI.EvalItem> PerTurnItems(System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> conversation, System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.AITool>? tools = default, string? context = default);
static member PerTurnItems : System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> * System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.AITool> * string -> System.Collections.Generic.IReadOnlyList<Microsoft.Agents.AI.EvalItem>
Public Shared Function PerTurnItems (conversation As IReadOnlyList(Of ChatMessage), Optional tools As IReadOnlyList(Of AITool) = Nothing, Optional context As String = Nothing) As IReadOnlyList(Of EvalItem)

Parameters

conversation
IReadOnlyList<ChatMessage>

The full conversation to split.

tools
IReadOnlyList<AITool>

Optional tools available to the agent.

context
String

Optional grounding context.

Returns

A list of eval items, one per user turn.

Remarks

Each user message starts a new turn. The resulting item has cumulative context: query messages contain the full conversation up to and including that user message, and the response is everything up to the next user message.

Applies to