EvaluatorReference
- class aws_cdk.aws_bedrock_agentcore_alpha.EvaluatorReference(*args: Any, **kwargs)
Bases:
object(experimental) 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
- Stability:
experimental
Example:
# Using custom evaluators # my_custom_evaluator: agentcore.IEvaluator # Using built-in evaluators helpfulness = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS) custom = agentcore.EvaluatorReference.custom(my_custom_evaluator)
Methods
- bind()
(experimental) Binds the evaluator reference to produce the L1 property.
- Stability:
experimental
- Return type:
Attributes
- evaluator_id
(experimental) The evaluator identifier.
- Stability:
experimental
Static Methods
- classmethod builtin(evaluator)
(experimental) 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).
- Parameters:
evaluator (
BuiltinEvaluator) –The built-in evaluator to reference.
- Return type:
- Returns:
An EvaluatorReference instance
- Stability:
experimental
Example:
helpfulness = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS) goal_success = agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.GOAL_SUCCESS_RATE)
- classmethod custom(evaluator)
(experimental) Creates a reference to a custom evaluator.
Custom evaluators are created using the
Evaluatorconstruct and can be LLM-as-a-Judge or code-based (Lambda) evaluators.- Parameters:
evaluator (
IEvaluator) –The custom evaluator construct to reference.
- Return type:
- Returns:
An EvaluatorReference instance
- Stability:
experimental
Example:
# my_custom_evaluator: agentcore.IEvaluator ref = agentcore.EvaluatorReference.custom(my_custom_evaluator)