forked from google/adk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from google:main #85
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change introduces a `flush` method to the `BigQueryAgentAnalyticsPlugin`. This ensures that all pending log events are written to BigQuery before the agent's run completes. Key changes: - Added `flush()` method to `BigQueryAgentAnalyticsPlugin` to force write of pending events. PiperOrigin-RevId: 859263853
Merge #4136 **Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.** ### Link to Issue or Description of Change **1. Link to an existing issue (if applicable):** Allow google search tool to set different model #4135 **2. Or, if no issue exists, describe the change:** _If applicable, please follow the issue templates to provide as much detail as possible._ **Problem:** Currently, the Google Search tool inherits and uses the same LLM model set from the parent agent for processing and summarizing search results. This creates a limitation for users who wish to decouple the agent's reasoning model from the model used for search summarization (e.g., for cost optimization or using a lightweight model for simpler summarization tasks). **Solution:** I have updated the Google Search tool to accept an optional LLM model parameter. Custom Model: Users can now explicitly specify which model should be used for processing search results. Default Behavior: If no model is specified, the tool defaults to the parent agent's model, ensuring backward compatibility. ``` # If a custom model is specified, use it instead of the original model if self.model is not None: llm_request.model = self.model ``` ### Testing Plan Added a new test case test_process_llm_request_with_custom_model in [test_google_search_tool.py] that verifies: When a custom model parameter is provided to GoogleSearchTool, it overrides the model from the incoming llm_request during process_llm_request The tool correctly uses the custom model for LLM calls while maintaining other request parameters **Unit Tests:** - [X] I have added or updated unit tests for my change. - [X] All unit tests pass locally. (base) wanglu2:adk-python/ (feature/allow-google-search-tool-set-different-llm✗) $ uv run pytest ./tests/unittests/tools/test_google_search_tool.py [22:07:32] ======================================================================== test session starts ======================================================================== platform darwin -- Python 3.13.1, pytest-9.0.2, pluggy-1.6.0 rootdir: /Users/wanglu2/Documents/Git/adk-python configfile: pyproject.toml plugins: mock-3.15.1, anyio-4.12.0, xdist-3.8.0, asyncio-1.3.0, langsmith-0.6.0 asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function collected 21 items tests/unittests/tools/test_google_search_tool.py ..................... [100%] ======================================================================== 21 passed in 7.91s ========================================================================= ### Checklist - [X] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document. - [X] I have performed a self-review of my own code. - [X] I have commented my code, particularly in hard-to-understand areas. - [X] I have added tests that prove my fix is effective or that my feature works. - [X] New and existing unit tests pass locally with my changes. - [X] I have manually tested my changes end-to-end. - [ ] Any dependent changes have been merged and published in downstream modules. ### Additional context Co-authored-by: Kathy Wu <wukathy@google.com> COPYBARA_INTEGRATE_REVIEW=#4136 from lwangverizon:feature/allow-google-search-tool-set-different-llm 239ea95 PiperOrigin-RevId: 859265757
Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 859321034
Merge #4221 ### Link to Issue or Description of Change N/A **2. Or, if no issue exists, describe the change:** Fixing various typos in .py files to improve quality: see commit diffs for details **Problem:** See above **Solution:** Fixing the typos ### Testing Plan N/A **Unit Tests:** N/A **Manual End-to-End (E2E) Tests:** N/A ### Checklist - [X] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document. - [X] I have performed a self-review of my own code. - [N/A] I have commented my code, particularly in hard-to-understand areas. - [N/A ] I have added tests that prove my fix is effective or that my feature works. - [N/A] New and existing unit tests pass locally with my changes. - [N/A] I have manually tested my changes end-to-end. - [N/A ] Any dependent changes have been merged and published in downstream modules. ### Additional context N/A COPYBARA_INTEGRATE_REVIEW=#4221 from didier-durand:fix-typos-e 1bcc8e0 PiperOrigin-RevId: 859332402
This is a stopgap before the actual fix is added for 1.80.17+. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 859351463
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )