Skip to content

Commit 3d48401

Browse files
Merge branch 'main' into mcp-missing-attr
2 parents a055262 + a08bf62 commit 3d48401

File tree

109 files changed

+10246
-5431
lines changed

Some content is hidden

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

109 files changed

+10246
-5431
lines changed

CHANGELOG.md

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

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

590
### ⚠ 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}"

contributing/samples/hello_world_stream_fc_args/agent.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def concat_number_and_string(num: int, s: str) -> str:
2929
return str(num) + ': ' + s
3030

3131

32+
def write_document(document: str) -> dict[str, str]:
33+
"""Write a document."""
34+
return {'status': 'ok'}
35+
36+
3237
root_agent = Agent(
3338
model='gemini-3-pro-preview',
3439
name='hello_world_stream_fc_args',
@@ -38,9 +43,14 @@ def concat_number_and_string(num: int, s: str) -> str:
3843
You can use the `concat_number_and_string` tool to concatenate a number and a string.
3944
You should always call the concat_number_and_string tool to concatenate a number and a string.
4045
You should never concatenate on your own.
46+
47+
You can use the `write_document` tool to write a document.
48+
You should always call the write_document tool to write a document.
49+
You should never write a document on your own.
4150
""",
4251
tools=[
4352
concat_number_and_string,
53+
write_document,
4454
],
4555
generate_content_config=types.GenerateContentConfig(
4656
automatic_function_calling=types.AutomaticFunctionCallingConfig(
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# MCP Toolset OAuth Authentication Sample
2+
3+
This sample demonstrates the toolset authentication feature where OAuth credentials are required for both tool listing and tool calling.
4+
5+
## Overview
6+
7+
The toolset authentication flow works in two phases:
8+
9+
1. **Phase 1**: When the agent tries to get tools from the MCP server without credentials, the toolset signals "authentication required" and returns an auth request event.
10+
11+
2. **Phase 2**: After the user provides OAuth credentials, the agent can successfully list and call tools.
12+
13+
## Files
14+
15+
- `oauth_mcp_server.py` - MCP server that requires Bearer token authentication
16+
- `agent.py` - Agent configuration with OAuth-protected MCP toolset
17+
- `main.py` - Test script demonstrating the two-phase auth flow
18+
19+
## Running the Sample
20+
21+
1. Start the MCP server in one terminal:
22+
23+
```bash
24+
PYTHONPATH=src python contributing/samples/mcp_toolset_auth/oauth_mcp_server.py
25+
```
26+
27+
2. Run the test script in another terminal:
28+
29+
```bash
30+
PYTHONPATH=src python contributing/samples/mcp_toolset_auth/main.py
31+
```
32+
33+
## Expected Behavior
34+
35+
1. First invocation yields an `adk_request_credential` function call
36+
2. The credential ID is `_adk_toolset_auth_McpToolset` to indicate toolset auth
37+
3. After providing the access token, the agent can list and call tools
38+
39+
## Testing with ADK Web UI
40+
41+
You can also test with the ADK web UI:
42+
43+
```bash
44+
adk web contributing/samples/mcp_toolset_auth
45+
```
46+
47+
Note: The web UI will display the auth request and you'll need to manually provide credentials.
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: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
"""Agent that uses MCP toolset requiring OAuth authentication.
16+
17+
This agent demonstrates the toolset authentication feature where OAuth
18+
credentials are required for both tool listing and tool calling.
19+
"""
20+
21+
from __future__ import annotations
22+
23+
from fastapi.openapi.models import OAuth2
24+
from fastapi.openapi.models import OAuthFlowAuthorizationCode
25+
from fastapi.openapi.models import OAuthFlows
26+
from google.adk.agents import LlmAgent
27+
from google.adk.auth.auth_credential import AuthCredential
28+
from google.adk.auth.auth_credential import AuthCredentialTypes
29+
from google.adk.auth.auth_credential import OAuth2Auth
30+
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
31+
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset
32+
33+
# OAuth2 auth scheme with authorization code flow
34+
# This specifies the OAuth metadata needed for the full OAuth flow
35+
auth_scheme = OAuth2(
36+
flows=OAuthFlows(
37+
authorizationCode=OAuthFlowAuthorizationCode(
38+
authorizationUrl='https://example.com/oauth/authorize',
39+
tokenUrl='https://example.com/oauth/token',
40+
scopes={'read': 'Read access', 'write': 'Write access'},
41+
)
42+
)
43+
)
44+
45+
# OAuth credential with client credentials (used for token exchange)
46+
# In a real scenario, this would be used to obtain the access token
47+
auth_credential = AuthCredential(
48+
auth_type=AuthCredentialTypes.OAUTH2,
49+
oauth2=OAuth2Auth(
50+
client_id='test_client_id',
51+
client_secret='test_client_secret',
52+
),
53+
)
54+
55+
# Create the MCP toolset with OAuth authentication
56+
mcp_toolset = McpToolset(
57+
connection_params=StreamableHTTPConnectionParams(
58+
url='http://localhost:3001/mcp',
59+
),
60+
auth_scheme=auth_scheme,
61+
auth_credential=auth_credential,
62+
)
63+
64+
# Define the agent that uses the OAuth-protected MCP toolset
65+
root_agent = LlmAgent(
66+
model='gemini-2.0-flash',
67+
name='oauth_mcp_agent',
68+
instruction="""You are a helpful assistant that can access user information.
69+
70+
You have access to tools that require authentication:
71+
- get_user_profile: Get profile information for a specific user
72+
- list_users: List all available users
73+
74+
When the user asks about users, use these tools to help them.""",
75+
tools=[mcp_toolset],
76+
)

0 commit comments

Comments
 (0)