EvaluationResultExtensions.AddOrUpdateChatMetadataInAllMetrics Method

Definition

Adds or updates metadata available as part of the evaluation response produced by an AI model, in all EvaluationMetrics contained in the supplied result.

public static void AddOrUpdateChatMetadataInAllMetrics(this Microsoft.Extensions.AI.Evaluation.EvaluationResult result, Microsoft.Extensions.AI.ChatResponse response, TimeSpan? duration = default);
static member AddOrUpdateChatMetadataInAllMetrics : Microsoft.Extensions.AI.Evaluation.EvaluationResult * Microsoft.Extensions.AI.ChatResponse * Nullable<TimeSpan> -> unit
<Extension()>
Public Sub AddOrUpdateChatMetadataInAllMetrics (result As EvaluationResult, response As ChatResponse, Optional duration As Nullable(Of TimeSpan) = Nothing)

Parameters

result
EvaluationResult

The EvaluationResult containing the EvaluationMetrics that are to be altered.

response
ChatResponse

The ChatResponse that contains metadata to be added or updated.

duration
Nullable<TimeSpan>

An optional duration that represents the amount of time that it took for the AI model to produce the supplied response. If supplied, the duration will also be included as part of the added metadata.

Applies to