Class EvaluatorConfig

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.EvaluatorConfig
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.130.0 (build 048a5ee)", date="2026-05-19T19:44:37.074Z") @Stability(Stable) public class EvaluatorConfig extends software.amazon.jsii.JsiiObject
Configuration for a custom evaluator.

Defines how an evaluator assesses agent performance. Supports two strategies:

  • LLM-as-a-Judge: Uses a foundation model with custom instructions and a rating scale.
  • Code-based: Uses a Lambda function for custom evaluation logic.

Example:

 // Code-based evaluator
 IFunction myEvalFunction;
 // LLM-as-a-Judge evaluator
 EvaluatorConfig llmConfig = EvaluatorConfig.llmAsAJudge(LlmAsAJudgeOptions.builder()
         .instructions("Evaluate whether the agent response is helpful.")
         .modelId("us.anthropic.claude-sonnet-4-6")
         .ratingScale(EvaluatorRatingScale.categorical(List.of(CategoricalRatingOption.builder().label("Good").definition("The response is helpful.").build(), CategoricalRatingOption.builder().label("Bad").definition("The response is not helpful.").build())))
         .build());
 EvaluatorConfig codeConfig = EvaluatorConfig.codeBased(CodeBasedOptions.builder()
         .lambdaFunction(myEvalFunction)
         .build());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    EvaluatorConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    EvaluatorConfig(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a code-based evaluator configuration using a Lambda function.
    The Lambda function used for code-based evaluation, if applicable.
    Creates an LLM-as-a-Judge evaluator configuration.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • EvaluatorConfig

      protected EvaluatorConfig(software.amazon.jsii.JsiiObjectRef objRef)
    • EvaluatorConfig

      protected EvaluatorConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • codeBased

      @Stability(Stable) @NotNull public static EvaluatorConfig codeBased(@NotNull CodeBasedOptions options)
      Creates a code-based evaluator configuration using a Lambda function.

      The Lambda function implements custom evaluation logic. The function will automatically be granted invoke permissions for the bedrock-agentcore service.

      Parameters:
      options -
      • The code-based configuration options.
      This parameter is required.
    • llmAsAJudge

      @Stability(Stable) @NotNull public static EvaluatorConfig llmAsAJudge(@NotNull LlmAsAJudgeOptions options)
      Creates an LLM-as-a-Judge evaluator configuration.

      Uses a foundation model to assess agent performance based on custom instructions and a rating scale.

      Parameters:
      options -
      • The LLM-as-a-Judge configuration options.
      This parameter is required.
    • getLambdaFunction

      @Stability(Stable) @Nullable public IFunction getLambdaFunction()
      The Lambda function used for code-based evaluation, if applicable.