POST
Test a code metric on traces

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

application/json
code
string
required

The Python file to test. It defines a function named measure.

Required string length: 1 - 80000
Example:

"def measure(actual_output):\n return 1.0 if actual_output else 0.0\n"

inferenceResultIds
string[]
required

The traces to score, 1 to 20. Results come back in this order.

Required array length: 1 - 20 elements
Minimum string length: 1
Example:

Response

The code was checked: its error when it does not load, else one result per trace

outcome
enum<string>
required

failed: the code does not load, and error says why; no trace was scored.

Available options:
ran,
failed
error
string | null
required

Why the code does not load, with its line.

arguments
string[]
required

The trace values measure takes.

Example:
runnerVersion
string | null
required
traces
object[]
required

One result per asked trace, in the asked order, when the code loads. Empty when it does not.