Skip to content

Commit a3f201b

Browse files
authored
Merge branch 'main' into feat/add-metadata-parameter
2 parents c395077 + a2e43aa commit a3f201b

Some content is hidden

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

61 files changed

+7404
-4249
lines changed

CHANGELOG.md

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

3+
## [1.24.1](https://github.com/google/adk-python/compare/v1.24.0...v1.24.1) (2026-02-06)
4+
5+
### Bug Fixes
6+
7+
* Add back deprecated eval endpoint for web until we migrate([ae993e8](https://github.com/google/adk-python/commit/ae993e884f44db276a4116ebb7a11a2fb586dbfe))
8+
* Update eval dialog colors, and fix a2ui component types ([3686a3a](https://github.com/google/adk-python/commit/3686a3a98f46738549cd7a999f3773b7a6fd1182))
9+
10+
## [1.24.0](https://github.com/google/adk-python/compare/v1.23.0...v1.24.0) (2026-02-04)
11+
12+
### ⚠ BREAKING CHANGES
13+
14+
* Breaking: Make credential manager accept `tool_context` instead of `callback_context` ([fe82f3c](https://github.com/google/adk-python/commit/fe82f3cde854e49be13d90b4c02d786d82f8a202))
15+
16+
### Highlights
17+
18+
* **[Web]**
19+
* **Consolidated Event View**: Replaced the Event tab with a more intuitive "click-to-expand" interaction on message rows, enabling faster debugging within the chat context
20+
* **Enhanced Accessibility**: Added full support for arrow-key navigation for a more seamless, keyboard-centric experience
21+
* **Rich Developer Tooling**: Introduced detailed tooltips for function calls, providing instant visibility into arguments, responses, and state changes
22+
* **A2UI Integration**: Integrated the **A2UI v0.8** standard catalog to automatically render spec-compliant ADK parts as native UI components directly in the chat
23+
24+
### Features
25+
26+
* **[Core]**
27+
* Allow passthrough of `GOOGLE_CLOUD_LOCATION` for Agent Engine deployments ([004e15c](https://github.com/google/adk-python/commit/004e15ccb7c7f683623f8e7d2e77a9d12558c545))
28+
* Add interface for agent optimizers ([4ee125a](https://github.com/google/adk-python/commit/4ee125a03856fdb9ed28245bf7f5917c2d9038db))
29+
* Pass event ID as metadata when converted into a message ([85434e2](https://github.com/google/adk-python/commit/85434e293f7bd1e3711f190f84d5a36804e4462b))
30+
* Restructure the bug report template as per the intake process ([324796b](https://github.com/google/adk-python/commit/324796b4fe05bec3379bfef67071a29552ef355a))
31+
32+
* **[Models]**
33+
* Mark Vertex calls made from non-Gemini models ([7d58e0d](https://github.com/google/adk-python/commit/7d58e0d2f375bc80bdfac9cffea2926fd2344b8a))
34+
35+
* **[Evals]**
36+
* Allow Vertex AI Client initialization with API Key ([43d6075](https://github.com/google/adk-python/commit/43d6075ea7aa49ddb358732f2219ca9598dd286f))
37+
* Remove overall evaluation status calculation from `_CustomMetricEvaluator` and add threshold to custom metric function expected signature ([553e376](https://github.com/google/adk-python/commit/553e376718ceb3d7fb1403231bb720836d71f42c))
38+
39+
* **[Tools]**
40+
* Make OpenAPI tool asynchronous ([9290b96](https://github.com/google/adk-python/commit/9290b966267dc02569786f95aab2a3cb78c7004f))
41+
* Implement toolset authentication for `McpToolset`, `OpenAPIToolset`, and other toolsets ([798f65d](https://github.com/google/adk-python/commit/798f65df86b1bbe33d864e30c5b1f9e155e89810))
42+
* Add framework support for toolset authentication before `get_tools` calls ([ee873ca](https://github.com/google/adk-python/commit/ee873cae2e2df960910d264a4340ce6c0489eb7a))
43+
* Support dynamic configuration for `VertexAiSearchTool` ([585ebfd](https://github.com/google/adk-python/commit/585ebfdac7f1b8007b4e4a7e4258ec5de72c78b1))
44+
* Add `get_auth_config` method to toolset to expose authentication requirements ([381d44c](https://github.com/google/adk-python/commit/381d44cab437cac027af181ae627e7b260b7561e))
45+
* Add methods in `McpToolset` for users to access MCP resources ([8f7d965](https://github.com/google/adk-python/commit/8f7d9659cfc19034af29952fbca765d012169b38))
46+
* Improve error message when failing to get tools from MCP ([3480b3b](https://github.com/google/adk-python/commit/3480b3b82d89de69f77637d7ad034827434df45a))
47+
48+
* **[Services]**
49+
* Improve `asyncio` loop handling and test cleanup ([00aba2d](https://github.com/google/adk-python/commit/00aba2d884d24fb5244d1de84f8dba9cbc3c07e8))
50+
51+
* **[Live]**
52+
* Support running tools in separate threads for live mode ([714c3ad](https://github.com/google/adk-python/commit/714c3ad0477e775fba6696a919a366a293197268))
53+
54+
* **[Observability]**
55+
* Add extra attributes to spans generated with `opentelemetry-instrumentation-google-genai` ([e87a843](https://github.com/google/adk-python/commit/e87a8437fb430e0d4c42c73948e3ba1872040a15))
56+
57+
### Bug Fixes
58+
59+
* Ignore `session_db_kwargs` for SQLite session services ([ce07cd8](https://github.com/google/adk-python/commit/ce07cd8144c8498434f68e61ebeb519bf329f778))
60+
* Resolve `MutualTLSChannelError` by adding `pyopenssl` dependency ([125bc85](https://github.com/google/adk-python/commit/125bc85ac5e1400bc38f7c681f76fa82626c9911))
61+
* Add `update_timestamp_tz` property to `StorageSession` ([666cebe](https://github.com/google/adk-python/commit/666cebe3693d2981fd5fea6e9e4c65e56dcd3f2b))
62+
* Do not treat Function Calls and Function Responses as invisible when marked as thoughts ([853a3b0](https://github.com/google/adk-python/commit/853a3b0e143ce27516f0de51e0e0df2af6ecf465))
63+
* Add pre-deployment validation for agent module imports (credit to @ppgranger, [2ac468e](https://github.com/google/adk-python/commit/2ac468ea7e30ef30c1324ffc86f67dbf32ab7ede))
64+
* Fix cases where `execution_result_delimiters` have `None` type element ([a16e3cc](https://github.com/google/adk-python/commit/a16e3cc67e1cb391228ba78662547672404ae550))
65+
* Disable `save_input_blobs_as_artifacts` deprecation warning message for users not setting it ([c34615e](https://github.com/google/adk-python/commit/c34615ecf3c7bbe0f4275f72543774f258c565b4))
66+
* Fix agent config path handling in generated deployment script ([8012339](https://github.com/google/adk-python/commit/801233902bbd6c0cca63b6fc8c1b0b2531f3f11e))
67+
* Add `pypika>=0.50.0` to `project.toml` to support `crewai` on Python 3.12+ ([e8f7aa3](https://github.com/google/adk-python/commit/e8f7aa3140d2585ac38ebfe31c5b650383499a20))
68+
* Update OpenTelemetry dependency versions to relax version constraints for `opentelemetry-api` and `opentelemetry-sdk` ([706a6dd](https://github.com/google/adk-python/commit/706a6dda8144da147bd9fa42ef85bbfa58fec5d3))
69+
* Enable `pool_pre_ping` by default for non-SQLite database engines ([da73e71](https://github.com/google/adk-python/commit/da73e718efa9557ed33e2fb579de68fcbcf4c7f0))
70+
* Ensure database sessions are always rolled back on errors ([63a8eba](https://github.com/google/adk-python/commit/63a8eba53f2cb07625eb7cd111ff767e8e0030fa))
71+
* Reload stale session in `DatabaseSessionService` when storage update time is later than the in-memory session object ([1063fa5](https://github.com/google/adk-python/commit/1063fa532cad59d8e9f7421ce2f523724d49d541))
72+
* Make credential key generation stable and prevent cross-user credential leaks ([33012e6](https://github.com/google/adk-python/commit/33012e6dda9ef20c7a1dae66a84717de5d782097))
73+
* Change MCP `read_resource` to return original contents ([ecce7e5](https://github.com/google/adk-python/commit/ecce7e54a688a915a1b9d742c39e4684186729be))
74+
* Recognize function responses as non-empty parts in LiteLLM ([d0102ec](https://github.com/google/adk-python/commit/d0102ecea331e062190dbb7578a4ef7f4044306e))
75+
* Handle HTTP/HTTPS URLs for media files in LiteLLM content conversion ([47221cd](https://github.com/google/adk-python/commit/47221cd5c1e778cd4b92ed8d382c639435f5728c))
76+
* Fix Pydantic schema generation error for `ClientSession` ([131fbd3](https://github.com/google/adk-python/commit/131fbd39482980572487a30fea13236d2badd543))
77+
* Fix Click’s Wrapping in `adk eval` help message ([3bcd8f7](https://github.com/google/adk-python/commit/3bcd8f7f7a0683f838005bc209f7d39dc93f850b))
78+
* Stream errors as simple JSON objects in ADK web server SSE endpoint ([798d005](https://github.com/google/adk-python/commit/798d0053c832e7ed52e2e104f8a14f789ba8b17f))
79+
* Remove print debugging artifact ([0d38a36](https://github.com/google/adk-python/commit/0d38a3683f13bc12dc5d181164b6cd5d72fc260c))
80+
81+
### Improvements
82+
83+
* Check `will_continue` for streaming function calls ([2220d88](https://github.com/google/adk-python/commit/2220d885cda875144b52338b5becf6e5546f3f51))
84+
* Update ADK web, rework events, and add A2UI capabilities ([37e6507](https://github.com/google/adk-python/commit/37e6507ce4d8750100d914eb1a62014350ef1795))
85+
* Improve error handling for LiteLLM import in `gemma_llm.py` ([574ec43](https://github.com/google/adk-python/commit/574ec43a175e3bf3a05e73114e8db7196fae7040))
86+
* Replace proxy methods with utils implementation ([6ff10b2](https://github.com/google/adk-python/commit/6ff10b23be01c1f7dd79d13ac8c679c079140f76), [f82ceb0](https://github.com/google/adk-python/commit/f82ceb0ce75d3efed7c046835ddac76c28210013))
87+
* Replace print statements with logging in ADK evaluation components ([dd8cd27](https://github.com/google/adk-python/commit/dd8cd27b2ce505ecca50cdfbb1469db01c82b0af))
88+
* Add sample agent that requires OAuth flow during MCP tool listing, and convert `MCPToolset` to `McpToolset` in unit tests ([2770012](https://github.com/google/adk-python/commit/2770012cecdfc71628a818a75b21faabe828b4e5), [4341839](https://github.com/google/adk-python/commit/43418394202c2d01b0d37f6424bd601148077e27))
89+
* Ensure `BigQueryAgentAnalyticsPlugin` is shut down after each test ([c0c98d9](https://github.com/google/adk-python/commit/c0c98d94b3161d6bf9fff731e0abfc985b53e653))
90+
* Add ADK logger in `RestApiTool` ([288c2c4](https://github.com/google/adk-python/commit/288c2c448d77c574dafadf7851a49e6ff59fa7f4))
91+
* Add GitHub Action check to run `mypy` ([32f9f92](https://github.com/google/adk-python/commit/32f9f92042ab530220ac9d159045c91d311affa7))
92+
* Add `unittests.sh` script and update `CONTRIBUTING.md` ([025b42c](https://github.com/google/adk-python/commit/025b42c8361ad2078593e3e7fc5301df88a532c7))
93+
* Extract helper function for LLM request building and response processing ([753084f](https://github.com/google/adk-python/commit/753084fd46c9637488f33b0a05b4d270f6e03a39))
94+
395
## [1.23.0](https://github.com/google/adk-python/compare/v1.22.1...v1.23.0) (2026-01-22)
496

597
### ⚠ BREAKING CHANGES

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ root_agent = Agent(
115115

116116
### Define a multi-agent system:
117117

118-
Define a multi-agent system with coordinator agent, greeter agent, and task execution agent. Then ADK engine and the model will guide the agents works together to accomplish the task.
118+
Define a multi-agent system with coordinator agent, greeter agent, and task execution agent. Then ADK engine and the model will guide the agents to work together to accomplish the task.
119119

120120
```python
121121
from google.adk.agents import LlmAgent, BaseAgent

contributing/samples/adk_issue_formatting_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def add_comment_to_issue(issue_number: int, comment: str) -> dict[str, any]:
9696
comment: comment to add
9797
9898
Returns:
99-
The the status of this request, with the applied comment when successful.
99+
The status of this request, with the applied comment when successful.
100100
"""
101101
print(f"Attempting to add comment '{comment}' to issue #{issue_number}")
102102
url = f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/comments"
@@ -119,7 +119,7 @@ def list_comments_on_issue(issue_number: int) -> dict[str, any]:
119119
issue_number: issue number of the GitHub issue
120120
121121
Returns:
122-
The the status of this request, with the list of comments when successful.
122+
The status of this request, with the list of comments when successful.
123123
"""
124124
print(f"Attempting to list comments on issue #{issue_number}")
125125
url = f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/comments"

contributing/samples/adk_pr_triaging_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def add_label_to_pr(pr_number: int, label: str) -> dict[str, Any]:
166166
label: the label to add
167167
168168
Returns:
169-
The the status of this request, with the applied label and response when
169+
The status of this request, with the applied label and response when
170170
successful.
171171
"""
172172
print(f"Attempting to add label '{label}' to PR #{pr_number}")
@@ -201,7 +201,7 @@ def add_comment_to_pr(pr_number: int, comment: str) -> dict[str, Any]:
201201
comment: the comment to add
202202
203203
Returns:
204-
The the status of this request, with the applied comment when successful.
204+
The status of this request, with the applied comment when successful.
205205
"""
206206
print(f"Attempting to add comment '{comment}' to issue #{pr_number}")
207207

contributing/samples/adk_triaging_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
230230
issue_type: issue type to assign
231231
232232
Returns:
233-
The the status of this request, with the applied issue type when successful.
233+
The status of this request, with the applied issue type when successful.
234234
"""
235235
print(
236236
f"Attempting to change issue type '{issue_type}' to issue #{issue_number}"
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: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
"""Sample agent demonstrating MCP progress callback feature.
16+
17+
This sample shows how to use the progress_callback parameter in McpToolset
18+
to receive progress notifications from MCP servers during long-running tool
19+
executions.
20+
21+
There are two ways to use progress callbacks:
22+
23+
1. Simple callback (shared by all tools):
24+
Pass a ProgressFnT callback that receives (progress, total, message).
25+
26+
2. Factory function (per-tool callbacks with runtime context):
27+
Pass a ProgressCallbackFactory that takes (tool_name, callback_context, **kwargs)
28+
and returns a ProgressFnT or None. This allows different tools to have different
29+
progress handling logic, and the factory can access and modify session state
30+
via the CallbackContext. The **kwargs ensures forward compatibility for future
31+
parameters.
32+
33+
IMPORTANT: Progress callbacks only work when the MCP server actually sends
34+
progress notifications. Most simple MCP servers (like the filesystem server)
35+
do not send progress updates. This sample uses a mock server that demonstrates
36+
progress reporting.
37+
38+
Usage:
39+
adk run contributing/samples/mcp_progress_callback_agent
40+
41+
Then try:
42+
"Run the long running task with 5 steps"
43+
"Process these items: apple, banana, cherry"
44+
"""
45+
46+
import os
47+
import sys
48+
from typing import Any
49+
50+
from google.adk.agents.callback_context import CallbackContext
51+
from google.adk.agents.llm_agent import LlmAgent
52+
from google.adk.tools.mcp_tool import McpToolset
53+
from google.adk.tools.mcp_tool import StdioConnectionParams
54+
from mcp import StdioServerParameters
55+
from mcp.shared.session import ProgressFnT
56+
57+
_current_dir = os.path.dirname(os.path.abspath(__file__))
58+
_mock_server_path = os.path.join(_current_dir, "mock_progress_server.py")
59+
60+
61+
# Option 1: Simple shared callback
62+
async def simple_progress_callback(
63+
progress: float,
64+
total: float | None,
65+
message: str | None,
66+
) -> None:
67+
"""Handle progress notifications from MCP server.
68+
69+
This callback is shared by all tools in the toolset.
70+
"""
71+
if total is not None:
72+
percentage = (progress / total) * 100
73+
bar_length = 20
74+
filled = int(bar_length * progress / total)
75+
bar = "=" * filled + "-" * (bar_length - filled)
76+
print(f"[{bar}] {percentage:.0f}% ({progress}/{total}) {message or ''}")
77+
else:
78+
print(f"Progress: {progress} {f'- {message}' if message else ''}")
79+
80+
81+
# Option 2: Factory function for per-tool callbacks with runtime context
82+
def progress_callback_factory(
83+
tool_name: str,
84+
*,
85+
callback_context: CallbackContext | None = None,
86+
**kwargs: Any,
87+
) -> ProgressFnT | None:
88+
"""Create a progress callback for a specific tool.
89+
90+
This factory allows different tools to have different progress handling.
91+
It receives a CallbackContext for accessing and modifying runtime information
92+
like session state. The **kwargs parameter ensures forward compatibility.
93+
94+
Args:
95+
tool_name: The name of the MCP tool.
96+
callback_context: The callback context providing access to session,
97+
state, artifacts, and other runtime information. Allows modifying
98+
state via ctx.state['key'] = value. May be None if not available.
99+
**kwargs: Additional keyword arguments for future extensibility.
100+
101+
Returns:
102+
A progress callback function, or None if no callback is needed.
103+
"""
104+
# Example: Access session info from context (if available)
105+
session_id = "unknown"
106+
if callback_context and callback_context.session:
107+
session_id = callback_context.session.id
108+
109+
async def callback(
110+
progress: float,
111+
total: float | None,
112+
message: str | None,
113+
) -> None:
114+
# Include tool name and session info in the progress output
115+
prefix = f"[{tool_name}][session:{session_id}]"
116+
if total is not None:
117+
percentage = (progress / total) * 100
118+
bar_length = 20
119+
filled = int(bar_length * progress / total)
120+
bar = "=" * filled + "-" * (bar_length - filled)
121+
print(f"{prefix} [{bar}] {percentage:.0f}% {message or ''}")
122+
# Example: Store progress in state (callback_context allows modification)
123+
if callback_context:
124+
callback_context.state["last_progress"] = progress
125+
callback_context.state["last_total"] = total
126+
else:
127+
print(
128+
f"{prefix} Progress: {progress} {f'- {message}' if message else ''}"
129+
)
130+
131+
return callback
132+
133+
134+
root_agent = LlmAgent(
135+
model="gemini-2.5-flash",
136+
name="progress_demo_agent",
137+
instruction="""\
138+
You are a helpful assistant that can run long-running tasks.
139+
140+
Available tools:
141+
- long_running_task: Simulates a task with multiple steps. You can specify
142+
the number of steps and delay between them.
143+
- process_items: Processes a list of items one by one with progress updates.
144+
145+
When the user asks you to run a task, use these tools and the progress
146+
will be logged automatically.
147+
148+
Example requests:
149+
- "Run a long task with 5 steps"
150+
- "Process these items: apple, banana, cherry, date"
151+
""",
152+
tools=[
153+
McpToolset(
154+
connection_params=StdioConnectionParams(
155+
server_params=StdioServerParameters(
156+
command=sys.executable, # Use current Python interpreter
157+
args=[_mock_server_path],
158+
),
159+
timeout=60,
160+
),
161+
# Use factory function for per-tool callbacks (Option 2)
162+
# Or use simple_progress_callback for shared callback (Option 1)
163+
progress_callback=progress_callback_factory,
164+
)
165+
],
166+
)

0 commit comments

Comments
 (0)