Share via


Evaluations.CreateAgentEvaluationAsync Method

Definition

Overloads

CreateAgentEvaluationAsync(AgentEvaluationRequest, CancellationToken)

Creates an agent evaluation run.

CreateAgentEvaluationAsync(BinaryContent, RequestOptions)

[Protocol Method] Creates an agent evaluation run.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.

CreateAgentEvaluationAsync(AgentEvaluationRequest, CancellationToken)

Source:
Evaluations.cs

Creates an agent evaluation run.

public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.AgentEvaluation>> CreateAgentEvaluationAsync(Azure.AI.Projects.AgentEvaluationRequest evaluation, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAgentEvaluationAsync : Azure.AI.Projects.AgentEvaluationRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.AgentEvaluation>>
override this.CreateAgentEvaluationAsync : Azure.AI.Projects.AgentEvaluationRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.AgentEvaluation>>
Public Overridable Function CreateAgentEvaluationAsync (evaluation As AgentEvaluationRequest, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult(Of AgentEvaluation))

Parameters

evaluation
AgentEvaluationRequest

Agent evaluation to be run.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

evaluation is null.

Service returned a non-success status code.

Examples

This sample shows how to call CreateAgentEvaluationAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Evaluations client = new AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview");

AgentEvaluationRequest evaluation = new AgentEvaluationRequest("ecfcffqsrdhpecocrufffiqz", new Dictionary<string, EvaluatorConfiguration>
{
    ["key2653"] = new EvaluatorConfiguration("gujwtvhptykq")
    {
        InitParams = { },
        DataMapping =
        {
            ["key7400"] = "ijkjfvoswni"
        },
    }
}, "dvcnrcwar")
{
    ThreadId = "cxjjsyhkeezgnaqqyerrdrbbth",
    SamplingConfiguration = new AgentEvaluationSamplingConfiguration("tj", 7F, 8F),
    RedactionConfiguration = new AgentEvaluationRedactionConfiguration
    {
        RedactScoreProperties = true,
    },
};
Response<AgentEvaluation> response = await client.CreateAgentEvaluationAsync(evaluation);

This sample shows how to call CreateAgentEvaluationAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Evaluations client = new AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview");

AgentEvaluationRequest evaluation = new AgentEvaluationRequest("ecfcffqsrdhpecocrufffiqz", new Dictionary<string, EvaluatorConfiguration>(), "dvcnrcwar");
Response<AgentEvaluation> response = await client.CreateAgentEvaluationAsync(evaluation);

Applies to

CreateAgentEvaluationAsync(BinaryContent, RequestOptions)

Source:
Evaluations.cs

[Protocol Method] Creates an agent evaluation run.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult> CreateAgentEvaluationAsync(System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = default);
abstract member CreateAgentEvaluationAsync : System.ClientModel.BinaryContent * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
override this.CreateAgentEvaluationAsync : System.ClientModel.BinaryContent * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
Public Overridable Function CreateAgentEvaluationAsync (content As BinaryContent, Optional options As RequestOptions = Nothing) As Task(Of ClientResult)

Parameters

content
BinaryContent

The content to send as the body of the request.

options
RequestOptions

The request options, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

content is null.

Service returned a non-success status code.

Applies to