Write scores
POST /v1/scores writes a list of scores. Right: write. It needs Content-Type: application/json.
The scores, each a score object. Here
at may be left out: it is then the time the server receives the score.- A score replaces the score with the same target, name, source, author and eval id.
- A score that breaks a rule gets
400, and the server writes nothing of its request. - A busy server answers
429withRetry-After: 1.
Get the scores of a trace
GET /v1/traces/:id/scores returns {"scores": [score]}: the scores on the trace and on its spans, by time, then name. Right: read.
Get the scores on a session
GET /v1/sessions/:id/scores returns {"scores": [score]}: the scores on the session itself, by time, then name. With none, the list is empty. Right: read.
Scores on a session are not in GET /v1/traces/:id/scores, and not in anyScore. They go with a delete of the session. They also go when a delete or the retention removes the last trace of their session.
The score object
"number", "boolean" (the value is 0 or 1) or "category" (it has a label). A score with a label and no value is a category.The eval that made it: an evaluator and its version, a config, or one run of an experiment. Two runs with different ids keep one score each on the same target.
traceId), a span (traceId and spanId), or a session (sessionId, and no traceId). type, authorId and evalId are left out of an answer when they are not set.
Sums of scores
Averages, percentiles and label counts per group.
Sessions and scores
A guide with real scores.