Skip to content

Commit 28082be

Browse files
authored
Merge branch 'main' into a2a-url
2 parents 108b727 + d620bcb commit 28082be

File tree

61 files changed

+6827
-656
lines changed

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

+6827
-656
lines changed

.github/workflows/pr-triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: ADK Pull Request Triaging Agent
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, reopened, edited]
66

77
jobs:
@@ -33,6 +33,6 @@ jobs:
3333
OWNER: 'google'
3434
REPO: 'adk-python'
3535
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
36-
INTERACTIVE: ${{ secrets.PR_TRIAGE_INTERACTIVE }}
36+
INTERACTIVE: ${{ vars.PR_TRIAGE_INTERACTIVE }}
3737
PYTHONPATH: contributing/samples
3838
run: python -m adk_pr_triaging_agent.main

CHANGELOG.md

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

3+
## [1.9.0](https://github.com/google/adk-python/compare/v1.8.0...v1.9.0) (2025-07-31)
4+
5+
6+
### Features
7+
8+
* [CLI] Add `-v`, `--verbose` flag to enable DEBUG logging as a shortcut for `--log_level DEBUG` ([3be0882](https://github.com/google/adk-python/commit/3be0882c63bf9b185c34bcd17e03769b39f0e1c5))
9+
* [CLI] Add a CLI option to update an agent engine instance ([206a132](https://github.com/google/adk-python/commit/206a13271e5f1bb0bb8114b3bb82f6ec3f030cd7))
10+
* [CLI] Modularize fast_api.py to allow simpler construction of API Server ([bfc203a](https://github.com/google/adk-python/commit/bfc203a92fdfbc4abaf776e76dca50e7ca59127b), [dfc25c1](https://github.com/google/adk-python/commit/dfc25c17a98aaad81e1e2f140db83d17cd78f393), [e176f03](https://github.com/google/adk-python/commit/e176f03e8fe13049187abd0f14e63afca9ccff01))
11+
* [CLI] Refactor AgentLoader into base class and add InMemory impl alongside existing filesystem impl ([bda3df2](https://github.com/google/adk-python/commit/bda3df24802d0456711a5cd05544aea54a13398d))
12+
* [CLI] Respect the .ae_ignore file when deploying to agent engine ([f29ab5d](https://github.com/google/adk-python/commit/f29ab5db0563a343d6b8b437a12557c89b7fc98b))
13+
* [Core] Add new callbacks to handle tool and model errors ([00afaaf](https://github.com/google/adk-python/commit/00afaaf2fc18fba85709754fb1037bb47f647243))
14+
* [Core] Add sample plugin for logging ([20537e8](https://github.com/google/adk-python/commit/20537e8bfa31220d07662dad731b4432799e1802))
15+
* [Core] Expose Gemini RetryOptions to client ([1639298](https://github.com/google/adk-python/commit/16392984c51b02999200bd4f1d6781d5ec9054de))
16+
* [Evals] Added an Fast API new endpoint to serve eval metric info ([c69dcf8](https://github.com/google/adk-python/commit/c69dcf87795c4fa2ad280b804c9b0bd3fa9bf06f))
17+
* [Evals] Refactored AgentEvaluator and updated it to use LocalEvalService ([1355bd6](https://github.com/google/adk-python/commit/1355bd643ba8f7fd63bcd6a7284cc48e325d138e))
18+
19+
20+
### Bug Fixes
21+
22+
* Add absolutize_imports option when deploying to agent engine ([fbe6a7b](https://github.com/google/adk-python/commit/fbe6a7b8d3a431a1d1400702fa534c3180741eb3))
23+
* Add space to allow adk deploy cloud_run --a2a ([70c4616](https://github.com/google/adk-python/commit/70c461686ec2c60fcbaa384a3f1ea2528646abba))
24+
* Copy the original function call args before passing it to callback or tools to avoid being modified ([3432b22](https://github.com/google/adk-python/commit/3432b221727b52af2682d5bf3534d533a50325ef))
25+
* Eval module not found exception string ([7206e0a](https://github.com/google/adk-python/commit/7206e0a0eb546a66d47fb411f3fa813301c56f42))
26+
* Fix incorrect token count mapping in telemetry ([c8f8b4a](https://github.com/google/adk-python/commit/c8f8b4a20a886a17ce29abd1cfac2858858f907d))
27+
* Import cli's artifact dependencies directly ([282d67f](https://github.com/google/adk-python/commit/282d67f253935af56fae32428124a385f812c67d))
28+
* Keep existing header values while merging tracking headers for `llm_request.config.http_options` in `Gemini.generate_content_async` ([6191412](https://github.com/google/adk-python/commit/6191412b07c3b5b5a58cf7714e475f63e89be847))
29+
* Merge tracking headers even when `llm_request.config.http_options` is not set in `Gemini.generate_content_async` ([ec8dd57](https://github.com/google/adk-python/commit/ec8dd5721aa151cfc033cc3aad4733df002ae9cb))
30+
* Restore bigquery sample agent to runnable form ([16e8419](https://github.com/google/adk-python/commit/16e8419e32b54298f782ba56827e5139effd8780))
31+
* Return session state in list_session API endpoint ([314d6a4](https://github.com/google/adk-python/commit/314d6a4f95c6d37c7da3afbc7253570564623322))
32+
* Runner was expecting Event object instead of Content object when using early exist feature ([bf72426](https://github.com/google/adk-python/commit/bf72426af2bfd5c2e21c410005842e48b773deb3))
33+
* Unable to acquire impersonated credentials ([9db5d9a](https://github.com/google/adk-python/commit/9db5d9a3e87d363c1bac0f3d8e45e42bd5380d3e))
34+
* Update `agent_card_builder` to follow grammar rules ([9c0721b](https://github.com/google/adk-python/commit/9c0721beaa526a4437671e6cc70915073be835e3)), closes [#2223](https://github.com/google/adk-python/issues/2223)
35+
* Use correct type for actions parameter in ApplicationIntegrationToolset ([ce7253f](https://github.com/google/adk-python/commit/ce7253f63ff8e78bccc7805bd84831f08990b881))
36+
37+
38+
### Documentation
39+
40+
* Update documents about the information of vibe coding ([0c85587](https://github.com/google/adk-python/commit/0c855877c57775ad5dad930594f9f071164676da))
41+
42+
343
## [1.8.0](https://github.com/google/adk-python/compare/v1.7.0...v1.8.0) (2025-07-23)
444

545
### Features
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Parallel Function Test Agent
2+
3+
This agent demonstrates parallel function calling functionality in ADK. It includes multiple tools with different processing times to showcase how parallel execution improves performance compared to sequential execution.
4+
5+
## Features
6+
7+
- **Multiple async tool types**: All functions use proper async patterns for true parallelism
8+
- **Thread safety testing**: Tools modify shared state to verify thread-safe operations
9+
- **Performance demonstration**: Clear time differences between parallel and sequential execution
10+
- **GIL-aware design**: Uses `await asyncio.sleep()` instead of `time.sleep()` to avoid blocking
11+
12+
## Tools
13+
14+
1. **get_weather(city)** - Async function, 2-second delay
15+
2. **get_currency_rate(from_currency, to_currency)** - Async function, 1.5-second delay
16+
3. **calculate_distance(city1, city2)** - Async function, 1-second delay
17+
4. **get_population(cities)** - Async function, 0.5 seconds per city
18+
19+
**Important**: All functions use `await asyncio.sleep()` instead of `time.sleep()` to ensure true parallel execution. Using `time.sleep()` would block Python's GIL and force sequential execution despite asyncio parallelism.
20+
21+
## Testing Parallel Function Calling
22+
23+
### Basic Parallel Test
24+
```
25+
Get the weather for New York, London, and Tokyo
26+
```
27+
Expected: 3 parallel get_weather calls (~2 seconds total instead of ~6 seconds sequential)
28+
29+
### Mixed Function Types Test
30+
```
31+
Get the weather in Paris, the USD to EUR exchange rate, and the distance between New York and London
32+
```
33+
Expected: 3 parallel async calls with different functions (~2 seconds total)
34+
35+
### Complex Parallel Test
36+
```
37+
Compare New York and London by getting weather, population, and distance between them
38+
```
39+
Expected: Multiple parallel calls combining different data types
40+
41+
### Performance Comparison Test
42+
You can test the timing difference by asking for the same information in different ways:
43+
44+
**Sequential-style request:**
45+
```
46+
First get the weather in New York, then get the weather in London, then get the weather in Tokyo
47+
```
48+
*Expected time: ~6 seconds (2s + 2s + 2s)*
49+
50+
**Parallel-style request:**
51+
```
52+
Get the weather in New York, London, and Tokyo
53+
```
54+
*Expected time: ~2 seconds (max of parallel 2s delays)*
55+
56+
The parallel version should be **3x faster** due to concurrent execution.
57+
58+
## Thread Safety Testing
59+
60+
All tools modify the agent's state (`tool_context.state`) with request logs including timestamps. This helps verify that:
61+
- Multiple tools can safely modify state concurrently
62+
- No race conditions occur during parallel execution
63+
- State modifications are preserved correctly
64+
65+
## Running the Agent
66+
67+
```bash
68+
# Start the agent in interactive mode
69+
adk run contributing/samples/parallel_functions
70+
71+
# Or use the web interface
72+
adk web
73+
```
74+
75+
## Example Queries
76+
77+
- "Get weather for New York, London, Tokyo, and Paris" *(4 parallel calls, ~2s total)*
78+
- "What's the USD to EUR rate and GBP to USD rate?" *(2 parallel calls, ~1.5s total)*
79+
- "Compare New York and San Francisco: weather, population, and distance" *(3 parallel calls, ~2s total)*
80+
- "Get population data for Tokyo, London, Paris, and Sydney" *(1 call with 4 cities, ~2s total)*
81+
- "What's the weather in Paris and the distance from Paris to London?" *(2 parallel calls, ~2s total)*
82+
83+
## Common Issues and Solutions
84+
85+
### ❌ Problem: Functions still execute sequentially (6+ seconds for 3 weather calls)
86+
87+
**Root Cause**: Using blocking operations like `time.sleep()` in function implementations.
88+
89+
**Solution**: Always use async patterns:
90+
```python
91+
# ❌ Wrong - blocks the GIL, forces sequential execution
92+
def my_tool():
93+
time.sleep(2) # Blocks entire event loop
94+
95+
# ✅ Correct - allows true parallelism
96+
async def my_tool():
97+
await asyncio.sleep(2) # Non-blocking, parallel-friendly
98+
```
99+
100+
### ✅ Verification: Check execution timing
101+
- Parallel execution: ~2 seconds for 3 weather calls
102+
- Sequential execution: ~6 seconds for 3 weather calls
103+
- If you see 6+ seconds, your functions are blocking the GIL
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

0 commit comments

Comments
 (0)