Skip to content

Streaming tools example in the documentation does not work #3955

@alvarossl

Description

@alvarossl

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

Metadata

Metadata

Labels

documentation[Component] This issue is related to documentation, it will be transferred to adk-docsgood first issue[Community] This issue is good for newcomers to participatelive[Component] This issue is related to live, voice and video chatrequest clarification[Status] The maintainer need clarification or more information from the authorstale[Status] Issues which have been marked inactive since there is no user response

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions