Skip to content

Commit e8b1608

Browse files
Siddhartha90claude
andcommitted
fix: use getattr instead of isinstance for criterion check
The criterion may be deserialized as BaseCriterion (which accepts extra fields via extra="allow") rather than RubricsBasedCriterion, so isinstance check fails even when evaluate_full_response is present. Using getattr with a default handles both cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d0a721 commit e8b1608

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/google/adk/evaluation/rubric_based_final_response_quality_v1.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ def format_auto_rater_prompt(
280280
# the final response. This is useful for agents that stream text, call
281281
# tools, then stream more text within a single invocation.
282282
criterion = self._eval_metric.criterion
283-
evaluate_full = (
284-
isinstance(criterion, RubricsBasedCriterion)
285-
and criterion.evaluate_full_response
286-
)
283+
evaluate_full = getattr(criterion, "evaluate_full_response", False)
287284

288285
if evaluate_full:
289286
final_response = self._get_full_response_text(actual_invocation)

0 commit comments

Comments
 (0)