Package dev.braintrust.eval
Interface TracedClassifier<INPUT,OUTPUT>
- Type Parameters:
INPUT- type of the input dataOUTPUT- type of the output data
- All Superinterfaces:
Classifier<INPUT,OUTPUT>
A classifier that receives access to the full distributed trace of the task that was evaluated.
Implement this interface when your classifier needs to examine intermediate LLM calls, tool
invocations, or other spans produced during task execution — not just the final TaskResult.
-
Field Summary
Fields inherited from interface dev.braintrust.eval.Classifier
INVALID_CLASSIFICATION_MESSAGE -
Method Summary
Modifier and TypeMethodDescriptiondefault List<Classification>classify(TaskResult<INPUT, OUTPUT> taskResult) Classifies the result of a successful task execution.classify(TaskResult<INPUT, OUTPUT> taskResult, BrainstoreTrace trace) Classifies the task result using the distributed trace for additional context.Methods inherited from interface dev.braintrust.eval.Classifier
getName
-
Method Details
-
classify
Classifies the task result using the distributed trace for additional context. Called instead ofClassifier.classify(TaskResult)when aBrainstoreTraceis available.- Parameters:
taskResult- the task output and originating dataset casetrace- lazy access to the distributed trace spans for this eval case- Returns:
- zero or more classifications
-
classify
Classifies the result of a successful task execution.When used inside an
Eval, this overload is never called —classify(TaskResult, BrainstoreTrace)is dispatched instead. This default implementation throwsUnsupportedOperationExceptionto surface any accidental direct calls.- Specified by:
classifyin interfaceClassifier<INPUT,OUTPUT> - Parameters:
taskResult- the task output and originating dataset case- Returns:
- zero or more classifications. An empty list means "no classifications for this case".
-