docs(evaluate): document rubric_based_multi_turn_trajectory_quality_v1 and clarify Rubric.type / criterion.rubrics#1853
Conversation
…1 and clarify Rubric.type / criterion.rubrics Closes three gaps in docs/evaluate/criteria.md: 1. Adds a section for `rubric_based_multi_turn_trajectory_quality_v1`. The metric is registered in metric_evaluator_registry.py and implemented in rubric_based_multi_turn_trajectory_evaluator.py upstream, but the explanatory section that its two sibling rubric-based metrics have was missing. Also adds the corresponding row to the criteria table. 2. Adds a "Notes On Rubrics" subsection under each of the three rubric-based metric sections, stating the required Rubric.type value (FINAL_RESPONSE_QUALITY / TOOL_USE_QUALITY / TRAJECTORY_QUALITY) and the criterion-vs-EvalCase rubric relationship (criterion.rubrics required and non-empty; EvalCase.rubrics is additive, filtered by type). 3. Adds the explicit `type` field to existing JSON examples in the two existing rubric-based sections so users have a complete template. Refs google#1852.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
koverholt
left a comment
There was a problem hiding this comment.
Thanks for the PR and additions / fixes! The new section, table row, and the non-empty/additive notes are accurate and verified against adk-python.
Requesting changes on one substantive point, flagged inline: the Rubric.type filter only applies to EvalCase.rubrics, not to criterion-level rubrics in EvalConfig. The "Notes On Rubrics" bullets state it as a blanket rule, and the examples add type to criterion-level rubrics, which together imply criterion rubrics are dropped on a type mismatch, which they aren't. See the inline suggestions on both the bullets and the example type fields across all three sections. Everything else looks good.
(Cross-referencing #1833 as the original adk-bot issue where these were originally flagged.)
|
|
||
| - Rubrics on `EvalConfig.criteria["rubric_based_final_response_quality_v1"].rubrics` **must be non-empty** — `RubricBasedEvaluator` asserts this at init time. | ||
| - Rubrics on `EvalCase.rubrics` are *additive* on top of the criterion-level list, not a replacement. The effective rubric set passed to the judge is the union of both. | ||
| - Only rubrics whose `type` field is `"FINAL_RESPONSE_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"TRAJECTORY_QUALITY"`, `"TOOL_USE_QUALITY"`) are ignored. |
There was a problem hiding this comment.
This is inaccurate for criterion-level rubrics. In create_effective_rubrics_list, only rubrics from EvalCase.rubrics are filtered by type; the criterion-level rubrics in EvalConfig are added unconditionally regardless of type. As written, a reader will think their EvalConfig rubrics get dropped unless type matches.
| - Only rubrics whose `type` field is `"FINAL_RESPONSE_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"TRAJECTORY_QUALITY"`, `"TOOL_USE_QUALITY"`) are ignored. | |
| - Rubrics supplied per-case via `EvalCase.rubrics` are filtered by `type`: only those whose `type` is `"FINAL_RESPONSE_QUALITY"` are merged in. Criterion-level rubrics in `EvalConfig` are **not** filtered by `type`. |
|
|
||
| - Rubrics on `EvalConfig.criteria["rubric_based_tool_use_quality_v1"].rubrics` **must be non-empty** — `RubricBasedEvaluator` asserts this at init time. | ||
| - Rubrics on `EvalCase.rubrics` are *additive* on top of the criterion-level list, not a replacement. The effective rubric set passed to the judge is the union of both. | ||
| - Only rubrics whose `type` field is `"TOOL_USE_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"FINAL_RESPONSE_QUALITY"`, `"TRAJECTORY_QUALITY"`) are ignored. |
There was a problem hiding this comment.
Same scoping issue: only EvalCase.rubrics are filtered by type in create_effective_rubrics_list. Criterion-level rubrics are added unconditionally.
| - Only rubrics whose `type` field is `"TOOL_USE_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"FINAL_RESPONSE_QUALITY"`, `"TRAJECTORY_QUALITY"`) are ignored. | |
| - Rubrics supplied per-case via `EvalCase.rubrics` are filtered by `type`: only those whose `type` is `"TOOL_USE_QUALITY"` are merged in. Criterion-level rubrics in `EvalConfig` are **not** filtered by `type`. |
|
|
||
| - Rubrics on `EvalConfig.criteria["rubric_based_multi_turn_trajectory_quality_v1"].rubrics` **must be non-empty** — `RubricBasedEvaluator` asserts this at init time. | ||
| - Rubrics on `EvalCase.rubrics` are *additive* on top of the criterion-level list, not a replacement. The effective rubric set passed to the judge is the union of both. | ||
| - Only rubrics whose `type` field is `"TRAJECTORY_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"FINAL_RESPONSE_QUALITY"`, `"TOOL_USE_QUALITY"`) are ignored. |
There was a problem hiding this comment.
Same scoping issue: only EvalCase.rubrics are filtered by type. Criterion-level rubrics are added unconditionally.
| - Only rubrics whose `type` field is `"TRAJECTORY_QUALITY"` are picked up by this criterion. Rubrics with other `type` values (e.g. `"FINAL_RESPONSE_QUALITY"`, `"TOOL_USE_QUALITY"`) are ignored. | |
| - Rubrics supplied per-case via `EvalCase.rubrics` are filtered by `type`: only those whose `type` is `"TRAJECTORY_QUALITY"` are merged in. Criterion-level rubrics in `EvalConfig` are **not** filtered by `type`. |
| "text_property": "The agent's response is direct and to the point." | ||
| } | ||
| }, | ||
| "type": "FINAL_RESPONSE_QUALITY" |
There was a problem hiding this comment.
type on a criterion-level rubric has no effect (it's only used to filter EvalCase.rubrics). Adding it here implies criterion rubrics are type-filtered, which they aren't. Recommend removing these two type lines, or moving the demonstration into a separate short EvalCase.rubrics snippet where type actually matters.
| "text_property": "The agent calls the GeoCoding tool before calling the GetWeather tool." | ||
| } | ||
| }, | ||
| "type": "TOOL_USE_QUALITY" |
There was a problem hiding this comment.
Same as the final-response example: remove type from these criterion-level rubrics, or demonstrate it in an EvalCase.rubrics example instead, since type is inert at the criterion level.
| "rubric_content": { | ||
| "text_property": "The agent asks about individual factors (age, prior conditions, current medication) before giving any individualized advice." | ||
| }, | ||
| "type": "TRAJECTORY_QUALITY" |
There was a problem hiding this comment.
Same as above: type on criterion-level rubrics is inert (only EvalCase.rubrics are type-filtered). Remove or relocate to an EvalCase.rubrics example.
| "rubric_content": { | ||
| "text_property": "When the user discloses risk-relevant information late in the conversation, the agent revisits and corrects earlier advice rather than leaving it standing." | ||
| }, | ||
| "type": "TRAJECTORY_QUALITY" |
There was a problem hiding this comment.
Same as line 461: type here is inert (criterion-level rubric). Remove both, or move to an EvalCase.rubrics example.
Fixes #1852.
What
Closes a documentation gap around rubric-based evaluation criteria in
docs/evaluate/criteria.md. Three small additions:rubric_based_multi_turn_trajectory_quality_v1. The metric is registered inmetric_evaluator_registry.pyand exists in upstream ADK 2.x, but the explanatory section that the other two rubric-based metrics have was missing. Also adds the corresponding row to the criteria table at the top of the page.Rubric.typenotes added to each rubric-based metric section. EachRubricBasedEvaluatorsubclass uses aRUBRIC_TYPEClassVar that acts as a filter — rubrics carried onEvalCase.rubricsare only picked up when theirtypefield matches the evaluator's expected value:Rubric.typerubric_based_final_response_quality_v1FINAL_RESPONSE_QUALITYrubric_based_tool_use_quality_v1TOOL_USE_QUALITYrubric_based_multi_turn_trajectory_quality_v1TRAJECTORY_QUALITYtypefield explicitly so users have a complete template.criterion.rubricsrequirement clarified.RubricBasedEvaluator.__init__assertscriterion.rubricsis non-empty (rubric_based_evaluator.py:332), andEvalCase.rubricsis additive on top of the criterion-level list (create_effective_rubrics_list). The "Notes On Rubrics" block in each rubric-based metric section now states both.Why
Without these notes, three failure modes happen quickly in practice (see #1852 for full context):
rubric_based_multi_turn_trajectory_quality_v1in the criteria table but no example of how to build anEvalConfigentry for it.EvalCase.rubricswithtypeunset (or mismatched) and the rubrics are silently dropped.EvalCase.rubricsand none on the criterion, and hitAssertionError: Rubrics are required.at evaluator init.All three are observable in
RubricBasedEvaluatorsource but aren't surfaced in the user-facing docs.Changes
Only
docs/evaluate/criteria.mdis modified. No code changes.Testing
mkdocs servelocally; verified the new section renders, the criteria table at the top is consistent with the sections below, and existing internal anchors still resolve.CLA
Individual CLA signed;
cla/googlecheck is passing on this PR.Notes