Skip to content

Commit 15bdafb

Browse files
authored
Merge branch 'main' into feat/session-data-masking
2 parents 90c7e0b + 987c809 commit 15bdafb

87 files changed

Lines changed: 9029 additions & 4967 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.30.0"
2+
".": "1.31.0"
33
}

.github/release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3-
"last-release-sha": "80a7ecf4b31e4c6de4a1425b03422f384c1a032d",
3+
"last-release-sha": "d69477f6ff348311e1d53e3f2c389dcf037fb049",
44
"packages": {
55
".": {
66
"release-type": "python",

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Changelog
22

3+
## [1.31.0](https://github.com/google/adk-python/compare/v1.30.0...v1.31.0) (2026-04-16)
4+
5+
6+
### Features
7+
8+
* Add "google-adk" user agent to Parameter Manager and Secret Manager clients ([b8e8f6b](https://github.com/google/adk-python/commit/b8e8f6b90290e48e134f48bbe7e2b800276e7269))
9+
* Add support for memories.ingest_events in VertexAiMemoryBankService ([d69477f](https://github.com/google/adk-python/commit/d69477f6ff348311e1d53e3f2c389dcf037fb049))
10+
* Add Vertex AI Agent Engine Sandbox integration for computer use ([7686848](https://github.com/google/adk-python/commit/76868485519090c5fa2a0287bccca040e438d94e))
11+
* Firestore support ([1a9df8f](https://github.com/google/adk-python/commit/1a9df8f77410a08a85d04744f199d25f20d55ebd))
12+
* **live:** Add live_session_id to LlmResponse ([bf84e2c](https://github.com/google/adk-python/commit/bf84e2cee84f04c886914eb72318875f3c29ea13))
13+
14+
15+
### Bug Fixes
16+
17+
* Bump minimum mcp version from 1.23.0 to 1.24.0 ([494c360](https://github.com/google/adk-python/commit/494c360b2a82af5130f153ff615f84e4c2604a73))
18+
* **cli:** correct console URL path after adk deploy agent_engine ([64ed1a6](https://github.com/google/adk-python/commit/64ed1a68c98e32d61aff43857fa4e756b129b13f)), closes [#5336](https://github.com/google/adk-python/issues/5336)
19+
* execute on_event_callback before append_event to persist plugin modifications ([454188d](https://github.com/google/adk-python/commit/454188de5de0ef44adb7716230eacddcb060dab2)), closes [#3990](https://github.com/google/adk-python/issues/3990)
20+
* make `_EvalMetricResultWithInvocation.expected_invocation` `Optional` for conversation_scenario support ([#5215](https://github.com/google/adk-python/issues/5215)) ([a4c9387](https://github.com/google/adk-python/commit/a4c938775764794f42e00a89e3cb33da5119c38b))
21+
* Pass in auth headers with header provider instead of connection params ([e12b0af](https://github.com/google/adk-python/commit/e12b0af20d9a025e3d75f309de836b139b6d3e88))
22+
* populate required fields in FunctionDeclaration json_schema fallback ([9b9faa4](https://github.com/google/adk-python/commit/9b9faa4ba21d566252e4c25bd55ab9db2658051e))
23+
* Resolve BigQuery plugin issues with A2A transfers, spans, and metadata ([9ca8c38](https://github.com/google/adk-python/commit/9ca8c384324e07e945146359f21010b438eb1bc6))
24+
* upgrade google-genai lower bound ([8bc5728](https://github.com/google/adk-python/commit/8bc57283f3c584a5a6d6d774a316fe63342ed481))
25+
26+
27+
### Code Refactoring
28+
29+
* **live:** Use `send_client_content` to send conversation history ([67dc2eb](https://github.com/google/adk-python/commit/67dc2ebfd42f175f2dd6ea58df51a03c575062c6))
30+
* **live:** Use `send_tool_response` for function responses ([70c5fc8](https://github.com/google/adk-python/commit/70c5fc83a62d1e81d20986223f5c275b086f9822))
31+
32+
33+
### Documentation
34+
35+
* update MCP Toolbox branding, binary version, and asset references ([47fa7b7](https://github.com/google/adk-python/commit/47fa7b743c37e3aa8302e78be552876c2784e6ff))
36+
337
## [1.30.0](https://github.com/google/adk-python/compare/v1.29.0...v1.30.0) (2026-04-13)
438

539

contributing/samples/local_environment_skill/agent.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,7 @@
1515

1616
from google.adk import Agent
1717
from google.adk.environment import LocalEnvironment
18-
from google.adk.tools.base_tool import BaseTool
1918
from google.adk.tools.environment import EnvironmentToolset
20-
from google.genai import types
21-
22-
23-
class GetTimezoneTool(BaseTool):
24-
"""A tool to get the timezone for a given location."""
25-
26-
def __init__(self):
27-
super().__init__(
28-
name="get_timezone",
29-
description="Returns the timezone for a given location.",
30-
)
31-
32-
def _get_declaration(self) -> types.FunctionDeclaration | None:
33-
return types.FunctionDeclaration(
34-
name=self.name,
35-
description=self.description,
36-
parameters_json_schema={
37-
"type": "object",
38-
"properties": {
39-
"location": {
40-
"type": "string",
41-
"description": "The location to get the timezone for.",
42-
},
43-
},
44-
"required": ["location"],
45-
},
46-
)
47-
48-
async def run_async(self, *, args: dict, tool_context) -> str:
49-
return f"The timezone for {args['location']} is UTC+00:00."
5019

5120

5221
def get_wind_speed(location: str) -> str:
@@ -89,7 +58,6 @@ def get_wind_speed(location: str) -> str:
8958
working_dir=pathlib.Path(__file__).parent
9059
),
9160
),
92-
GetTimezoneTool(),
9361
get_wind_speed,
9462
],
9563
)

contributing/samples/local_environment_skill/skills/weather-skill/SKILL.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
name: weather-skill
33
description: A skill that provides weather information based on reference data.
4-
metadata:
5-
adk_additional_tools:
6-
- get_wind_speed
74
---
85

96
Step 1: Check 'references/weather_info.md' for the current weather.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2025 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: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2025 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+
"""Sample agent using Vertex AI Agent Engine Sandbox for computer use.
16+
17+
This sample demonstrates how to use the AgentEngineSandboxComputer with ADK
18+
to create a computer use agent that operates in a remote sandbox environment.
19+
20+
Prerequisites:
21+
1. A GCP project with Agent Engine setup (https://docs.cloud.google.com/agent-builder/agent-engine/set-up)
22+
2. A service account with roles/iam.serviceAccountTokenCreator permission
23+
3. Environment variables in contributing/samples/.env:
24+
- GOOGLE_CLOUD_PROJECT: Your GCP project ID
25+
- VMAAS_SERVICE_ACCOUNT: Your service account email
26+
- VMAAS_SANDBOX_NAME: (Optional) Existing sandbox resource name for BYOS mode
27+
28+
Usage:
29+
# Run via ADK web UI
30+
adk web contributing/samples/sandbox_computer_use
31+
32+
# Run via main.py
33+
cd contributing/samples
34+
python -m sandbox_computer_use.main
35+
"""
36+
37+
import os
38+
39+
from dotenv import load_dotenv
40+
from google.adk import Agent
41+
from google.adk.integrations.vmaas import AgentEngineSandboxComputer
42+
from google.adk.tools.computer_use.computer_use_toolset import ComputerUseToolset
43+
44+
# Load environment variables from .env file
45+
load_dotenv(override=True)
46+
47+
# Configuration from environment variables
48+
PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT")
49+
SERVICE_ACCOUNT = os.environ.get("VMAAS_SERVICE_ACCOUNT")
50+
51+
# Optional: Use existing sandbox (BYOS mode)
52+
# Format: projects/{project}/locations/{location}/reasoningEngines/{id}/sandboxEnvironments/{id}
53+
SANDBOX_NAME = os.environ.get("SANDBOX_NAME") or os.environ.get(
54+
"VMAAS_SANDBOX_NAME"
55+
)
56+
57+
# Create the sandbox computer
58+
sandbox_computer = AgentEngineSandboxComputer(
59+
project_id=PROJECT_ID,
60+
service_account_email=SERVICE_ACCOUNT,
61+
sandbox_name=SANDBOX_NAME,
62+
search_engine_url="https://www.google.com",
63+
)
64+
65+
# Create agent with the computer use toolset
66+
root_agent = Agent(
67+
model="gemini-2.5-computer-use-preview-10-2025",
68+
name="sandbox_computer_use_agent",
69+
description=(
70+
"A computer use agent that operates a browser in a remote Vertex AI"
71+
" sandbox environment to complete user tasks."
72+
),
73+
instruction="""You are a computer use agent that can operate a web browser
74+
to help users complete tasks. You have access to browser controls including:
75+
- Navigation (go to URLs, back, forward, search)
76+
- Mouse actions (click, hover, scroll, drag and drop)
77+
- Keyboard input (type text, key combinations)
78+
- Screenshots (to see the current state)
79+
80+
When given a task:
81+
1. Think about what steps are needed to accomplish it
82+
2. Take actions one at a time, observing the results
83+
3. If something doesn't work, try alternative approaches
84+
4. Report back when the task is complete or if you encounter issues
85+
86+
Be careful with sensitive information and always respect website terms of service.
87+
""",
88+
tools=[ComputerUseToolset(computer=sandbox_computer)],
89+
)
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Copyright 2025 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+
"""Main script to run the sandbox computer use agent.
16+
17+
This script demonstrates how to run the sandbox computer use agent
18+
programmatically using the InMemoryRunner.
19+
20+
Prerequisites:
21+
1. Set environment variables:
22+
- GOOGLE_CLOUD_PROJECT: Your GCP project ID
23+
- VMAAS_SERVICE_ACCOUNT: Your service account email with
24+
roles/iam.serviceAccountTokenCreator permission
25+
26+
Usage:
27+
cd contributing/samples
28+
python -m sandbox_computer_use.main
29+
"""
30+
31+
import asyncio
32+
import os
33+
import time
34+
35+
from dotenv import load_dotenv
36+
from google.adk.cli.utils import logs
37+
from google.adk.runners import InMemoryRunner
38+
from google.adk.sessions.session import Session
39+
from google.genai import types
40+
41+
# Import the agent module
42+
from . import agent
43+
44+
load_dotenv(override=True)
45+
logs.log_to_tmp_folder()
46+
47+
48+
async def run_prompt(
49+
runner: InMemoryRunner,
50+
session: Session,
51+
user_id: str,
52+
message: str,
53+
) -> None:
54+
"""Run a single prompt and print the response.
55+
56+
Args:
57+
runner: The agent runner.
58+
session: The session to use.
59+
user_id: The user ID.
60+
message: The user message.
61+
"""
62+
content = types.Content(
63+
role="user", parts=[types.Part.from_text(text=message)]
64+
)
65+
print(f"\n** User says: {message}")
66+
print("-" * 40)
67+
68+
async for event in runner.run_async(
69+
user_id=user_id,
70+
session_id=session.id,
71+
new_message=content,
72+
):
73+
if event.content and event.content.parts:
74+
for part in event.content.parts:
75+
if part.text:
76+
print(f"** {event.author}: {part.text}")
77+
elif hasattr(part, "inline_data") and part.inline_data:
78+
# Screenshot received
79+
print(f"** {event.author}: [Screenshot received]")
80+
81+
82+
async def main():
83+
"""Main function to run the sandbox computer use agent."""
84+
# Validate environment
85+
project_id = os.environ.get("GOOGLE_CLOUD_PROJECT")
86+
service_account = os.environ.get("VMAAS_SERVICE_ACCOUNT")
87+
88+
if not project_id:
89+
print("ERROR: GOOGLE_CLOUD_PROJECT environment variable is not set.")
90+
print("Please set it to your GCP project ID.")
91+
return
92+
93+
if not service_account:
94+
print("ERROR: VMAAS_SERVICE_ACCOUNT environment variable is not set.")
95+
print(
96+
"Please set it to your service account email with"
97+
" roles/iam.serviceAccountTokenCreator permission."
98+
)
99+
return
100+
101+
print("=" * 60)
102+
print("Sandbox Computer Use Agent Demo")
103+
print("=" * 60)
104+
print(f"Project: {project_id}")
105+
print(f"Service Account: {service_account}")
106+
print("=" * 60)
107+
108+
app_name = "sandbox_computer_use_demo"
109+
user_id = "demo_user"
110+
111+
# Create runner and session
112+
runner = InMemoryRunner(
113+
agent=agent.root_agent,
114+
app_name=app_name,
115+
)
116+
session = await runner.session_service.create_session(
117+
app_name=app_name, user_id=user_id
118+
)
119+
120+
print(f"\nSession created: {session.id}")
121+
print("\nStarting agent interaction...")
122+
123+
start_time = time.time()
124+
125+
# Example interaction: Navigate and describe
126+
await run_prompt(
127+
runner,
128+
session,
129+
user_id,
130+
"Navigate to https://www.google.com and tell me what you see.",
131+
)
132+
133+
# Example interaction: Search for something
134+
await run_prompt(
135+
runner,
136+
session,
137+
user_id,
138+
"Search for 'Vertex AI Agent Engine' and tell me the first result.",
139+
)
140+
141+
end_time = time.time()
142+
143+
print("\n" + "=" * 60)
144+
print(f"Demo completed in {end_time - start_time:.2f} seconds")
145+
print("=" * 60)
146+
147+
# Print session state to show sandbox info
148+
session = await runner.session_service.get_session(
149+
app_name=app_name, user_id=user_id, session_id=session.id
150+
)
151+
print("\nSession state (sandbox info):")
152+
for key, value in session.state.items():
153+
if key.startswith("_vmaas_"):
154+
# Mask token for security
155+
if "token" in key.lower():
156+
print(f" {key}: [REDACTED]")
157+
else:
158+
print(f" {key}: {value}")
159+
160+
161+
if __name__ == "__main__":
162+
asyncio.run(main())

contributing/samples/toolbox_agent/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Before starting, ensure you have Python installed on your system.
1515
Run the following command to download and install the MCP Toolbox binary.
1616

1717
> [!NOTE]
18-
> You can find the latest version on the [Releases page](https://github.com/googleapis/genai-toolbox/releases) and update the version in the URL below.
18+
> You can find the latest version on the [Releases page](https://github.com/googleapis/mcp-toolbox/releases) and update the version in the URL below.
1919
2020
```bash
2121
export OS="linux/amd64" # one of linux/amd64, darwin/arm64, darwin/amd64, or windows/amd64
22-
curl -O https://storage.googleapis.com/genai-toolbox/v0.31.0/$OS/toolbox
22+
curl -O https://storage.googleapis.com/mcp-toolbox-for-databases/v1.1.0/$OS/toolbox
2323
chmod +x toolbox
2424
```
2525

0 commit comments

Comments
 (0)