class EvaluatorConfig
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.EvaluatorConfig |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#EvaluatorConfig |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.EvaluatorConfig |
Python | aws_cdk.aws_bedrock_agentcore_alpha.EvaluatorConfig |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป EvaluatorConfig |
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
// LLM-as-a-Judge evaluator
const llmConfig = agentcore.EvaluatorConfig.llmAsAJudge({
instructions: 'Evaluate whether the agent response is helpful.',
modelId: 'us.anthropic.claude-sonnet-4-6',
ratingScale: agentcore.EvaluatorRatingScale.categorical([
{ label: 'Good', definition: 'The response is helpful.' },
{ label: 'Bad', definition: 'The response is not helpful.' },
]),
});
// Code-based evaluator
declare const myEvalFunction: lambda.IFunction;
const codeConfig = agentcore.EvaluatorConfig.codeBased({
lambdaFunction: myEvalFunction,
});
Properties
| Name | Type | Description |
|---|---|---|
| lambda | IFunction | The Lambda function used for code-based evaluation, if applicable. |
lambdaFunction?
Type:
IFunction
(optional)
The Lambda function used for code-based evaluation, if applicable.
Methods
| Name | Description |
|---|---|
| static code | Creates a code-based evaluator configuration using a Lambda function. |
| static llm | Creates an LLM-as-a-Judge evaluator configuration. |
static codeBased(options)
public static codeBased(options: CodeBasedOptions): EvaluatorConfig
Parameters
- options
Codeโ - The code-based configuration options.Based Options
Returns
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.
static llmAsAJudge(options)
public static llmAsAJudge(options: LlmAsAJudgeOptions): EvaluatorConfig
Parameters
- options
Llmโ - The LLM-as-a-Judge configuration options.As AJudge Options
Returns
Creates an LLM-as-a-Judge evaluator configuration.
Uses a foundation model to assess agent performance based on custom instructions and a rating scale.

.NET
Go
Java
Python
TypeScript (