CreateEvaluator

Updated at:

Creates an evaluator.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

agentloop:CreateEvaluator

create

*Workspace

acs:agentloop:{#regionId}:{#accountId}:agentspace/{#AgentSpaceName}

None None

Request syntax

POST /api/v1/evaluators/{agentSpace} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

agentSpace

string

Yes

The AgentSpace name.

prod-agentspace

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

{"name":"trace_task_completion","displayName":"Trace task completion","type":"AGENT","metricName":"agent_task_completion","version":"1.0.0"}

name

string

Yes

The evaluator name. It cannot start with a system-reserved prefix and can be up to 128 characters in length.

trace_task_completion

displayName

string

No

The display name. It can be up to 128 characters in length.

Trace task completion

type

string

Yes

The evaluator type. LLM indicates an inner join large model evaluation evaluator, AGENT indicates a StarOps digital employee evaluator, and CODE indicates a code evaluator.

Valid values:

  • AGENT :

    AGENT

  • CODE :

    CODE

  • LLM :

    LLM

AGENT

description

string

No

The evaluator description. It can be up to 256 characters in length.

Determines whether the agent completes the user task

metricName

string

Yes

The evaluation metric name.

agent_task_completion

version

string

Yes

The initial version number.

1.0.0

versionDescription

string

No

The version description.

Initial version

config

object

No

The evaluator configuration. LLM and AGENT evaluators typically include prompt, variables, and outputSchema. CODE evaluators typically include codeType, faasConfig, variables, and parameters.

{"prompt":"Evaluate task completion","variables":[{"name":"input"}]}

annotations

array

No

The list of annotation tags.

["__en"]

string

No

A single annotation tag.

__en

properties

object

No

The evaluator properties.

{"agentEvaluatorMode":"raw_prompt"}

status

string

No

The initial version status. Set this parameter to DRAFT to save the evaluator as a draft. If you omit this parameter, the initial version is directly published.

DRAFT

skills

array<object>

No

The list of business skills for the initial version of a standard agent evaluator.

[{"skillName":"fact-check","files":[{"name":"SKILL.md","content":"---\nname: fact-check\ndescription: Verify the factual basis in the response\n---\nVerify the facts in the response item by item and list the evidence."}]}]

array<object>

No

A business skill included in this version.

{"skillName":"fact-check","files":[{"name":"SKILL.md","content":"---\nname: fact-check\ndescription: Verify the factual basis in the response\n---\nVerify the facts in the response item by item and list the evidence."}]}

skillName

string

No

The skill name. It must be unique in the submitted skill list.

fact-check

displayName

string

No

The display name of the skill.

Fact check

description

string

No

The description of the skill purpose.

Verify the factual basis in the response

enable

boolean

No

Specifies whether to enable the skill. Default value: true.

true

files

array<object>

No

The complete list of files for the skill. The list must include SKILL.md in the root directory.

[{"name":"SKILL.md","content":"---\nname: fact-check\ndescription: Verify the factual basis in the response\n---\nVerify the facts in the response item by item and list the evidence."}]

object

No

A file in the skill.

{"name":"SKILL.md","content":"---\nname: fact-check\ndescription: Verify the factual basis in the response\n---\nVerify the facts in the response item by item and list the evidence."}

name

string

No

The path of the file relative to the skill root directory.

SKILL.md

content

string

No

The text content of the file.

--- name: fact-check description: Verify the factual basis in the response --- Verify the facts in the response item by item and list the evidence

clientToken

string

No

The idempotency token. CloudSpec declares this query parameter, but the backend does not perform idempotency checks.

a1b2c3d4-1234-5678-90ab-cdef12345678

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

3FE4CD1E-FF41-56BE-B590-7A021D9C1524

name

string

The evaluator name.

trace_task_completion

version

string

The created version number.

1.0.0

Examples

Success response

JSON format

{
  "requestId": "3FE4CD1E-FF41-56BE-B590-7A021D9C1524",
  "name": "trace_task_completion",
  "version": "1.0.0"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.