interface CodeBasedOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.CodeBasedOptions |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#CodeBasedOptions |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.CodeBasedOptions |
Python | aws_cdk.aws_bedrock_agentcore_alpha.CodeBasedOptions |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป CodeBasedOptions |
Options for configuring a code-based custom evaluator using a Lambda function.
Uses a Lambda function to implement custom evaluation logic.
Example
declare const evalFunction: lambda.IFunction;
const codeEvaluator = new agentcore.Evaluator(this, 'CodeEvaluator', {
evaluatorName: 'custom_code_evaluator',
level: agentcore.EvaluationLevel.TOOL_CALL,
description: 'Evaluates tool call accuracy using custom logic',
evaluatorConfig: agentcore.EvaluatorConfig.codeBased({
lambdaFunction: evalFunction,
timeout: cdk.Duration.seconds(30),
}),
});
Properties
| Name | Type | Description |
|---|---|---|
| lambda | IFunction | The Lambda function used for evaluation. |
| timeout? | Duration | The timeout for the Lambda function invocation during evaluation. |
lambdaFunction
Type:
IFunction
The Lambda function used for evaluation.
The function will be granted invoke permissions for the
bedrock-agentcore.amazonaws.com service principal, scoped
to this specific evaluator resource.
timeout?
Type:
Duration
(optional, default: The AgentCore evaluation service's default Lambda timeout is used)
The timeout for the Lambda function invocation during evaluation.
When not specified, the AgentCore evaluation service uses its default timeout for Lambda-based evaluators.

.NET
Go
Java
Python
TypeScript (