Crescendo Lab 文档
简体中文
注册开始用

Evaluations API 参考

Platform API v1 的 Evaluations:每个操作的路径、参数、请求与回应字段、scope、幂等与错误,直接取自 API 合约。

最后更新

由 API 合约(Agent Lab Platform API 1.0.0-alpha.1)产生。说明文本是合约的英文原文。

An application evaluates an agent configuration it passes against cases it keeps, for the member it acts for. The platform answers each case with the same loop as a run, judges it, meters it as evaluation and keeps the verdicts; suites, history and the decision to ship are the application's. An evaluation run belongs to its member and to the installation that started it.

Evaluate an agent configuration against cases#

POST /v1/workspaces/{workspaceId}/evaluation-runs

Asks each case of cases of agent for the acting member, judges each answer against its expectations, and answers at once with the run running and every case unanswered; follow it with GET …/evaluation-runs/{evaluationRunId}. Each case is answered by the same loop as a run, in a conversation of its own that is not shown to members, and is metered as evaluation. A tool call that waits for a person is declined: nobody approves during an evaluation. The cases are kept with the run and asked once; suites, history and overrides are the application's.

Everything that can refuse the run is decided before anything is asked, and a refusal stores nothing: agent is checked as POST …/runs checks it (the same problems, ids and model), and the whole configuration and every case are checked at once (RUN_CONFIGURATION_INVALID, 422, with problems); a field this operation does not name is refused, never ignored. A workspace whose spending limit refuses the run answers RUN_BUDGET_REFUSED: an evaluation answers and judges every case, so it is refused whole rather than stopped part way.

One installation runs at most five evaluation runs at a time; another start while five are running is EVALUATIONS_IN_PROGRESS (429, retry).

Send Idempotency-Key: without one, a retried request is a second evaluation, charged again.

Scope身分验证方式Idempotency-Key
evaluations:writememberinstallationToken支持

参数

名称位置类型必填说明
workspaceIdpathstring是The workspace, by id. It must be the installation's.
Agentlab-On-Behalf-Ofheaderstring是The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again.
Idempotency-Keyheaderstring否Makes a creating call safe to retry. The same key and body within 24 hours answer the first answer again; the same key with a different body is 409.

请求内容

application/json: EvaluationRunCreate

字段类型必填说明
agentAgentConfig是—
casesEvaluationCase[]是The cases to ask, each with an id no other case of the run has.

回应

状态码内容说明
202application/json: EvaluationRunThe evaluation run, started.
400application/json: ErrorThe request itself is wrong, such as a cursor this list did not answer (recovery: none).
401application/json: ErrorNo token, or a token the platform does not honor.
402application/json: ErrorRUN_BUDGET_REFUSED: the workspace's spending limit refuses the run; nothing ran (configure).
403application/json: ErrorRefused as MemberForbidden says (including PRODUCT_ACCESS_DENIED), or MEMBER_INACTIVE: the member is no longer an active member, or between the checks and the start the member's seat or the installation stopped admitting the run; nothing ran (authorize).
404application/json: ErrorNo such operation or resource.
409application/json: ErrorThe Idempotency-Key was used within 24 hours for a different request (none), or its first request is still running (retry).
413application/json: ErrorThe body is larger than the operation accepts (PAYLOAD_TOO_LARGE, recovery: none).
422application/json: ErrorRefused before anything ran or was stored: RUN_CONFIGURATION_INVALID, the configuration or input has problems, each in problems with its field (none); RUN_MODEL_UNAVAILABLE, the workspace may not run on the named model (configure).
429application/json: ErrorRate limited (recovery: retry).
503application/json: ErrorTry again later (recovery: retry).

An evaluation run and its verdicts#

GET /v1/workspaces/{workspaceId}/evaluation-runs/{evaluationRunId}

The run's status and every case in the order it was supplied, each with its result once answered and judged (null until then). An evaluation run of another member, another installation or another workspace is not found.

Scope身分验证方式Idempotency-Key
evaluations:writememberinstallationToken—

参数

名称位置类型必填说明
workspaceIdpathstring是The workspace, by id. It must be the installation's.
Agentlab-On-Behalf-Ofheaderstring是The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again.
evaluationRunIdpathstring是The evaluation run, by id.

回应

状态码内容说明
200application/json: EvaluationRunThe evaluation run.
400application/json: ErrorThe request itself is wrong, such as a cursor this list did not answer (recovery: none).
401application/json: ErrorNo token, or a token the platform does not honor.
403application/json: ErrorRefused as MemberForbidden says (including PRODUCT_ACCESS_DENIED), or MEMBER_INACTIVE: the member is no longer an active member, or between the checks and the start the member's seat or the installation stopped admitting the run; nothing ran (authorize).
404application/json: ErrorNo such operation or resource.
429application/json: ErrorRate limited (recovery: retry).
503application/json: ErrorTry again later (recovery: retry).