Rescore a comparison eval run
const url = 'https://example.com/v1/eval-runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rescore';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"projectId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/eval-runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rescore \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "projectId": "example" }'Starts a new comparison eval run of the same test set version, candidate and settings that replays nothing: it scores the run’s replays again, with the judgments recorded on them since (a changed answer judged on the replay itself; changes.new lists the items to judge). The run rescored stays as it was; the new one names it (comparison.rescoreOf, summary.rescoreOf). A case whose replays can’t be read again keeps its scores (rescored: false). Needs admin on the run’s suite and write on its project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”EvalRunId — opaque branded UUID.
Request Body
Section titled “Request Body”Body of POST /v1/eval-runs/{runId}/rescore: optional.
object
The run’s project, needed only from a runtime that doesn’t record it on the run.
Examplegenerated
{ "projectId": "example"}Responses
Section titled “Responses”The rescore started.
object
object
Examplegenerated
{ "runId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "dryRunPreview": {}}bad-input: projectId is required (this runtime doesn’t record the run’s project), or isn’t a project here. dispatcher-input-invalid: this runtime can’t rescore (it doesn’t read replays and their judgments again).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No eval run with that id under this tenant.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}eval-run-not-rescorable: only a completed comparison of a test set can be rescored.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}