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
import agenko
agenko.init()
agenko.score("satisfaction", 0.9, source="api", comment="user rated 9/10")Arguments
| Argument | Default | Meaning |
|---|---|---|
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_id | active span | Explicit trace binding |
spanId / span_id | active span | Explicit span binding |
How it works
- Reads the current span's
trace_id/span_idif not given explicitly. - POSTs
/api/v1/scores/withX-API-Key. - 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
- Receipts — how checks are derived
- Python SDK · TypeScript SDK
- What we reuse — Langfuse Score schema
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
- Full index: docs.agenko.app/llms.txt · sections: llms-docs.txt, llms-sdk.txt, llms-integrations.txt
- This page as markdown: docs.agenko.app/scores.md
- Search API:
curl -sG "https://docs.agenko.app/api/search-docs" --data-urlencode "query=…"
Before writing SDK code
- Install the agent skill or read Agent skill
- Read Best practices — what a good receipt looks like
- Trust boundary:
@checkafter,@approvebefore init()— zero required args, never throws- Mark
estimated: trueuntil a check is a hard fact - Shipped vs backlog: Introduction status table