Skip to content

feat(framework): add classifier support to Eval#282

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit intomainfrom
abhi-feat-framework-eval-classifiers
Open

feat(framework): add classifier support to Eval#282
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit intomainfrom
abhi-feat-framework-eval-classifiers

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

Add a new classifiers parameter to Eval/EvalAsync/Evaluator that runs classification functions alongside scorers. Classifier results are recorded under a dedicated classifications field on EvalResult and logged to classifier-typed spans.

Based on JS PR: braintrustdata/braintrust-sdk-javascript#1553
and the spec: https://github.com/braintrustdata/braintrust-spec/blob/main/docs/telemetry/classifier.md

Add a new `classifiers` parameter to `Eval`/`EvalAsync`/`Evaluator` that
runs classification functions alongside scorers. Classifier results are
recorded under a dedicated `classifications` field on `EvalResult` and
logged to classifier-typed spans.

Key changes:
- New `Classification` and `ClassificationItem` types in `score.py`
- `EvalClassifier` callable type and `OneOrMoreClassifications` union
- `SpanTypeAttribute.CLASSIFIER` span type
- Classifier results aggregated per-name in the root span
- `scores` is now optional when `classifiers` is provided
- Devserver and push CLI updated to propagate classifier metadata
- Tests covering classifier-only, mixed, multi-classification, and span
  logging behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants