Skip to content

Fix Custom Evaluators section in AGENTCORE_EVALUATIONS_GUIDE.md#72

Merged
kaleko merged 4 commits intoawslabs:mainfrom
abhilashbalachandran:docs/fix-custom-evaluator-api-params
Mar 31, 2026
Merged

Fix Custom Evaluators section in AGENTCORE_EVALUATIONS_GUIDE.md#72
kaleko merged 4 commits intoawslabs:mainfrom
abhilashbalachandran:docs/fix-custom-evaluator-api-params

Conversation

@abhilashbalachandran
Copy link
Copy Markdown
Contributor

Description

The Custom Evaluators code example had incorrect API parameters that cause ParamValidationError and ValidationException when used against the actual CreateEvaluator API.

What was wrong:

  • Used flat parameters (evaluationLevel, inferenceConfig, instructions, ratingScale) — the API requires these nested under evaluatorConfig.llmAsAJudge
  • Used {{input}} and {{output}} as placeholders — the API expects single-brace placeholders from a fixed set: {context}, {assistant_turn}, {tool_turn}, {available_tools} (varies by evaluation level)
  • Rating scale used {"type": "NUMERIC", "min": 0.0, "max": 1.0} — the API expects {"numerical": [{"value": ..., "label": ..., "definition": ...}]}

What was fixed:

  • Corrected the boto3 create_evaluator example to use the nested evaluatorConfig → llmAsAJudge structure
  • Added a placeholder reference table documenting valid placeholders per evaluation level
  • Added Starter Toolkit SDK example and JSON config file format
  • Added example for adding a custom evaluator to an online config via update_online_evaluation_config
  • Added note about the auto-appended standardization prompt

Verified by:

  • Created a custom evaluator using the corrected API structure — succeeded
  • Added it to a live online evaluation config — succeeded
  • Confirmed evaluation results with scores and explanations appeared in CloudWatch Logs

References:

AWS Docs — Create evaluator
AWS boto3 sdk for bedrock agentcore control: create_evaluator

@abhilashbalachandran abhilashbalachandran requested a review from a team March 26, 2026 19:45
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 26, 2026
@kaleko kaleko merged commit b8a9cfc into awslabs:main Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants