Skip to content

Commit 33f3626

Browse files
authored
Merge branch 'main' into agent-evaluator-support-custom-metric
2 parents 30d54df + 3cf43e3 commit 33f3626

File tree

92 files changed

+4994
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4994
-397
lines changed

.github/workflows/analyze-releases-for-adk-docs-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python-version: '3.11'
2525

2626
- name: Load adk-bot SSH Private Key
27-
uses: webfactory/ssh-agent@v0.9.0
27+
uses: webfactory/ssh-agent@v0.9.1
2828
with:
2929
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
3030

.github/workflows/mypy-new-errors.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
python-version: ['3.10', '3.11', '3.12', '3.13',]
1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Set up Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626

2727
- name: Install uv
28-
uses: astral-sh/setup-uv@v5
28+
uses: astral-sh/setup-uv@v7
2929

3030
- name: Generate Baseline (Main)
3131
run: |

.github/workflows/mypy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
python-version: ['3.10', '3.11', '3.12', '3.13',]
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Install uv
20-
uses: astral-sh/setup-uv@v1
20+
uses: astral-sh/setup-uv@v7
2121

2222
- name: Set up Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626

.github/workflows/python-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python-version: ${{ matrix.python-version }}
3838

3939
- name: Install the latest version of uv
40-
uses: astral-sh/setup-uv@v6
40+
uses: astral-sh/setup-uv@v7
4141

4242
- name: Install dependencies
4343
run: |

contributing/samples/bigquery/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,39 @@ type.
119119

120120
1. Set `CREDENTIALS_TYPE=AuthCredentialTypes.OAUTH2` in `agent.py` and run the agent
121121

122+
### With Agent Engine and Gemini Enterprise
123+
124+
This mode is useful when you deploy the agent to Vertex AI Agent Engine and
125+
want to make it available in Gemini Enterprise, allowing the agent to access
126+
BigQuery on behalf of the end-user. This setup uses OAuth 2.0 managed by
127+
Gemini Enterprise.
128+
129+
1. Create an Authorization resource in Gemini Enterprise by following the guide at
130+
[Register and manage ADK agents hosted on Vertex AI Agent Engine](https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent) to:
131+
* Create OAuth 2.0 credentials in your Google Cloud project.
132+
* Create an Authorization resource in Gemini Enterprise, linking it to your
133+
OAuth 2.0 credentials. When creating this resource, you will define a
134+
unique identifier (`AUTH_ID`).
135+
136+
2. Prepare the sample agent for consuming the access token provided by Gemini
137+
Enterprise and deploy to Vertex AI Agent Engine.
138+
* Set `CREDENTIALS_TYPE=AuthCredentialTypes.HTTP` in `agent.py`. This
139+
configures the agent to use access tokens provided by Gemini Enterprise and
140+
provided by Agent Engine via the tool context.
141+
* Replace `AUTH_ID` in `agent.py` with your authorization resource identifier
142+
from step 1.
143+
* [Deploy your agent to Vertex AI Agent Engine](https://google.github.io/adk-docs/deploy/agent-engine/).
144+
145+
3. [Register your deployed agent with Gemini Enterprise](https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent#register-an-adk-agent), attaching the
146+
Authorization resource `AUTH_ID`. When this agent is invoked through Gemini
147+
Enterprise, an access token obtained using these OAuth credentials will be
148+
passed to the agent and made available in the ADK `tool_context` under the key
149+
`AUTH_ID`, which `agent.py` is configured to use.
150+
151+
Once registered, users interacting with your agent via Gemini Enterprise will
152+
go through an OAuth consent flow, and Agent Engine will provide the agent with
153+
the necessary access tokens to call BigQuery APIs on their behalf.
154+
122155
## Sample prompts
123156

124157
* which weather datasets exist in bigquery public data?

contributing/samples/bigquery/agent.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@
5656
# https://cloud.google.com/iam/docs/service-account-creds#user-managed-keys
5757
creds, _ = google.auth.load_credentials_from_file("service_account_key.json")
5858
credentials_config = BigQueryCredentialsConfig(credentials=creds)
59+
elif CREDENTIALS_TYPE == AuthCredentialTypes.HTTP:
60+
# Initialize the tools to use the externally provided access token. One such
61+
# use case is creating an authorization resource `AUTH_ID` in Gemini
62+
# Enterprise and using it to register an ADK agent deployed to Vertex AI
63+
# Agent Engine with Gemini Enterprise. See for more details:
64+
# https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent.
65+
# This access token will be passed to the agent via the tool context, with
66+
# the key `AUTH_ID`.
67+
credentials_config = BigQueryCredentialsConfig(
68+
external_access_token_key="AUTH_ID"
69+
)
5970
else:
6071
# Initialize the tools to use the application default credentials.
6172
# https://cloud.google.com/docs/authentication/provide-credentials-adc

contributing/samples/gepa/adk_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _adk_agent(
159159

160160

161161
class _UserAgent(base_agent.BaseAgent):
162-
"""An agent that wraps the provided environment and simulates an user."""
162+
"""An agent that wraps the provided environment and simulates a user."""
163163

164164
env: Env
165165

contributing/samples/gepa/tau_bench_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def solve(
103103
max_num_steps: The maximum number of steps to run the agent.
104104
105105
Returns:
106-
The result of the solve.
106+
The result of the solve function.
107107
108108
Raises:
109109
- ValueError: If the LLM inference failed.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from . import agent
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Example agent demonstrating the use of SkillToolset."""
16+
17+
import inspect
18+
19+
from google.adk import Agent
20+
from google.adk.skills import models
21+
from google.adk.tools import skill_toolset
22+
23+
greeting_skill = models.Skill(
24+
frontmatter=models.Frontmatter(
25+
name="greeting-skill",
26+
description=(
27+
"A friendly greeting skill that can say hello to a specific person."
28+
),
29+
),
30+
instructions=(
31+
"Step 1: Read the 'references/hello_world.txt' file to understand how"
32+
" to greet the user. Step 2: Return a greeting based on the reference."
33+
),
34+
resources=models.Resources(
35+
references={
36+
"hello_world.txt": "Hello! 👋👋👋 So glad to have you here! ✨✨✨",
37+
"example.md": "This is an example reference.",
38+
},
39+
),
40+
)
41+
42+
my_skill_toolset = skill_toolset.SkillToolset(skills=[greeting_skill])
43+
44+
root_agent = Agent(
45+
model="gemini-2.5-flash",
46+
name="skill_user_agent",
47+
description="An agent that can use specialized skills.",
48+
instruction=(
49+
"You are a helpful assistant that can leverage skills to perform tasks."
50+
),
51+
tools=[
52+
my_skill_toolset,
53+
],
54+
)

0 commit comments

Comments
 (0)