Interface EvaluationResultContent.Builder

  • Method Details

    • evaluatorArn

      EvaluationResultContent.Builder evaluatorArn(String evaluatorArn)

      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}.

      Parameters:
      evaluatorArn - 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}.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • evaluatorId

      EvaluationResultContent.Builder evaluatorId(String evaluatorId)

      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.

      Parameters:
      evaluatorId - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • evaluatorName

      EvaluationResultContent.Builder evaluatorName(String evaluatorName)

      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.

      Parameters:
      evaluatorName - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • explanation

      EvaluationResultContent.Builder explanation(String explanation)

      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.

      Parameters:
      explanation - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • context

      The contextual information associated with this evaluation result, including span context details that identify the specific traces and sessions that were evaluated.

      Parameters:
      context - The contextual information associated with this evaluation result, including span context details that identify the specific traces and sessions that were evaluated.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • context

      The contextual information associated with this evaluation result, including span context details that identify the specific traces and sessions that were evaluated.

      This is a convenience method that creates an instance of the Context.Builder avoiding the need to create one manually via Context.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to context(Context).

      Parameters:
      context - a consumer that will call methods on Context.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • value

      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.

      Parameters:
      value - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • label

      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").

      Parameters:
      label - 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").
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tokenUsage

      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.

      Parameters:
      tokenUsage - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tokenUsage

      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.

      This is a convenience method that creates an instance of the TokenUsage.Builder avoiding the need to create one manually via TokenUsage.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to tokenUsage(TokenUsage).

      Parameters:
      tokenUsage - a consumer that will call methods on TokenUsage.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • errorMessage

      EvaluationResultContent.Builder errorMessage(String errorMessage)

      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.

      Parameters:
      errorMessage - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • errorCode

      The error code indicating the type of failure that occurred during evaluation. Used to programmatically identify and handle different categories of evaluation errors.

      Parameters:
      errorCode - The error code indicating the type of failure that occurred during evaluation. Used to programmatically identify and handle different categories of evaluation errors.
      Returns:
      Returns a reference to this object so that method calls can be chained together.