Add classifier support#154
Merged
Merged
Conversation
Stephen Belanger (Qard)
requested review from
Matt Perpick (clutchski) and
David Elner (delner)
April 22, 2026 18:46
Contributor
|
Can you add an |
Contributor
Author
|
Yep, added an example now. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… via helper Reverts the blanket `kwargs[:scorers] ||= [...]` added in d80d83c. Each test that actually runs an eval now explicitly passes `scorers: [noop_scorer]` where needed. Tests that only exercise validation paths (400/404) are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Abhijeet Prasad (AbhiPrasad)
approved these changes
May 5, 2026
Mirror the scorer error pattern by pushing classifier failures onto the errors queue, so they appear in result.errors (and result.success? is false) in addition to being recorded in span metadata. Addresses PR #154 review feedback.
Abhijeet Prasad (AbhiPrasad)
approved these changes
May 7, 2026
This was referenced May 25, 2026
Stephen Belanger (Qard)
added a commit
to braintrustdata/braintrust-sdk-java
that referenced
this pull request
May 27, 2026
Mirrors the Ruby SDK's classifier port (braintrustdata/braintrust-sdk-ruby#154) and the canonical classifier spec at braintrust-spec/docs/features/classifiers.md. Classifiers return structured Classification items (id, optional label, optional metadata) instead of numeric scores. They run alongside scorers, their failures are non-fatal, and at least one of scorers/classifiers is required (relaxes the prior scorers-required check). New public types: Classification, Classifier (+ Classifier.of / .single factories), TracedClassifier. Eval gains a classifiers(...) builder method and a runClassifier helper that emits classifier spans with type=classifier, purpose=scorer; per-case classifications aggregate onto the root eval span as braintrust.classifications, and classifier exceptions land in braintrust.metadata.classifier_errors. Also fixes an inverted-condition bug in TestHarness.ensureRemoteDataset's post-rebuild verify check (threw when datasets matched). New cassettes were recorded only for ClassifierEvalTest (VCR_MODE=record ... --tests '*ClassifierEvalTest*') against the same Braintrust SDKs org used by the existing cassettes, so the rest of the cassette set is untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for classifiers. It tries to align as much as possible with how scorers are implemented currently.