跳至主要内容

此浏览器不再受支持。

请升级到 Microsoft Edge 以使用最新的功能、安全更新和技术支持。

下载 Microsoft Edge 有关 Internet Explorer 和 Microsoft Edge 的详细信息
microsoft-foundry.rest.security.o-auth2-auth

Evaluators

Create an evaluator version

POST /evaluators/{name}/versions

Creates a new evaluator version with an auto-incremented version identifier.

查询参数

api-version string 必需

The API version to use for this operation.

路径参数

name string 必需

The name of the resource

请求正文

Content-Type: application/json
display_name string

Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.

metadata object

Metadata about the evaluator

[key: string] string
evaluator_type string | enum 必需

The type of the evaluator

以下任何项:
string
enum
builtincustom
categories EvaluatorCategory[] 必需

The categories of the evaluator

supported_evaluation_levels EvaluationLevel[]

Evaluation levels this evaluator supports (e.g., turn, conversation). When omitted on create, the service defaults to ["turn"]. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only turn; custom prompt-based evaluators support exactly one level (turn or conversation).

definition code | prompt | rubric | endpoint 必需

Base evaluator configuration with discriminator

下列类型作之一:
code CodeBasedEvaluatorDefinition

Code-based evaluator definition using python code

type enum 必需
code
code_text string

Inline code text for the evaluator

entry_point string

The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')

image_tag string

The container image tag to use for evaluator code execution

blob_uri string

The blob URI for the evaluator storage

prompt PromptBasedEvaluatorDefinition

Prompt-based evaluator

type enum 必需
prompt
prompt_text string 必需

The prompt text used for evaluation

rubric RubricBasedEvaluatorDefinition

Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for both quality and safety evaluators.

type enum 必需
rubric
dimensions Dimension[] 必需

The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the same Dimension structure.

pass_threshold number

Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the emitted score. When the runtime weighted average meets or exceeds this value, the result is pass. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this threshold.

endpoint EndpointBasedEvaluatorDefinition

Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.

type enum 必需
endpoint
connection_name string 必需

Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends api-key header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity).

description string

The asset description text.

tags object

Tag dictionary. Tags can be added, removed, and updated.

[key: string] string

响应

The request has succeeded and a new resource has been created as a result.

正文

Content-Type: application/json
display_name string

Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.

metadata object

Metadata about the evaluator

[key: string] string
evaluator_type string | enum 必需

The type of the evaluator

以下任何项:
string
enum
builtincustom
categories EvaluatorCategory[] 必需

The categories of the evaluator

supported_evaluation_levels EvaluationLevel[]

Evaluation levels this evaluator supports (e.g., turn, conversation). When omitted on create, the service defaults to ["turn"]. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only turn; custom prompt-based evaluators support exactly one level (turn or conversation).

definition code | prompt | rubric | endpoint 必需

Base evaluator configuration with discriminator

下列类型作之一:
code CodeBasedEvaluatorDefinition

Code-based evaluator definition using python code

type enum 必需
code
code_text string

Inline code text for the evaluator

entry_point string

The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')

image_tag string

The container image tag to use for evaluator code execution

blob_uri string

The blob URI for the evaluator storage

prompt PromptBasedEvaluatorDefinition

Prompt-based evaluator

type enum 必需
prompt
prompt_text string 必需

The prompt text used for evaluation

rubric RubricBasedEvaluatorDefinition

Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for both quality and safety evaluators.

type enum 必需
rubric
dimensions Dimension[] 必需

The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the same Dimension structure.

pass_threshold number

Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the emitted score. When the runtime weighted average meets or exceeds this value, the result is pass. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this threshold.

endpoint EndpointBasedEvaluatorDefinition

Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.

type enum 必需
endpoint
connection_name string 必需

Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends api-key header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity).

generation_artifacts EvaluatorGenerationArtifacts

Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.

dataset DatasetReference 必需

Reference to a versioned Foundry Dataset.

name string 必需

Dataset name.

version string 必需

Dataset version.

kinds string[] 必需

The kinds of rows present in dataset. Always contains "spec" (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain "tools" (when the generation pipeline produced or inferred OpenAI tool schemas) and/or "context" (when supplementary materials such as file uploads or trace samples were used during generation).

generation_job_id string

Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent PATCH calls.

warnings GenerationWarningType[]

Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent PATCH to definition cleared the paired job's advisories. Follow generation_job_id to fetch the detailed warning payloads.

created_by string 必需

Creator of the evaluator

created_at string 必需

Creation date/time of the evaluator

modified_at string 必需

Last modified date/time of the evaluator

id string

Asset ID, a unique identifier for the asset

name string 必需

The name of the resource

version string 必需

The version of the resource

Client error

标头

x-ms-error-code string

String error code indicating what went wrong.

正文

Content-Type: application/json
error Azure.Core.Foundations.Error 必需

The error object.

code string 必需

One of a server-defined set of error codes.

message string 必需

A human-readable representation of the error.

target string

The target of the error.

details Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

code string

One of a server-defined set of error codes.

innererror Azure.Core.Foundations.InnerError

Server error

标头

x-ms-error-code string

String error code indicating what went wrong.

正文

Content-Type: application/json
error Azure.Core.Foundations.Error 必需

The error object.

code string 必需

One of a server-defined set of error codes.

message string 必需

A human-readable representation of the error.

target string

The target of the error.

details Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

code string

One of a server-defined set of error codes.

innererror Azure.Core.Foundations.InnerError

请求

POST /evaluators/{name}/versions HTTP/1.1

响应

Status: 201
Content-Type: application/json
Status: 4XX
Content-Type: application/json
Status: 5XX
Content-Type: application/json
zh-cn
你的隐私选择
  • AI 免责声明
  • 早期版本
  • 博客
  • 参与
  • 隐私
  • 消费者健康隐私
  • 使用条款
  • 商标
  • © Microsoft 2026