Package dev.braintrust.eval
Interface TracedScorer<INPUT,OUTPUT>
- Type Parameters:
INPUT- type of the input dataOUTPUT- type of the output data
- All Superinterfaces:
Scorer<INPUT,OUTPUT>
A scorer that receives access to the full distributed trace of the task that was evaluated.
Implement this interface when your scorer needs to examine intermediate LLM calls, tool
invocations, or other spans produced during task execution — not just the final
TaskResult.
-
Method Summary
Modifier and TypeMethodDescriptionscore(TaskResult<INPUT, OUTPUT> taskResult) Scores the result of a successful task execution.score(TaskResult<INPUT, OUTPUT> taskResult, BrainstoreTrace trace) Scores the task result using the distributed trace for additional context.Methods inherited from interface dev.braintrust.eval.Scorer
getName, scoreForScorerException, scoreForTaskException
-
Method Details
-
score
Scores the task result using the distributed trace for additional context. Called instead ofScorer.score(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:
- one or more scores, each with a value between 0 and 1 inclusive
-
score
Scores the result of a successful task execution.When used inside an
Eval, this overload is never called —score(TaskResult, BrainstoreTrace)is dispatched instead. This default implementation throwsUnsupportedOperationExceptionto surface any accidental direct calls.- Specified by:
scorein interfaceScorer<INPUT,OUTPUT> - Parameters:
taskResult- the task output and originating dataset case- Returns:
- one or more scores, each with a value between 0 and 1 inclusive
If this method thows, the error will be recorded on the span and
Scorer.scoreForScorerException(java.lang.Exception, dev.braintrust.eval.TaskResult<INPUT, OUTPUT>)will be called as a fallback
-