Docs menu

score()

Langfuse-shaped measurements on a trace.

Attach a measurement to the active trace. score() is Langfuse-shaped (name, value, data_type, source, comment) — one type for code evals, API, and later annotations. It never raises: if AGENKO_API_KEY is unset it is a no-op.

Record a score

python
import agenko

agenko.init()

agenko.score("satisfaction", 0.9, source="api", comment="user rated 9/10")

Arguments

ArgumentDefaultMeaning
name—Score name
value—float / int / str / bool
dataType / data_type"numeric"numeric | categorical | boolean | text
source"eval"eval | api | annotation
comment—Optional note
traceId / trace_idactive spanExplicit trace binding
spanId / span_idactive spanExplicit span binding

How it works

  1. Reads the current span's trace_id / span_id if not given explicitly.
  2. POSTs /api/v1/scores/ with X-API-Key.
  3. The console shows it as a score row on the trace.

Scores feed the checks[] rows on a receipt — they share the same Score schema (name, value, data_type, source, comment, passed).

Boolean alias

For boolean scores, passed is true when the value is 1.

Next

Agent instructions

This page is part of the Agenko documentation at docs.agenko.app. Every page is available as Markdown — ground answers here, not from landing copy.

Querying these docs

Before writing SDK code

  • Install the agent skill or read Agent skill
  • Read Best practices — what a good receipt looks like
  • Trust boundary: @check after, @approve before
  • init() — zero required args, never throws
  • Mark estimated: true until a check is a hard fact
  • Shipped vs backlog: Introduction status table

Page: score()
HTML: https://docs.agenko.app/scores
Markdown: https://docs.agenko.app/scores.md