Skip to content

Commit 433d1f0

Browse files
authored
Merge branch 'main' into raflFaisal/generaliseContainerEnvForAgent
2 parents 8406624 + bf47a8b commit 433d1f0

File tree

14 files changed

+295
-488
lines changed

14 files changed

+295
-488
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
44
[![Python Unit Tests](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml/badge.svg)](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml)
55
[![r/agentdevelopmentkit](https://img.shields.io/badge/Reddit-r%2Fagentdevelopmentkit-FF4500?style=flat&logo=reddit&logoColor=white)](https://www.reddit.com/r/agentdevelopmentkit/)
6+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/google/adk-python)
67

78
<html>
89
<h2 align="center">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +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+
115
from . import agent
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +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+
115
from . import agent

src/google/adk/agents/llm_agent.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ class LlmAgent(BaseAgent):
204204
"""
205205
# Advance features - End
206206

207-
# TODO: remove below fields after migration. - Start
208-
# These fields are added back for easier migration.
209-
examples: Optional[ExamplesUnion] = None
210-
# TODO: remove above fields after migration. - End
211-
212207
# Callbacks - Start
213208
before_model_callback: Optional[BeforeModelCallback] = None
214209
"""Callback or list of callbacks to be called before calling the LLM.

src/google/adk/cli/browser/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
<style>html{color-scheme:dark}html{--mat-sys-background:light-dark(#fcf9f8, #131314);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f3f0f0, #313030);--mat-sys-inverse-primary:light-dark(#c1c7cd, #595f65);--mat-sys-inverse-surface:light-dark(#313030, #e5e2e2);--mat-sys-on-background:light-dark(#1c1b1c, #e5e2e2);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#410002, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #2b3136);--mat-sys-on-primary-container:light-dark(#161c21, #dde3e9);--mat-sys-on-primary-fixed:light-dark(#161c21, #161c21);--mat-sys-on-primary-fixed-variant:light-dark(#41474d, #41474d);--mat-sys-on-secondary:light-dark(#ffffff, #003061);--mat-sys-on-secondary-container:light-dark(#001b3c, #d5e3ff);--mat-sys-on-secondary-fixed:light-dark(#001b3c, #001b3c);--mat-sys-on-secondary-fixed-variant:light-dark(#0f4784, #0f4784);--mat-sys-on-surface:light-dark(#1c1b1c, #e5e2e2);--mat-sys-on-surface-variant:light-dark(#44474a, #e1e2e6);--mat-sys-on-tertiary:light-dark(#ffffff, #2b3136);--mat-sys-on-tertiary-container:light-dark(#161c21, #dde3e9);--mat-sys-on-tertiary-fixed:light-dark(#161c21, #161c21);--mat-sys-on-tertiary-fixed-variant:light-dark(#41474d, #41474d);--mat-sys-outline:light-dark(#74777b, #8e9194);--mat-sys-outline-variant:light-dark(#c4c7ca, #44474a);--mat-sys-primary:light-dark(#595f65, #c1c7cd);--mat-sys-primary-container:light-dark(#dde3e9, #41474d);--mat-sys-primary-fixed:light-dark(#dde3e9, #dde3e9);--mat-sys-primary-fixed-dim:light-dark(#c1c7cd, #c1c7cd);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#305f9d, #a7c8ff);--mat-sys-secondary-container:light-dark(#d5e3ff, #0f4784);--mat-sys-secondary-fixed:light-dark(#d5e3ff, #d5e3ff);--mat-sys-secondary-fixed-dim:light-dark(#a7c8ff, #a7c8ff);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#fcf9f8, #131314);--mat-sys-surface-bright:light-dark(#fcf9f8, #393939);--mat-sys-surface-container:light-dark(#f0eded, #201f20);--mat-sys-surface-container-high:light-dark(#eae7e7, #2a2a2a);--mat-sys-surface-container-highest:light-dark(#e5e2e2, #393939);--mat-sys-surface-container-low:light-dark(#f6f3f3, #1c1b1c);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0e0e0e);--mat-sys-surface-dim:light-dark(#dcd9d9, #131314);--mat-sys-surface-tint:light-dark(#595f65, #c1c7cd);--mat-sys-surface-variant:light-dark(#e1e2e6, #44474a);--mat-sys-tertiary:light-dark(#595f65, #c1c7cd);--mat-sys-tertiary-container:light-dark(#dde3e9, #41474d);--mat-sys-tertiary-fixed:light-dark(#dde3e9, #dde3e9);--mat-sys-tertiary-fixed-dim:light-dark(#c1c7cd, #c1c7cd);--mat-sys-neutral-variant20:#2d3134;--mat-sys-neutral10:#1c1b1c}html{--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12)}html{--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12)}html{--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12)}html{--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12)}html{--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12)}html{--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12)}html{--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px}html{--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12}html{font-family:Google Sans,Helvetica Neue,sans-serif!important}body{height:100vh;margin:0}:root{--mat-sys-primary:black;--mdc-checkbox-selected-icon-color:white;--mat-sys-background:#131314;--mat-tab-header-active-label-text-color:#8AB4F8;--mat-tab-header-active-hover-label-text-color:#8AB4F8;--mat-tab-header-active-focus-label-text-color:#8AB4F8;--mat-tab-header-label-text-weight:500;--mdc-text-button-label-text-color:#89b4f8}:root{--mdc-dialog-container-color:#2b2b2f}:root{--mdc-dialog-subhead-color:white}:root{--mdc-circular-progress-active-indicator-color:#a8c7fa}:root{--mdc-circular-progress-size:80}</style><link rel="stylesheet" href="./styles-4VDSPQ37.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="./styles-4VDSPQ37.css"></noscript></head>
3030
<body>
3131
<app-root></app-root>
32-
<script src="./polyfills-FFHMD2TL.js" type="module"></script><script src="./main-DY547BWY.js" type="module"></script></body>
32+
<script src="./polyfills-FFHMD2TL.js" type="module"></script><script src="./main-76ZXPY2A.js" type="module"></script></body>
3333
</html>

src/google/adk/cli/browser/main-DY547BWY.js renamed to src/google/adk/cli/browser/main-76ZXPY2A.js

Lines changed: 56 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/adk/cli/cli_tools_click.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -934,22 +934,7 @@ def cli_deploy_agent_engine(
934934
):
935935
"""Deploys an agent to Agent Engine.
936936
937-
Args:
938-
agent (str): Required. The path to the agent to be deloyed.
939-
project (str): Required. Google Cloud project to deploy the agent.
940-
region (str): Required. Google Cloud region to deploy the agent.
941-
staging_bucket (str): Required. GCS bucket for staging the deployment
942-
artifacts.
943-
trace_to_cloud (bool): Required. Whether to enable Cloud Trace.
944-
adk_app (str): Required. Python file for defining the ADK application.
945-
temp_folder (str): Required. The folder for the generated Agent Engine
946-
files. If the folder already exists, its contents will be replaced.
947-
env_file (str): Required. The filepath to the `.env` file for environment
948-
variables. If it is an empty string, the `.env` file in the `agent`
949-
directory will be used if it exists.
950-
requirements_file (str): Required. The filepath to the `requirements.txt`
951-
file to use. If it is an empty string, the `requirements.txt` file in the
952-
`agent` directory will be used if exists.
937+
AGENT: The path to the agent source code folder.
953938
954939
Example:
955940

src/google/adk/evaluation/eval_metrics.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ class EvalMetric(BaseModel):
3232
populate_by_name=True,
3333
)
3434

35-
model_config = ConfigDict(
36-
alias_generator=alias_generators.to_camel,
37-
populate_by_name=True,
38-
)
39-
4035
metric_name: str
4136
"""The name of the metric."""
4237

src/google/adk/models/google_llm.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from typing import AsyncGenerator
2424
from typing import cast
2525
from typing import TYPE_CHECKING
26+
from typing import Union
2627

2728
from google.genai import Client
2829
from google.genai import types
@@ -244,9 +245,18 @@ async def connect(self, llm_request: LlmRequest) -> BaseLlmConnection:
244245

245246
def _preprocess_request(self, llm_request: LlmRequest) -> None:
246247

247-
if llm_request.config and self._api_backend == GoogleLLMVariant.GEMINI_API:
248+
if self._api_backend == GoogleLLMVariant.GEMINI_API:
248249
# Using API key from Google AI Studio to call model doesn't support labels.
249-
llm_request.config.labels = None
250+
if llm_request.config:
251+
llm_request.config.labels = None
252+
253+
if llm_request.contents:
254+
for content in llm_request.contents:
255+
if not content.parts:
256+
continue
257+
for part in content.parts:
258+
_remove_display_name_if_present(part.inline_data)
259+
_remove_display_name_if_present(part.file_data)
250260

251261

252262
def _build_function_declaration_log(
@@ -324,3 +334,15 @@ def _build_response_log(resp: types.GenerateContentResponse) -> str:
324334
{resp.model_dump_json(exclude_none=True)}
325335
-----------------------------------------------------------
326336
"""
337+
338+
339+
def _remove_display_name_if_present(
340+
data_obj: Union[types.Blob, types.FileData, None],
341+
):
342+
"""Sets display_name to None for the Gemini API (non-Vertex) backend.
343+
344+
This backend does not support the display_name parameter for file uploads,
345+
so it must be removed to prevent request failures.
346+
"""
347+
if data_obj and data_obj.display_name:
348+
data_obj.display_name = None

src/google/adk/tools/bigquery/metadata_tool.py

Lines changed: 101 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -69,33 +69,37 @@ def get_dataset_info(
6969
dict: Dictionary representing the properties of the dataset.
7070
7171
Examples:
72-
>>> get_dataset_info("bigquery-public-data", "penguins")
72+
>>> get_dataset_info("bigquery-public-data", "cdc_places")
7373
{
7474
"kind": "bigquery#dataset",
75-
"etag": "PNC5907iQbzeVcAru/2L3A==",
76-
"id": "bigquery-public-data:ml_datasets",
77-
"selfLink":
78-
"https://bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/ml_datasets",
75+
"etag": "fz9BaiXKgbGi53EpI2rJug==",
76+
"id": "bigquery-public-data:cdc_places",
77+
"selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/cdc_places",
7978
"datasetReference": {
80-
"datasetId": "ml_datasets",
81-
"projectId": "bigquery-public-data"
79+
"datasetId": "cdc_places",
80+
"projectId": "bigquery-public-data"
8281
},
82+
"description": "Local Data for Better Health, County Data",
8383
"access": [
84-
{
85-
"role": "OWNER",
86-
"groupByEmail": "cloud-datasets-eng@google.com"
87-
},
88-
{
89-
"role": "READER",
90-
"iamMember": "allUsers"
91-
},
92-
{
93-
"role": "READER",
94-
"groupByEmail": "bqml-eng@google.com"
95-
}
84+
{
85+
"role": "WRITER",
86+
"specialGroup": "projectWriters"
87+
},
88+
{
89+
"role": "OWNER",
90+
"specialGroup": "projectOwners"
91+
},
92+
{
93+
"role": "OWNER",
94+
"userByEmail": "some-redacted-email@bigquery-public-data.iam.gserviceaccount.com"
95+
},
96+
{
97+
"role": "READER",
98+
"specialGroup": "projectReaders"
99+
}
96100
],
97-
"creationTime": "1553208775542",
98-
"lastModifiedTime": "1686338918114",
101+
"creationTime": "1640891845643",
102+
"lastModifiedTime": "1640891845643",
99103
"location": "US",
100104
"type": "DEFAULT",
101105
"maxTimeTravelHours": "168"
@@ -128,13 +132,9 @@ def list_table_ids(
128132
list[str]: List of the tables ids present in the dataset.
129133
130134
Examples:
131-
>>> list_table_ids("bigquery-public-data", "ml_datasets")
132-
['census_adult_income',
133-
'credit_card_default',
134-
'holidays_and_events_for_forecasting',
135-
'iris',
136-
'penguins',
137-
'ulb_fraud_detection']
135+
>>> list_table_ids("bigquery-public-data", "cdc_places")
136+
['chronic_disease_indicators',
137+
'local_data_for_better_health_county_data']
138138
"""
139139
try:
140140
bq_client = client.get_bigquery_client(credentials=credentials)
@@ -167,72 +167,87 @@ def get_table_info(
167167
dict: Dictionary representing the properties of the table.
168168
169169
Examples:
170-
>>> get_table_info("bigquery-public-data", "ml_datasets", "penguins")
170+
>>> get_table_info("bigquery-public-data", "cdc_places", "local_data_for_better_health_county_data")
171171
{
172172
"kind": "bigquery#table",
173-
"etag": "X0ZkRohSGoYvWemRYEgOHA==",
174-
"id": "bigquery-public-data:ml_datasets.penguins",
175-
"selfLink":
176-
"https://bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/ml_datasets/tables/penguins",
173+
"etag": "wx23aDqmgc39oUSiNuYTAA==",
174+
"id": "bigquery-public-data:cdc_places.local_data_for_better_health_county_data",
175+
"selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/cdc_places/tables/local_data_for_better_health_county_data",
177176
"tableReference": {
178-
"projectId": "bigquery-public-data",
179-
"datasetId": "ml_datasets",
180-
"tableId": "penguins"
177+
"projectId": "bigquery-public-data",
178+
"datasetId": "cdc_places",
179+
"tableId": "local_data_for_better_health_county_data"
181180
},
181+
"description": "Local Data for Better Health, County Data",
182182
"schema": {
183-
"fields": [
184-
{
185-
"name": "species",
186-
"type": "STRING",
187-
"mode": "REQUIRED"
188-
},
189-
{
190-
"name": "island",
191-
"type": "STRING",
192-
"mode": "NULLABLE"
193-
},
194-
{
195-
"name": "culmen_length_mm",
196-
"type": "FLOAT",
197-
"mode": "NULLABLE"
198-
},
199-
{
200-
"name": "culmen_depth_mm",
201-
"type": "FLOAT",
202-
"mode": "NULLABLE"
203-
},
204-
{
205-
"name": "flipper_length_mm",
206-
"type": "FLOAT",
207-
"mode": "NULLABLE"
208-
},
209-
{
210-
"name": "body_mass_g",
211-
"type": "FLOAT",
212-
"mode": "NULLABLE"
213-
},
214-
{
215-
"name": "sex",
216-
"type": "STRING",
217-
"mode": "NULLABLE"
218-
}
219-
]
183+
"fields": [
184+
{
185+
"name": "year",
186+
"type": "INTEGER",
187+
"mode": "NULLABLE"
188+
},
189+
{
190+
"name": "stateabbr",
191+
"type": "STRING",
192+
"mode": "NULLABLE"
193+
},
194+
{
195+
"name": "statedesc",
196+
"type": "STRING",
197+
"mode": "NULLABLE"
198+
},
199+
{
200+
"name": "locationname",
201+
"type": "STRING",
202+
"mode": "NULLABLE"
203+
},
204+
{
205+
"name": "datasource",
206+
"type": "STRING",
207+
"mode": "NULLABLE"
208+
},
209+
{
210+
"name": "category",
211+
"type": "STRING",
212+
"mode": "NULLABLE"
213+
},
214+
{
215+
"name": "measure",
216+
"type": "STRING",
217+
"mode": "NULLABLE"
218+
},
219+
{
220+
"name": "data_value_unit",
221+
"type": "STRING",
222+
"mode": "NULLABLE"
223+
},
224+
{
225+
"name": "data_value_type",
226+
"type": "STRING",
227+
"mode": "NULLABLE"
228+
},
229+
{
230+
"name": "data_value",
231+
"type": "FLOAT",
232+
"mode": "NULLABLE"
233+
}
234+
]
220235
},
221-
"numBytes": "28947",
222-
"numLongTermBytes": "28947",
223-
"numRows": "344",
224-
"creationTime": "1619804743188",
225-
"lastModifiedTime": "1634584675234",
236+
"numBytes": "234849",
237+
"numLongTermBytes": "0",
238+
"numRows": "1000",
239+
"creationTime": "1640891846119",
240+
"lastModifiedTime": "1749427268137",
226241
"type": "TABLE",
227242
"location": "US",
228-
"numTimeTravelPhysicalBytes": "0",
229-
"numTotalLogicalBytes": "28947",
230-
"numActiveLogicalBytes": "0",
231-
"numLongTermLogicalBytes": "28947",
232-
"numTotalPhysicalBytes": "5350",
233-
"numActivePhysicalBytes": "0",
234-
"numLongTermPhysicalBytes": "5350",
235-
"numCurrentPhysicalBytes": "5350"
243+
"numTimeTravelPhysicalBytes": "285737",
244+
"numTotalLogicalBytes": "234849",
245+
"numActiveLogicalBytes": "234849",
246+
"numLongTermLogicalBytes": "0",
247+
"numTotalPhysicalBytes": "326557",
248+
"numActivePhysicalBytes": "326557",
249+
"numLongTermPhysicalBytes": "0",
250+
"numCurrentPhysicalBytes": "40820"
236251
}
237252
"""
238253
try:

0 commit comments

Comments
 (0)