Skip to content

Commit 279d12d

Browse files
Merge branch 'main' into fix/3145-remotea2a-artifacts
2 parents 9439ce4 + e85a7b2 commit 279d12d

53 files changed

Lines changed: 3129 additions & 1452 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.

contributing/samples/core/input_output_schema/tests/weather_cupertino.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"author": "weather_agent",
45-
"branch": "weather_agent@1",
45+
"branch": "weather_agent@fc-1",
4646
"content": {
4747
"parts": [
4848
{

contributing/samples/core/input_output_schema/tests/weather_sanjose.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"author": "weather_agent",
45-
"branch": "weather_agent@1",
45+
"branch": "weather_agent@fc-1",
4646
"content": {
4747
"parts": [
4848
{

contributing/samples/core/input_output_schema/tests/weather_tokyo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"author": "weather_agent",
45-
"branch": "weather_agent@1",
45+
"branch": "weather_agent@fc-1",
4646
"content": {
4747
"parts": [
4848
{
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Daytona Environment Sample
2+
3+
## Overview
4+
5+
A small data analysis agent that uses the `DaytonaEnvironment` with the
6+
`EnvironmentToolset` to download public datasets and analyze them inside a
7+
[Daytona](https://daytona.io) remote sandbox.
8+
9+
Instead of running on the local machine, all commands and file operations
10+
execute in an isolated remote sandbox with internet access. Asked a question,
11+
the agent downloads a public dataset (a GCS-hosted world population /
12+
demographics dataset by default), installs `pandas` on demand, writes a short
13+
analysis script, runs it, and reports the result — all without touching the
14+
user's machine. This makes the sandbox a natural fit for running
15+
model-generated code safely and keeping the host clean.
16+
17+
## Prerequisites
18+
19+
1. Install the `daytona` extra:
20+
21+
```bash
22+
pip install google-adk[daytona]
23+
```
24+
25+
1. Set your Daytona configuration. Get a server and API key by following the
26+
Daytona installation guide (e.g. self-hosted or via Daytona Cloud).
27+
28+
If you are using Daytona Cloud, you only need to set:
29+
30+
```bash
31+
export DAYTONA_API_KEY="your-api-key"
32+
```
33+
34+
If you are using a self-hosted Daytona server, also set:
35+
36+
```bash
37+
export DAYTONA_API_URL="your-api-url"
38+
```
39+
40+
## Sample Inputs
41+
42+
- `Download the world demographics dataset and tell me which country has the largest population.`
43+
44+
The agent downloads the dataset, installs `pandas`, filters to country-level
45+
rows, and finds the maximum. Expected: China (`CN`), ≈ 1.44 billion, just
46+
ahead of India (`IN`) at ≈ 1.38 billion.
47+
48+
- `For the United States, what is the urban vs rural population split?`
49+
50+
A follow-up to the previous turn. Because the sandbox persists across the
51+
session, the agent reuses the already-downloaded CSV and the installed
52+
`pandas` — it only writes and runs a new script. Expected for `US`: urban
53+
≈ 270.7 million vs rural ≈ 57.6 million (out of ≈ 331 million total).
54+
55+
- `Using https://storage.googleapis.com/cloud-samples-data/bigquery/us-states/us-states.csv, how many US states are listed?`
56+
57+
Demonstrates pointing the agent at your own dataset URL instead of the
58+
default.
59+
60+
## Graph
61+
62+
```mermaid
63+
graph TD
64+
User -->|question| Agent[data_analysis_agent]
65+
Agent -->|EnvironmentToolset| Sandbox[DaytonaEnvironment sandbox]
66+
Sandbox -->|download / install / run| Agent
67+
Agent -->|answer| User
68+
```
69+
70+
## How To
71+
72+
The agent is a standalone `Agent` (no workflow graph) wired to a single
73+
`EnvironmentToolset` whose `environment` is a `DaytonaEnvironment`:
74+
75+
```python
76+
from google.adk.integrations.daytona import DaytonaEnvironment
77+
from google.adk.tools.environment import EnvironmentToolset
78+
79+
EnvironmentToolset(
80+
environment=DaytonaEnvironment(timeout=300),
81+
)
82+
```
83+
84+
- `timeout` bounds the sandbox lifetime in seconds.
85+
- By default, it will spin up a sandbox from the built-in default Python snapshot.
86+
If you want to use a custom Docker image instead, you can pass it to the
87+
`image` parameter (e.g. `image="python:3.12"`).
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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
"""A data analysis agent that runs Python in a Daytona remote sandbox."""
16+
17+
from google.adk import Agent
18+
from google.adk.integrations.daytona import DaytonaEnvironment
19+
from google.adk.tools.environment import EnvironmentToolset
20+
21+
root_agent = Agent(
22+
name="data_analysis_agent",
23+
description=(
24+
"A data analysis agent that downloads public datasets and analyzes"
25+
" them inside a Daytona remote sandbox."
26+
),
27+
instruction="""\
28+
You are a data analysis assistant. You work inside an isolated Daytona remote
29+
sandbox that has internet access, where you can safely download data and run
30+
Python, so you never touch the user's machine.
31+
32+
To analyze a dataset:
33+
1. Download it from the internet into the working directory, e.g. with
34+
`curl -O <url>` or `wget <url>`.
35+
2. Install whatever you need on demand, e.g. `pip install pandas`.
36+
3. Write a short Python script that loads the data and computes the answer.
37+
4. Run the script and report the result, showing the numbers you found.
38+
39+
Prefer writing a script and executing it over guessing. If a command fails,
40+
read the error, fix the script, and try again.
41+
""",
42+
tools=[EnvironmentToolset(environment=DaytonaEnvironment())],
43+
)

contributing/samples/multi_agent/single_turn_sub_agent/tests/gaming_1000.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
},
7878
{
7979
"author": "phone_recommender",
80-
"branch": "phone_recommender@1",
80+
"branch": "phone_recommender@fc-1",
8181
"content": {
8282
"parts": [
8383
{
@@ -102,7 +102,7 @@
102102
},
103103
{
104104
"author": "phone_recommender",
105-
"branch": "phone_recommender@1",
105+
"branch": "phone_recommender@fc-1",
106106
"content": {
107107
"parts": [
108108
{
@@ -125,7 +125,7 @@
125125
},
126126
{
127127
"author": "phone_recommender",
128-
"branch": "phone_recommender@1",
128+
"branch": "phone_recommender@fc-1",
129129
"content": {
130130
"parts": [
131131
{
@@ -150,7 +150,7 @@
150150
},
151151
{
152152
"author": "phone_recommender",
153-
"branch": "phone_recommender@1",
153+
"branch": "phone_recommender@fc-1",
154154
"content": {
155155
"parts": [
156156
{
@@ -173,7 +173,7 @@
173173
},
174174
{
175175
"author": "phone_recommender",
176-
"branch": "phone_recommender@1",
176+
"branch": "phone_recommender@fc-1",
177177
"content": {
178178
"parts": [
179179
{
@@ -198,7 +198,7 @@
198198
},
199199
{
200200
"author": "phone_recommender",
201-
"branch": "phone_recommender@1",
201+
"branch": "phone_recommender@fc-1",
202202
"content": {
203203
"parts": [
204204
{
@@ -221,7 +221,7 @@
221221
},
222222
{
223223
"author": "phone_recommender",
224-
"branch": "phone_recommender@1",
224+
"branch": "phone_recommender@fc-1",
225225
"content": {
226226
"parts": [
227227
{
@@ -246,7 +246,7 @@
246246
},
247247
{
248248
"author": "phone_recommender",
249-
"branch": "phone_recommender@1",
249+
"branch": "phone_recommender@fc-1",
250250
"content": {
251251
"parts": [
252252
{
@@ -269,7 +269,7 @@
269269
},
270270
{
271271
"author": "phone_recommender",
272-
"branch": "phone_recommender@1",
272+
"branch": "phone_recommender@fc-1",
273273
"content": {
274274
"parts": [
275275
{
@@ -294,7 +294,7 @@
294294
},
295295
{
296296
"author": "phone_recommender",
297-
"branch": "phone_recommender@1",
297+
"branch": "phone_recommender@fc-1",
298298
"content": {
299299
"parts": [
300300
{
@@ -317,7 +317,7 @@
317317
},
318318
{
319319
"author": "phone_recommender",
320-
"branch": "phone_recommender@1",
320+
"branch": "phone_recommender@fc-1",
321321
"content": {
322322
"parts": [
323323
{
@@ -351,7 +351,7 @@
351351
}
352352
},
353353
"author": "phone_recommender",
354-
"branch": "phone_recommender@1",
354+
"branch": "phone_recommender@fc-1",
355355
"content": {
356356
"parts": [
357357
{
@@ -376,7 +376,7 @@
376376
},
377377
{
378378
"author": "phone_recommender",
379-
"branch": "phone_recommender@1",
379+
"branch": "phone_recommender@fc-1",
380380
"content": {
381381
"parts": [
382382
{

contributing/samples/multi_agent/single_turn_sub_agent/tests/gaming_1000_large.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"author": "phone_recommender",
47-
"branch": "phone_recommender@1",
47+
"branch": "phone_recommender@fc-1",
4848
"content": {
4949
"parts": [
5050
{
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"author": "phone_recommender",
72-
"branch": "phone_recommender@1",
72+
"branch": "phone_recommender@fc-1",
7373
"content": {
7474
"parts": [
7575
{
@@ -92,7 +92,7 @@
9292
},
9393
{
9494
"author": "phone_recommender",
95-
"branch": "phone_recommender@1",
95+
"branch": "phone_recommender@fc-1",
9696
"content": {
9797
"parts": [
9898
{
@@ -117,7 +117,7 @@
117117
},
118118
{
119119
"author": "phone_recommender",
120-
"branch": "phone_recommender@1",
120+
"branch": "phone_recommender@fc-1",
121121
"content": {
122122
"parts": [
123123
{
@@ -140,7 +140,7 @@
140140
},
141141
{
142142
"author": "phone_recommender",
143-
"branch": "phone_recommender@1",
143+
"branch": "phone_recommender@fc-1",
144144
"content": {
145145
"parts": [
146146
{
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"author": "phone_recommender",
168-
"branch": "phone_recommender@1",
168+
"branch": "phone_recommender@fc-1",
169169
"content": {
170170
"parts": [
171171
{
@@ -188,7 +188,7 @@
188188
},
189189
{
190190
"author": "phone_recommender",
191-
"branch": "phone_recommender@1",
191+
"branch": "phone_recommender@fc-1",
192192
"content": {
193193
"parts": [
194194
{
@@ -213,7 +213,7 @@
213213
},
214214
{
215215
"author": "phone_recommender",
216-
"branch": "phone_recommender@1",
216+
"branch": "phone_recommender@fc-1",
217217
"content": {
218218
"parts": [
219219
{
@@ -236,7 +236,7 @@
236236
},
237237
{
238238
"author": "phone_recommender",
239-
"branch": "phone_recommender@1",
239+
"branch": "phone_recommender@fc-1",
240240
"content": {
241241
"parts": [
242242
{
@@ -270,7 +270,7 @@
270270
}
271271
},
272272
"author": "phone_recommender",
273-
"branch": "phone_recommender@1",
273+
"branch": "phone_recommender@fc-1",
274274
"content": {
275275
"parts": [
276276
{
@@ -295,7 +295,7 @@
295295
},
296296
{
297297
"author": "phone_recommender",
298-
"branch": "phone_recommender@1",
298+
"branch": "phone_recommender@fc-1",
299299
"content": {
300300
"parts": [
301301
{

0 commit comments

Comments
 (0)