Share via


Evaluations.CreateAsync Method

Definition

Overloads

CreateAsync(BinaryContent, RequestOptions)

[Protocol Method] Creates an evaluation run.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
CreateAsync(Evaluation, CancellationToken)

Creates an evaluation run.

CreateAsync(BinaryContent, RequestOptions)

Source:
Evaluations.cs

[Protocol Method] Creates an 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> CreateAsync(System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = default);
abstract member CreateAsync : System.ClientModel.BinaryContent * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
override this.CreateAsync : System.ClientModel.BinaryContent * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
Public Overridable Function CreateAsync (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

CreateAsync(Evaluation, CancellationToken)

Source:
Evaluations.cs

Creates an evaluation run.

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

Parameters

evaluation
Evaluation

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 CreateAsync.

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

Evaluation evaluation = new Evaluation(null, new Dictionary<string, EvaluatorConfiguration>
{
    ["key2735"] = new EvaluatorConfiguration("gujwtvhptykq")
    {
        InitParams = { },
        DataMapping =
        {
            ["key7400"] = "ijkjfvoswni"
        },
    }
})
{
    DisplayName = "ymjxkodggqrhjnmusta",
    Description = "cuviaxytqckkybxwc",
    Tags =
    {
        ["key30"] = "nqrdpedyhkjzgrbtqhxbmkdmlpdf"
    },
    Properties =
    {
        ["key9192"] = "e"
    },
};
Response<Evaluation> response = await client.CreateAsync(evaluation);

This sample shows how to call CreateAsync.

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

Evaluation evaluation = new Evaluation(null, new Dictionary<string, EvaluatorConfiguration>());
Response<Evaluation> response = await client.CreateAsync(evaluation);

Applies to