-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Add progressive streaming for run_async via ProgressiveTool (partial progress + final result) #3564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add progressive streaming for run_async via ProgressiveTool (partial progress + final result) #3564
Conversation
…rtial progress + final result)
…r-streaming-tools
Summary of ChangesHello @sandangel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience by enabling tools to provide progressive updates during long-running operations. By introducing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Response from ADK Triaging Agent Hello @sandangel, thank you for creating this PR! To help reviewers better understand and review your contribution, could you please fill out the PR description template? Specifically, please provide:
This information will help us to review your PR more efficiently. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant feature: the ProgressiveTool for streaming partial results from asynchronous tools. The changes are well-structured, adding new tool base classes, a wrapper tool, and updating the core LLM flow to handle progressive streaming. The new functionality is supported by a comprehensive set of unit and integration tests. My review identifies a critical issue in the handling of mixed (progressive and non-progressive) tool calls that could lead to incorrect behavior. I have also included a couple of medium-severity suggestions to improve the maintainability and correctness of the new ProgressiveTool implementation.
…essiveTool Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
|
Fixed all failed tests and linting/formatting errors. |
Linked Issue
Closes: #2014
Resolve merge conflicts in #2698
Summary
This PR introduces progressive streaming support for non-live runs (
run_async).Rationale
Users need progress visibility for long-running tools during
run_async, without switching to the live APIs. This feature mirrors live runner ergonomics while remaining opt-in and ensuring model reasoning is unchanged (only final outputs affect the model).New API
Supported patterns:
Changes
Backward Compatibility
Testing Plan
Unit Tests (added)
Commands:
# Run only progressive tool/flow tests pytest -q tests/unittests/tools/test_progressive_tool.py \ tests/unittests/flows/llm_flows/test_progressive_flow.py \ tests/unittests/flows/llm_flows/test_functions_progressive_unit.pyManual End-to-End (E2E)
Minimal script with
InMemoryRunner+ProgressiveTool(export_report)(async generator).Observed output (truncated):
Partial events:
{"status": "started", "country": "Germany"} {"status": "progress", "percent": 20} ... {"status": "progress", "percent": 100} {"status": "completed", "url": "https://example.com/germany.pdf"}Model Reply
The report for Germany has been exported and can be accessed at https://example.com/germany.pdfDocumentation
No user-facing docs changed in this PR. A follow-up PR to
adk-docswill add a short usage guide forProgressiveTool.