class EvaluatorReference
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.EvaluatorReference |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#EvaluatorReference |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.EvaluatorReference |
Python | aws_cdk.aws_bedrock_agentcore_alpha.EvaluatorReference |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป EvaluatorReference |
Represents a reference to an evaluator for online evaluation.
Use the static factory methods to create evaluator references:
EvaluatorReference.builtin()for built-in evaluatorsEvaluatorReference.custom()for custom evaluators
Example
// Using built-in evaluators
const helpfulness = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS);
// Using custom evaluators
declare const myCustomEvaluator: agentcore.IEvaluator;
const custom = agentcore.EvaluatorReference.custom(myCustomEvaluator);
Properties
| Name | Type | Description |
|---|---|---|
| evaluator | string | The evaluator identifier. |
evaluatorId
Type:
string
The evaluator identifier.
Methods
| Name | Description |
|---|---|
| bind() | Binds the evaluator reference to produce the L1 property. |
| static builtin(evaluator) | Creates a reference to a built-in evaluator. |
| static custom(evaluator) | Creates a reference to a custom evaluator. |
bind()
public bind(): EvaluatorReferenceBindResult
Returns
Binds the evaluator reference to produce the L1 property.
static builtin(evaluator)
public static builtin(evaluator: BuiltinEvaluator): EvaluatorReference
Parameters
- evaluator
Builtinโ - The built-in evaluator to reference.Evaluator
Returns
Creates a reference to a built-in evaluator.
Built-in evaluators are provided by Amazon Bedrock AgentCore and assess different aspects of agent performance at various levels (session, trace, or tool call). Example
const helpfulness = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS);
const goalSuccess = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.GOAL_SUCCESS_RATE);
static custom(evaluator)
public static custom(evaluator: IEvaluator): EvaluatorReference
Parameters
- evaluator
IEvaluatorโ - The custom evaluator construct to reference.
Returns
Creates a reference to a custom evaluator.
Custom evaluators are created using the Evaluator construct and can be
LLM-as-a-Judge or code-based (Lambda) evaluators.
Example
declare const myCustomEvaluator: agentcore.IEvaluator;
const ref = agentcore.EvaluatorReference.custom(myCustomEvaluator);

.NET
Go
Java
Python
TypeScript (