OnlineEvaluationConfigProps
- class aws_cdk.aws_bedrockagentcore.OnlineEvaluationConfigProps(*, online_evaluation_config_name, description=None, execution_role=None, execution_status=None, filters=None, sampling_percentage=None, session_timeout=None, data_source, evaluators, tags=None)
Bases:
OnlineEvaluationBasePropsProperties for creating an OnlineEvaluationConfig.
- Parameters:
online_evaluation_config_name (
str) – The name of the online evaluation configuration. Must be unique within your account. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long.description (
Optional[str]) – The description of the online evaluation configuration. Default: - No descriptionexecution_role (
Optional[IRole]) – The IAM role that provides permissions for the evaluation to access AWS services. If not provided, a role will be created automatically with the required permissions including cross-region Bedrock model invocation (to support cross-region inference profiles). For strict cost controls or data residency compliance, provide a custom role with region-scoped permissions. Default: - A new role will be createdexecution_status (
Optional[ExecutionStatus]) – The execution status of the online evaluation configuration. Controls whether the evaluation actively processes agent traces. Default: ExecutionStatus.ENABLEDfilters (
Optional[Sequence[Union[FilterConfig,Dict[str,Any]]]]) – The list of filters that determine which agent traces should be evaluated. Default: - No filters (evaluate all sampled traces)sampling_percentage (
Union[int,float,None]) – The percentage of agent traces to sample for evaluation. Default: 10session_timeout (
Optional[Duration]) – The duration of inactivity after which an agent session is considered complete and ready for evaluation. Must be between 1 minute and 1440 minutes (24 hours). Default: Duration.minutes(15)data_source (
DataSourceConfig) – The data source configuration that specifies where to read agent traces from.evaluators (
Sequence[EvaluatorSelector]) – The list of evaluators to apply during online evaluation. Can include both built-in evaluators and custom evaluators.tags (
Optional[Mapping[str,str]]) – Tags for the online evaluation configuration. A list of key:value pairs of tags to apply to this OnlineEvaluationConfig resource. Default: - No tags
- ExampleMetadata:
fixture=default infused
Example:
# custom_evaluator: agentcore.Evaluator evaluation = agentcore.OnlineEvaluationConfig(self, "MixedEvaluation", online_evaluation_config_name="mixed_evaluation", evaluators=[ # Built-in evaluators agentcore.EvaluatorSelector.builtin(agentcore.BuiltinEvaluator.HELPFULNESS), agentcore.EvaluatorSelector.builtin(agentcore.BuiltinEvaluator.CORRECTNESS), # Custom evaluator agentcore.EvaluatorSelector.custom(custom_evaluator) ], data_source=agentcore.DataSourceConfig.from_cloud_watch_logs( log_group_names=["/aws/bedrock-agentcore/my-agent"], service_names=["my-agent.default"] ) )
Attributes
- data_source
The data source configuration that specifies where to read agent traces from.
- description
The description of the online evaluation configuration.
- Default:
No description
- MaxLength:
200
- evaluators
The list of evaluators to apply during online evaluation.
Can include both built-in evaluators and custom evaluators.
- Maximum:
10
- Minimum:
1
- execution_role
The IAM role that provides permissions for the evaluation to access AWS services.
If not provided, a role will be created automatically with the required permissions including cross-region Bedrock model invocation (to support cross-region inference profiles). For strict cost controls or data residency compliance, provide a custom role with region-scoped permissions.
- Default:
A new role will be created
- execution_status
The execution status of the online evaluation configuration.
Controls whether the evaluation actively processes agent traces.
- Default:
ExecutionStatus.ENABLED
- filters
The list of filters that determine which agent traces should be evaluated.
- Default:
No filters (evaluate all sampled traces)
- Maximum:
5
- online_evaluation_config_name
The name of the online evaluation configuration.
Must be unique within your account. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long.
- Pattern:
^[a-zA-Z][a-zA-Z0-9_]{0,47}$
- sampling_percentage
The percentage of agent traces to sample for evaluation.
- Default:
10
- Maximum:
100
- Minimum:
0.01
- session_timeout
The duration of inactivity after which an agent session is considered complete and ready for evaluation.
Must be between 1 minute and 1440 minutes (24 hours).
- Default:
Duration.minutes(15)
- tags
Tags for the online evaluation configuration.
A list of key:value pairs of tags to apply to this OnlineEvaluationConfig resource.
- Default:
No tags