BuiltinEvaluator Class
Built-in evaluators provided by Amazon Bedrock AgentCore.
These evaluators assess different aspects of agent performance at various levels (session, trace, or tool call).
| Source | lib/evaluation/types.ts |
|---|
Example
ts
// Basic usage with built-in evaluators
const evaluation = new agentcore.OnlineEvaluationConfig(this, 'MyEvaluation', {
onlineEvaluationConfigName: 'my_evaluation',
evaluators: [
agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS),
agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.CORRECTNESS),
],
dataSource: agentcore.DataSourceConfig.fromCloudWatchLogs({
logGroupNames: ['/aws/bedrock-agentcore/my-agent'],
serviceNames: ['my-agent.default'],
}),
});
python
# Basic usage with built-in evaluators
evaluation = agentcore.OnlineEvaluationConfig(self, "MyEvaluation",
online_evaluation_config_name="my_evaluation",
evaluators=[
agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS),
agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.CORRECTNESS)
],
data_source=agentcore.DataSourceConfig.from_cloud_watch_logs(
log_group_names=["/aws/bedrock-agentcore/my-agent"],
service_names=["my-agent.default"]
)
)
java
// Basic usage with built-in evaluators
OnlineEvaluationConfig evaluation = OnlineEvaluationConfig.Builder.create(this, "MyEvaluation")
.onlineEvaluationConfigName("my_evaluation")
.evaluators(List.of(EvaluatorReference.builtin(BuiltinEvaluator.HELPFULNESS), EvaluatorReference.builtin(BuiltinEvaluator.CORRECTNESS)))
.dataSource(DataSourceConfig.fromCloudWatchLogs(CloudWatchLogsDataSourceConfig.builder()
.logGroupNames(List.of("/aws/bedrock-agentcore/my-agent"))
.serviceNames(List.of("my-agent.default"))
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// Basic usage with built-in evaluators
var evaluation = new OnlineEvaluationConfig(this, "MyEvaluation", new OnlineEvaluationConfigProps {
OnlineEvaluationConfigName = "my_evaluation",
Evaluators = new [] { EvaluatorReference.Builtin(BuiltinEvaluator.HELPFULNESS), EvaluatorReference.Builtin(BuiltinEvaluator.CORRECTNESS) },
DataSource = DataSourceConfig.FromCloudWatchLogs(new CloudWatchLogsDataSourceConfig {
LogGroupNames = new [] { "/aws/bedrock-agentcore/my-agent" },
ServiceNames = new [] { "my-agent.default" }
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// Basic usage with built-in evaluators
evaluation := agentcore.NewOnlineEvaluationConfig(this, jsii.String("MyEvaluation"), &OnlineEvaluationConfigProps{
OnlineEvaluationConfigName: jsii.String("my_evaluation"),
Evaluators: []EvaluatorReference{
agentcore.EvaluatorReference_Builtin(agentcore.BuiltinEvaluator_HELPFULNESS()),
agentcore.EvaluatorReference_*Builtin(agentcore.BuiltinEvaluator_CORRECTNESS()),
},
DataSource: agentcore.DataSourceConfig_FromCloudWatchLogs(&CloudWatchLogsDataSourceConfig{
LogGroupNames: []*string{
jsii.String("/aws/bedrock-agentcore/my-agent"),
},
ServiceNames: []*string{
jsii.String("my-agent.default"),
},
}),
})
Initializer
ts
new BuiltinEvaluator(value: string)
python
BuiltinEvaluator(value: str)
java
new BuiltinEvaluator(String value)
csharp
new BuiltinEvaluator(string value)
go
NewBuiltinEvaluator(Value *string)
Properties
COHERENCEBuiltinEvaluatorCOHERENCEBuiltinEvaluatorCOHERENCEBuiltinEvaluatorCOHERENCEBuiltinEvaluatorCOHERENCEBuiltinEvaluator static #Evaluates whether the response is logically structured and coherent.
CONCISENESSBuiltinEvaluatorCONCISENESSBuiltinEvaluatorCONCISENESSBuiltinEvaluatorCONCISENESSBuiltinEvaluatorCONCISENESSBuiltinEvaluator static #Evaluates whether the response is appropriately brief without missing key information.
CORRECTNESSBuiltinEvaluatorCORRECTNESSBuiltinEvaluatorCORRECTNESSBuiltinEvaluatorCORRECTNESSBuiltinEvaluatorCORRECTNESSBuiltinEvaluator static #Evaluates whether the information in the agent's response is factually accurate.
FAITHFULNESSBuiltinEvaluatorFAITHFULNESSBuiltinEvaluatorFAITHFULNESSBuiltinEvaluatorFAITHFULNESSBuiltinEvaluatorFAITHFULNESSBuiltinEvaluator static #Evaluates whether information in the response is supported by provided context/sources.
GOAL_SUCCESS_RATEBuiltinEvaluatorGOAL_SUCCESS_RATEBuiltinEvaluatorGOAL_SUCCESS_RATEBuiltinEvaluatorGOAL_SUCCESS_RATEBuiltinEvaluatorGOAL_SUCCESS_RATEBuiltinEvaluator static #Evaluates whether the conversation successfully meets the user's goals.
HARMFULNESSBuiltinEvaluatorHARMFULNESSBuiltinEvaluatorHARMFULNESSBuiltinEvaluatorHARMFULNESSBuiltinEvaluatorHARMFULNESSBuiltinEvaluator static #Evaluates whether the response contains harmful content.
HELPFULNESSBuiltinEvaluatorHELPFULNESSBuiltinEvaluatorHELPFULNESSBuiltinEvaluatorHELPFULNESSBuiltinEvaluatorHELPFULNESSBuiltinEvaluator static #Evaluates from user's perspective how useful and valuable the agent's response is.
INSTRUCTION_FOLLOWINGBuiltinEvaluatorINSTRUCTION_FOLLOWINGBuiltinEvaluatorINSTRUCTION_FOLLOWINGBuiltinEvaluatorINSTRUCTION_FOLLOWINGBuiltinEvaluatorINSTRUCTION_FOLLOWINGBuiltinEvaluator static #Measures how well the agent follows the provided system instructions.
REFUSALBuiltinEvaluatorREFUSALBuiltinEvaluatorREFUSALBuiltinEvaluatorREFUSALBuiltinEvaluatorREFUSALBuiltinEvaluator static #Detects when agent evades questions or directly refuses to answer.
RESPONSE_RELEVANCEBuiltinEvaluatorRESPONSE_RELEVANCEBuiltinEvaluatorRESPONSE_RELEVANCEBuiltinEvaluatorRESPONSE_RELEVANCEBuiltinEvaluatorRESPONSE_RELEVANCEBuiltinEvaluator static #Evaluates whether the response appropriately addresses the user's query.
STEREOTYPINGBuiltinEvaluatorSTEREOTYPINGBuiltinEvaluatorSTEREOTYPINGBuiltinEvaluatorSTEREOTYPINGBuiltinEvaluatorSTEREOTYPINGBuiltinEvaluator static #Detects content that makes generalizations about individuals or groups.
TOOL_PARAMETER_ACCURACYBuiltinEvaluatorTOOL_PARAMETER_ACCURACYBuiltinEvaluatorTOOL_PARAMETER_ACCURACYBuiltinEvaluatorTOOL_PARAMETER_ACCURACYBuiltinEvaluatorTOOL_PARAMETER_ACCURACYBuiltinEvaluator static #Evaluates how accurately the agent extracts parameters from user queries.
TOOL_SELECTION_ACCURACYBuiltinEvaluatorTOOL_SELECTION_ACCURACYBuiltinEvaluatorTOOL_SELECTION_ACCURACYBuiltinEvaluatorTOOL_SELECTION_ACCURACYBuiltinEvaluatorTOOL_SELECTION_ACCURACYBuiltinEvaluator static #Evaluates whether the agent selected the appropriate tool for the task.
The string value of the built-in evaluator.