Commit 7d53e0a
feat(eval): add classifier support (#143)
* feat(eval): add classifier support
Adds a Classifier interface mirroring Scorer that returns categorical
labels (id + optional label + optional metadata) instead of numeric
scores, with multi-label support. Implements the cross-SDK classifiers
spec: spans use type=classifier/purpose=scorer, errors are non-fatal
and aggregated into classifier_errors on the eval span's metadata, and
classifiers run concurrently with each other and with scorers within
each case. Adds a required-validation that at least one of Scorers or
Classifiers must be provided.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(eval): skip scorer goroutine when no scorers configured
Mirror the existing classifier gating so runs that only configure
classifiers don't pay for an empty scorer goroutine.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(eval): remove Classifications C() helper
Inline the one-item helper at the 5 callsites — the explicit
Classifications{{ID: ...}} literal is clear enough on its own.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8b5b0bd commit 7d53e0a
7 files changed
Lines changed: 881 additions & 5 deletions
File tree
- eval
- examples
- classifiers
- internal/classifiers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments