Repository navigation
Streaming tools example in the documentation does not work #3955
Description
Describe the bug
The streaming tool example in https://google.github.io/adk-docs/streaming/streaming-tools/ returns errors on tool invokation.
To Reproduce
Steps to reproduce the behavior:
Run adk create streaming-tool-example
Take the code from the documentation and replace in agent.py file (adding right imports, API key etc)
Run adk web
Error 1 - running the example as is
ValueError: Failed to parse the parameter return_value: AsyncGenerator[str, NoneType] of function monitor_stock_price for automatic function calling.Automatic function calling works best with simpler function signature schema, consider manually parsing your function declaration for function monitor_stock_price.
Error 2 - removing type hinting from the monitor_stock_price function
async def monitor_stock_price(stock_symbol: str) -> AsyncGenerator[str, None]:
with
async def monitor_stock_price(stock_symbol: str):
Running adk web and requesting the agent eg "provide stock price for GOOGL" returns the following error:
Unable to serialize unknown type: <class 'async_generator'>.
TypeError: cannot pickle 'async_generator'
Desktop (please complete the following information):
- OS: macOS
- Python version(python -V): Python 3.11.14
- ADK version(pip show google-adk): 1.21.0 , 1.18.0 (tested both)
Model Information:
- Are you using LiteLLM: No
- gemini-2.0-flash-exp
Activity
alvarossl commentedon Dec 18, 2025
More detail on error 2:
llalitkumarrr commentedon Jan 9, 2026
Hello @alvarossl ,
Thank you for bringing this to our attention. We have reproduced the issue and observed the same error. We are currently investigating it in detail. In the meantime, could you please check if Bidi Streamer meets your requirements?
morganroux commentedon Jan 21, 2026
Hello @llalitkumarrr
Jumping right from the ADK community call, did your team already start working on this ?
I can have a look as a first issue.
morganroux commentedon Jan 25, 2026
After investigating, I found the root cause:
adk webdoesn't call the/run_liveendpoint when using text input. As a result, streaming tools are not processed correctly.Quick workaround: Using the microphone button and speaking to the agent (instead of typing) triggers the correct
/run_liveendpoint, which properly showcases the example.Proposed solutions:
Documentation update: Clarify that this example currently only works with the live-audio option, and direct users to the bidi-demo sample for reference.
Feature enhancement: I can dig into implementing text-based live streaming in
adk web, similar to how it's done in the bidi-demo, to enable the/run_liveendpoint for text input.What do you think @llalitkumarrr?
llalitkumarrr commentedon Feb 5, 2026
Hello @morganroux ,
Thank you for taking time to dig deep into this, you are welcome to raise PR with your proposed solution. Our team will review it and merge once all checks are cleared.
ItsMacto commentedon Feb 11, 2026
Hi this PR works to close this issue: #4447
llalitkumarrr commentedon Feb 11, 2026
Hello @ItsMacto ,
I think this PR needs to be rebased as the branch is currently out of date. Could you please take a look at this?
@ryanaiagent , could you please guide us on the next steps required to merge this?
ItsMacto commentedon Feb 11, 2026
Hi @llalitkumarrr ,
Should be up-to-date with main. Thanks
morganroux commentedon Feb 14, 2026
Hello @ItsMacto @llalitkumarrr @ryanaiagent
I just finished my PR to solve the issue here on adk-web side.
morganroux commentedon Mar 1, 2026
@llalitkumarrr can you help me to move my adk-web PR forward please ?
llalitkumarrr commentedon Mar 16, 2026
Hello @rohityan ,
Please take a look at this.
adk-bot commentedon Mar 24, 2026
This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.
adk-bot commentedon Mar 31, 2026
This has been automatically closed because it has been marked as stale for over 7 days.