EvaluationResultContent¶
Structure Class¶
EvaluationResultContent
dataclass
¶
The comprehensive result of an evaluation containing the score, explanation, evaluator metadata, and execution details. Provides both quantitative ratings and qualitative insights about agent performance.
Attributes¶
context
instance-attribute
¶
context: Context
The contextual information associated with this evaluation result, including span context details that identify the specific traces and sessions that were evaluated.
error_code
class-attribute
instance-attribute
¶
error_code: str | None = None
The error code indicating the type of failure that occurred during evaluation. Used to programmatically identify and handle different categories of evaluation errors.
error_message
class-attribute
instance-attribute
¶
error_message: str | None = None
The error message describing what went wrong if the evaluation failed. Provides detailed information about evaluation failures to help diagnose and resolve issues with evaluator configuration or input data.
evaluator_arn
instance-attribute
¶
evaluator_arn: str
The Amazon Resource Name (ARN) of the evaluator used to generate this
result. For custom evaluators, this is the full ARN; for built-in
evaluators, this follows the pattern Builtin.{EvaluatorName}.
evaluator_id
instance-attribute
¶
evaluator_id: str
The unique identifier of the evaluator that produced this result. This
matches the evaluatorId provided in the evaluation request and can be
used to identify which evaluator generated specific results.
evaluator_name
instance-attribute
¶
evaluator_name: str
The human-readable name of the evaluator used for this evaluation. For built-in evaluators, this is the descriptive name (e.g., "Helpfulness", "Correctness"); for custom evaluators, this is the user-defined name.
explanation
class-attribute
instance-attribute
¶
explanation: str | None = field(repr=False, default=None)
The detailed explanation provided by the evaluator describing the reasoning behind the assigned score. This qualitative feedback helps understand why specific ratings were given and provides actionable insights for improvement.
ignored_reference_input_fields
class-attribute
instance-attribute
¶
ignored_reference_input_fields: list[str] | None = None
The list of reference input field names that were provided but not used by the evaluator. Helps identify which ground truth data was not consumed during evaluation.
label
class-attribute
instance-attribute
¶
label: str | None = None
The categorical label assigned by the evaluator when using a categorical rating scale. This provides a human-readable description of the evaluation result (e.g., "Excellent", "Good", "Poor") corresponding to the numerical value. For numerical scales, this field is optional and provides a natural language explanation of what the value means (e.g., value 0.5 = "Somewhat Helpful").
token_usage
class-attribute
instance-attribute
¶
token_usage: TokenUsage | None = None
The token consumption statistics for this evaluation, including input tokens, output tokens, and total tokens used by the underlying language model during the evaluation process.
value
class-attribute
instance-attribute
¶
value: float | None = None
The numerical score assigned by the evaluator according to its configured rating scale. For numerical scales, this is a decimal value within the defined range. This field is not allowed for categorical scales.