EvaluationMetricExtensions.AddOrUpdateChatMetadata Method

Definition

Adds or updates metadata available as part of the evaluation response produced by an AI model, in the supplied metric's Metadata dictionary.

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

Parameters

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