# BuiltinEvaluator

Class · Deprecated

Deprecated: Use the equivalent construct from `aws-cdk-lib/aws-bedrockagentcore` instead.

Built-in evaluators provided by Amazon Bedrock AgentCore.

These evaluators assess different aspects of agent performance
at various levels (session, trace, or tool call).

Obtainable from: BuiltinEvaluator.COHERENCE, BuiltinEvaluator.CONCISENESS, BuiltinEvaluator.CORRECTNESS, BuiltinEvaluator.FAITHFULNESS, BuiltinEvaluator.GOAL_SUCCESS_RATE, BuiltinEvaluator.HARMFULNESS, BuiltinEvaluator.HELPFULNESS, BuiltinEvaluator.INSTRUCTION_FOLLOWING, BuiltinEvaluator.REFUSAL, BuiltinEvaluator.RESPONSE_RELEVANCE, BuiltinEvaluator.STEREOTYPING, BuiltinEvaluator.TOOL_PARAMETER_ACCURACY, BuiltinEvaluator.TOOL_SELECTION_ACCURACY
Used as argument in: [EvaluatorReference.builtin](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.EvaluatorReference.html#builtin)

- Source: [`lib/evaluation/types.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/evaluation/types.ts#L24)

## Example

TypeScript:

```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:

```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:

```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();
```

C#:

```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:

```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

TypeScript:

```ts
new BuiltinEvaluator(value: string)
```

Python:

```python
BuiltinEvaluator(value: str)
```

Java:

```java
new BuiltinEvaluator(String value)
```

C#:

```csharp
new BuiltinEvaluator(string value)
```

Go:

```go
NewBuiltinEvaluator(Value *string)
```

## Properties

- `COHERENCE`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the response is logically structured and coherent.

- `CONCISENESS`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the response is appropriately brief without missing key information.

- `CORRECTNESS`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the information in the agent's response is factually accurate.

- `FAITHFULNESS`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether information in the response is supported by provided context/sources.

- `GOAL_SUCCESS_RATE`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the conversation successfully meets the user's goals.

- `HARMFULNESS`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the response contains harmful content.

- `HELPFULNESS`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates from user's perspective how useful and valuable the agent's response is.

- `INSTRUCTION_FOLLOWING`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Measures how well the agent follows the provided system instructions.

- `REFUSAL`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Detects when agent evades questions or directly refuses to answer.

- `RESPONSE_RELEVANCE`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the response appropriately addresses the user's query.

- `STEREOTYPING`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Detects content that makes generalizations about individuals or groups.

- `TOOL_PARAMETER_ACCURACY`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates how accurately the agent extracts parameters from user queries.

- `TOOL_SELECTION_ACCURACY`: [BuiltinEvaluator](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.BuiltinEvaluator.html) (static) — Evaluates whether the agent selected the appropriate tool for the task.

- `value`: string — The string value of the built-in evaluator.
