Streaming Tools tutorial from the official guide fails.
Bug Desrciption Streaming Tools tutorial in the official guide (https://google.github.io/adk-docs/streaming/streaming-tools/) is failing.
Steps To Reproduce
- Run the code mentioned in https://google.github.io/adk-docs/streaming/streaming-tools/
- It will fail with following error,
2025-09-19 11:48:08,750 - ERROR - adk_web_server.py:1076 - Error in event_generator: Failed to parse the parameter return_value: AsyncGenerator[str, NoneType] of function get_menu for automatic function calling. Automatic function calling works best with simpler function signature schema, consider manually parsing your function declaration for function get_menu.
Traceback (most recent call last):
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/cli/adk_web_server.py", line 1066, in event_generator
async for event in agen:
...<7 lines>...
yield f"data: {sse_event}\n\n"
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/runners.py", line 314, in run_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/runners.py", line 310, in _run_with_trace
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/runners.py", line 354, in _exec_with_plugin
async for event in agen:
...<8 lines>...
yield (modified_event if modified_event else event)
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/runners.py", line 304, in execute
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/base_agent.py", line 248, in run_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/base_agent.py", line 238, in _run_with_trace
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/llm_agent.py", line 288, in _run_async_impl
async for event in agen:
self.__maybe_save_output_to_state(event)
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 401, in run_async
async for event in agen:
last_event = event
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 447, in _run_one_step_async
async for event in agen:
...<3 lines>...
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 539, in _postprocess_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 667, in _postprocess_handle_function_calls_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/base_agent.py", line 248, in run_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/base_agent.py", line 238, in _run_with_trace
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/agents/llm_agent.py", line 288, in _run_async_impl
async for event in agen:
self.__maybe_save_output_to_state(event)
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 401, in run_async
async for event in agen:
last_event = event
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 420, in _run_one_step_async
async for event in agen:
yield event
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 487, in _preprocess_async
await tool.process_llm_request(
tool_context=tool_context, llm_request=llm_request
)
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/tools/base_tool.py", line 129, in process_llm_request
llm_request.append_tools([self])
File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/models/llm_request.py", line 102, in append_tools declaration = tool._get_declaration() File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/tools/function_tool.py", line 87, in _get_declaration build_function_declaration( ~~~~~~~~~~~~~~~~~~~~~~~~~~^ func=self.func, ^^^^^^^^^^^^^^^ ...<3 lines>... variant=self._api_variant, ^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/tools/_automatic_function_calling_util.py", line 235, in build_function_declaration from_function_with_options(func, variant) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/tools/_automatic_function_calling_util.py", line 382, in from_function_with_options _function_parameter_parse_util._parse_schema_from_parameter( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ variant, ^^^^^^^^ return_value, ^^^^^^^^^^^^^ func.name, ^^^^^^^^^^^^^^ ) ^ File "/Users/bharen/venv/adkpython/lib/python3.13/site-packages/google/adk/tools/_function_parameter_parse_util.py", line 310, in _parse_schema_from_parameter raise ValueError( ...<4 lines>... ) ValueError: Failed to parse the parameter return_value: AsyncGenerator[str, NoneType] of function get_menu for automatic function calling. Automatic function calling works best with simpler function signature schema, consider manually parsing your function declaration for function get_menu.
Expected behavior Streaming works
Desktop (please complete the following information):
- OS: Mac
- Python version(python -V):3.13.3
- ADK version(pip show google-adk):1.14.0
Model Information:
- Which model is being used(e.g. gemini-2.5-pro): Gemini 2.5 pro
Additional context I checked adk/tools/_function_parameter_parse_util.py and it seems that if the Tool has return type of AsyncGenerator, it will return the above error. I have not checked the history but this could be deprecation (in which case, the tutorial should be removed) or regression.
@hangfei I see that this issue was marked as closed but I am able to repro this on the current latest version: 1.17.0. Should this issue be reopened?
For some reason, for me it works fine with the ai-studio model but not when using the vertex-ai variant:
✅ gemini-2.5-flash-native-audio-preview-09-2025
tools_dict={'test': <google.adk.tools.function_tool.FunctionTool object at 0x1119246e0>
💥 gemini-live-2.5-flash-preview-native-audio-09-2025
.venv/lib/python3.13/site-packages/google/adk/tools/_function_parameter_parse_util.py", line 325, in _parse_schema_from_parameter
raise ValueError(
...<4 lines>...
)
ValueError: Failed to parse the parameter return_value: AsyncGenerator[str, NoneType]
Same code, I just flipped the GOOGLE_GENAI_USE_VERTEXAI env variable.
This issue is still present in 1.18.0 version:
ValueError: Failed to parse the parameter return_value: AsyncGenerator[str, NoneType] of function send_message_stream for automatic function calling. Automatic function calling works best with simpler function signature schema, consider manually parsing your function declaration for function send_message_stream.
I have the same error; is there a workaround or fix ?
This issue is present in all versions from 1.14.0 - 1.20.0. Is there a reason it's been moved from adk-python to adk-docs since it is a bug not just a docs issue. And a reason for closing as complete?