LlmAsAJudgeOptions Struct
Options for configuring an LLM-as-a-Judge custom evaluator.
Uses a foundation model to assess agent performance based on custom instructions and a rating scale.
Example
// Create a custom LLM-as-a-Judge evaluator
const evaluator = new agentcore.Evaluator(this, 'MyEvaluator', {
evaluatorName: 'my_custom_evaluator',
level: agentcore.EvaluationLevel.SESSION,
evaluatorConfig: agentcore.EvaluatorConfig.llmAsAJudge({
instructions: 'Evaluate whether the agent response is helpful and accurate.',
modelId: 'us.anthropic.claude-sonnet-4-6',
ratingScale: agentcore.EvaluatorRatingScale.categorical([
{ label: 'Good', definition: 'The response is helpful and accurate.' },
{ label: 'Bad', definition: 'The response is not helpful or contains errors.' },
]),
}),
});
// Use the custom evaluator in an online evaluation configuration
new agentcore.OnlineEvaluationConfig(this, 'MyEvaluation', {
onlineEvaluationConfigName: 'my_evaluation',
evaluators: [
agentcore.EvaluatorSelector.builtin(agentcore.BuiltinEvaluator.HELPFULNESS),
agentcore.EvaluatorSelector.custom(evaluator),
],
dataSource: agentcore.DataSourceConfig.fromCloudWatchLogs({
logGroupNames: ['/aws/bedrock-agentcore/my-agent'],
serviceNames: ['my-agent.default'],
}),
});
Properties
additionalModelRequestFieldsoptional{ [key: string]: any }additional_model_request_fieldsoptionaltyping.Mapping[str, Any]additionalModelRequestFieldsoptionalMap<String, Object>AdditionalModelRequestFieldsoptionalIDictionary<string, object>AdditionalModelRequestFieldsoptional*map[string]interface{}#Default: No additional fields
inferenceConfigoptionalEvaluatorInferenceConfiginference_configoptionalEvaluatorInferenceConfiginferenceConfigoptionalEvaluatorInferenceConfigInferenceConfigoptionalEvaluatorInferenceConfigInferenceConfigoptionalEvaluatorInferenceConfig#Default: The foundation model's default inference parameters are used
When not specified, the foundation model uses its own default values for maxTokens, temperature, and topP.
notes
These instructions define the evaluation criteria, context, and expected behavior. Instructions must contain placeholders appropriate for the evaluation level (e.g., {context}, {available_tools} for SESSION level).
Note: Evaluators using reference-input placeholders (e.g., {expected_tool_trajectory}, {assertions}, {expected_response}) are only compatible with on-demand evaluation, not online evaluation.
Accepts standard model IDs (e.g., 'anthropic.claude-sonnet-4-6') and cross-region inference profile IDs with region prefixes (e.g., 'us.anthropic.claude-sonnet-4-6', 'eu.anthropic.claude-sonnet-4-6').
ratingScaleEvaluatorRatingScalerating_scaleEvaluatorRatingScaleratingScaleEvaluatorRatingScaleRatingScaleEvaluatorRatingScaleRatingScaleEvaluatorRatingScalerequired#