Skip to content

Commit 485c472

Browse files
authored
Merge branch 'main' into fix/builder-assistant-special-app-name
2 parents 50f2c0d + 62bcdd3 commit 485c472

21 files changed

Lines changed: 2010 additions & 31 deletions

.agents/skills/adk-pr-triage/SKILL.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ If the user selects **Local Review**, run the following structured sequence:
141141
* *What it does*: This script automatically checks the Google CLA signature status again, attempts to update the PR branch on GitHub by rebasing onto `main`, and if rebase-update is blocked, falls back to updating via a merge commit. It handles all outputs and fallbacks gracefully.
142142
2. **Step 1: Checkout the PR to a Local Branch**:
143143
* Branch naming convention: `pr-triage-<pr_number>-[short_desc]` (e.g. `pr-triage-5875-parallelize-tool-union`).
144+
* Fetch the latest main branch from origin before checking out the PR:
145+
```bash
146+
git fetch origin main
147+
```
144148
* Fetch the pull request ref directly from the remote GitHub endpoint:
145149
```bash
146150
git fetch https://github.com/google/adk-python.git pull/<pr_number>/head:pr-triage-<pr_number>-[short_desc]
@@ -156,9 +160,14 @@ If the user selects **Local Review**, run the following structured sequence:
156160
```bash
157161
git log -1 --pretty=%B
158162
```
159-
* **Multiple Commits**: Squash them into a single local commit first, keeping the overall PR Title and PR Body as the exact commit message. An elegant way to squash is:
163+
* **Multiple Commits**: Squash them into a single local commit first, keeping the overall PR Title and PR Body as the exact commit message, AND preserving the original author. An elegant way to squash is:
160164
```bash
161-
git reset --soft $(git merge-base HEAD origin/main) && git commit -m "<PR message>"
165+
# 1. Capture the original author
166+
ORIG_AUTHOR=$(git log -1 --format='%an <%ae>')
167+
168+
# 2. Reset to base and commit with the original author
169+
git reset --soft $(git merge-base HEAD origin/main)
170+
git commit --author="$ORIG_AUTHOR" -m "<PR message>"
162171
```
163172
* Append `"Merge <PR link>"` to the very end of the commit message (separated by a blank line). Use this elegant shell command to do it in one-shot:
164173
```bash

src/google/adk/cli/api_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ def _setup_runtime_config(self, web_assets_dir: str):
817817
os.makedirs(os.path.dirname(runtime_config_path), exist_ok=True)
818818
with open(runtime_config_path, "w") as f:
819819
json.dump(runtime_config, f, indent=2)
820+
f.write("\n")
820821
except IOError as e:
821822
logger.error(
822823
"Failed to write runtime config file %s: %s", runtime_config_path, e

src/google/adk/evaluation/eval_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ class PrebuiltMetrics(Enum):
6767

6868
MULTI_TURN_TOOL_USE_QUALITY_V1 = "multi_turn_tool_use_quality_v1"
6969

70+
RUBRIC_BASED_MULTI_TURN_TRAJECTORY_QUALITY_V1 = (
71+
"rubric_based_multi_turn_trajectory_quality_v1"
72+
)
73+
7074

7175
MetricName: TypeAlias = Union[str, PrebuiltMetrics]
7276
Threshold: TypeAlias = float

src/google/adk/evaluation/metric_evaluator_registry.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from .metric_info_providers import PerTurnUserSimulatorQualityV1MetricInfoProvider
3434
from .metric_info_providers import ResponseEvaluatorMetricInfoProvider
3535
from .metric_info_providers import RubricBasedFinalResponseQualityV1EvaluatorMetricInfoProvider
36+
from .metric_info_providers import RubricBasedMultiTurnTrajectoryMetricInfoProvider
3637
from .metric_info_providers import RubricBasedToolUseV1EvaluatorMetricInfoProvider
3738
from .metric_info_providers import SafetyEvaluatorV1MetricInfoProvider
3839
from .metric_info_providers import TrajectoryEvaluatorMetricInfoProvider
@@ -41,6 +42,7 @@
4142
from .multi_turn_trajectory_quality_evaluator import MultiTurnTrajectoryQualityV1Evaluator
4243
from .response_evaluator import ResponseEvaluator
4344
from .rubric_based_final_response_quality_v1 import RubricBasedFinalResponseQualityV1Evaluator
45+
from .rubric_based_multi_turn_trajectory_evaluator import RubricBasedMultiTurnTrajectoryEvaluator
4446
from .rubric_based_tool_use_quality_v1 import RubricBasedToolUseV1Evaluator
4547
from .safety_evaluator import SafetyEvaluatorV1
4648
from .simulation.per_turn_user_simulator_quality_v1 import PerTurnUserSimulatorQualityV1
@@ -164,6 +166,10 @@ def _get_default_metric_evaluator_registry() -> MetricEvaluatorRegistry:
164166
metric_info=PerTurnUserSimulatorQualityV1MetricInfoProvider().get_metric_info(),
165167
evaluator=PerTurnUserSimulatorQualityV1,
166168
)
169+
metric_evaluator_registry.register_evaluator(
170+
metric_info=RubricBasedMultiTurnTrajectoryMetricInfoProvider().get_metric_info(),
171+
evaluator=RubricBasedMultiTurnTrajectoryEvaluator,
172+
)
167173

168174
return metric_evaluator_registry
169175

src/google/adk/evaluation/metric_info_providers.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,21 @@ def get_metric_info(self) -> MetricInfo:
242242
interval=Interval(min_value=0.0, max_value=1.0)
243243
),
244244
)
245+
246+
247+
class RubricBasedMultiTurnTrajectoryMetricInfoProvider(MetricInfoProvider):
248+
"""Metric info provider for RubricBasedMultiTurnTrajectory."""
249+
250+
def get_metric_info(self) -> MetricInfo:
251+
return MetricInfo(
252+
metric_name=PrebuiltMetrics.RUBRIC_BASED_MULTI_TURN_TRAJECTORY_QUALITY_V1,
253+
description=(
254+
"This metric evaluates the agent's multi-turn trajectory against"
255+
" a set of user-provided rubrics using an LLM as a judge. Value"
256+
" range for this metric is [0,1], with values closer to 1 more"
257+
" desirable."
258+
),
259+
metric_value_info=MetricValueInfo(
260+
interval=Interval(min_value=0.0, max_value=1.0)
261+
),
262+
)

0 commit comments

Comments
 (0)