Jaa


ScenarioRunExtensions.EvaluateAsync Method

Definition

Overloads

EvaluateAsync(ScenarioRun, ChatMessage, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(ScenarioRun, String, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(ScenarioRun, ChatMessage, ChatMessage, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(ScenarioRun, String, String, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

EvaluateAsync(ScenarioRun, ChatMessage, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

public static System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult> EvaluateAsync (this Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun scenarioRun, Microsoft.Extensions.AI.ChatMessage modelResponse, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.Evaluation.EvaluationContext>? additionalContext = default, System.Threading.CancellationToken cancellationToken = default);
static member EvaluateAsync : Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun * Microsoft.Extensions.AI.ChatMessage * seq<Microsoft.Extensions.AI.Evaluation.EvaluationContext> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult>
<Extension()>
Public Function EvaluateAsync (scenarioRun As ScenarioRun, modelResponse As ChatMessage, Optional additionalContext As IEnumerable(Of EvaluationContext) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of EvaluationResult)

Parameters

scenarioRun
ScenarioRun

The ScenarioRun of which this evaluation is a part.

modelResponse
ChatMessage

The response that is to be evaluated.

additionalContext
IEnumerable<EvaluationContext>

Additional contextual information that the IEvaluators included in this ScenarioRun may need to accurately evaluate the supplied modelResponse.

cancellationToken
CancellationToken

A CancellationToken that can cancel the evaluation operation.

Returns

An EvaluationResult containing one or more EvaluationMetrics.

Applies to

EvaluateAsync(ScenarioRun, String, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

public static System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult> EvaluateAsync (this Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun scenarioRun, string modelResponse, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.Evaluation.EvaluationContext>? additionalContext = default, System.Threading.CancellationToken cancellationToken = default);
static member EvaluateAsync : Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun * string * seq<Microsoft.Extensions.AI.Evaluation.EvaluationContext> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult>
<Extension()>
Public Function EvaluateAsync (scenarioRun As ScenarioRun, modelResponse As String, Optional additionalContext As IEnumerable(Of EvaluationContext) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of EvaluationResult)

Parameters

scenarioRun
ScenarioRun

The ScenarioRun of which this evaluation is a part.

modelResponse
String

The response that is to be evaluated.

additionalContext
IEnumerable<EvaluationContext>

Additional contextual information that the IEvaluators included in this ScenarioRun may need to accurately evaluate the supplied modelResponse.

cancellationToken
CancellationToken

A CancellationToken that can cancel the evaluation operation.

Returns

An EvaluationResult containing one or more EvaluationMetrics.

Applies to

EvaluateAsync(ScenarioRun, ChatMessage, ChatMessage, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

public static System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult> EvaluateAsync (this Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun scenarioRun, Microsoft.Extensions.AI.ChatMessage userRequest, Microsoft.Extensions.AI.ChatMessage modelResponse, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.Evaluation.EvaluationContext>? additionalContext = default, System.Threading.CancellationToken cancellationToken = default);
static member EvaluateAsync : Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun * Microsoft.Extensions.AI.ChatMessage * Microsoft.Extensions.AI.ChatMessage * seq<Microsoft.Extensions.AI.Evaluation.EvaluationContext> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult>
<Extension()>
Public Function EvaluateAsync (scenarioRun As ScenarioRun, userRequest As ChatMessage, modelResponse As ChatMessage, Optional additionalContext As IEnumerable(Of EvaluationContext) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of EvaluationResult)

Parameters

scenarioRun
ScenarioRun

The ScenarioRun of which this evaluation is a part.

userRequest
ChatMessage

The request that produced the modelResponse that is to be evaluated.

modelResponse
ChatMessage

The response that is to be evaluated.

additionalContext
IEnumerable<EvaluationContext>

Additional contextual information (beyond that which is available in userRequest) that the IEvaluators included in this ScenarioRun may need to accurately evaluate the supplied modelResponse.

cancellationToken
CancellationToken

A CancellationToken that can cancel the evaluation operation.

Returns

An EvaluationResult containing one or more EvaluationMetrics.

Applies to

EvaluateAsync(ScenarioRun, String, String, IEnumerable<EvaluationContext>, CancellationToken)

Evaluates the supplied modelResponse and returns an EvaluationResult containing one or more EvaluationMetrics.

public static System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult> EvaluateAsync (this Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun scenarioRun, string userRequest, string modelResponse, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.Evaluation.EvaluationContext>? additionalContext = default, System.Threading.CancellationToken cancellationToken = default);
static member EvaluateAsync : Microsoft.Extensions.AI.Evaluation.Reporting.ScenarioRun * string * string * seq<Microsoft.Extensions.AI.Evaluation.EvaluationContext> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.Evaluation.EvaluationResult>
<Extension()>
Public Function EvaluateAsync (scenarioRun As ScenarioRun, userRequest As String, modelResponse As String, Optional additionalContext As IEnumerable(Of EvaluationContext) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of EvaluationResult)

Parameters

scenarioRun
ScenarioRun

The ScenarioRun of which this evaluation is a part.

userRequest
String

The request that produced the modelResponse that is to be evaluated.

modelResponse
String

The response that is to be evaluated.

additionalContext
IEnumerable<EvaluationContext>

Additional contextual information (beyond that which is available in userRequest) that the IEvaluators included in this ScenarioRun may need to accurately evaluate the supplied modelResponse.

cancellationToken
CancellationToken

A CancellationToken that can cancel the evaluation operation.

Returns

An EvaluationResult containing one or more EvaluationMetrics.

Applies to