ScorerData
The result from a single scorer for one example.
The result from a single scorer for one example.
Each ScoringResult contains a list of ScorerData -- one per scorer
that was run. Check success to see if the score met the threshold, and
reason for the scorer's explanation.
Attributes
name
:str
Scorer name (e.g. "faithfulness").
threshold
:float
Minimum score required for success=True.
success
:bool
Whether the score met or exceeded the threshold.
score
:Optional[float]
The numeric score (0.0 to 1.0 by default).
None
minimum_score_range
:float
Lower bound of the scoring scale.
0
maximum_score_range
:float
Upper bound of the scoring scale.
1
reason
:Optional[str]
The scorer's explanation for the score.
None
evaluation_model
:Optional[str]
The LLM used to produce the score.
None
error
:Optional[str]
Error message if scoring failed.
None
additional_metadata
:Dict[str, Any]
Extra metadata from the scorer.
field(default_factory=dict)
id
:Optional[str]
Unique identifier for this result.
None
to_dict()
Serialize to a dictionary, omitting None fields.
def to_dict() -> Dict[str, Any]:Returns
Dict[str, Any]