feat(plugins): add fallback plugin to automatically fallback between Gemini models#4530
feat(plugins): add fallback plugin to automatically fallback between Gemini models#4530benmizrahi wants to merge 5 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @benmizrahi, 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 introduces a Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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 @benmizrahi, thank you for creating this PR! It looks like the Contributor License Agreement (CLA) check has failed. Before we can review your contribution, you'll need to sign the CLA. You can find more information at https://cla.developers.google.com/. Also, could you please add a Thank you! |
There was a problem hiding this comment.
Code Review
This pull request introduces a FallbackPlugin to handle automatic model fallbacks, complete with documentation, a usage sample, and thorough unit tests. The implementation is well-structured and the feature is a valuable addition. My review includes suggestions to enhance the clarity of the sample agent's configuration, improve the plugin's initialization for better safety and performance, replace magic numbers with constants for maintainability, and address minor style and logic issues in the unit tests.
There was a problem hiding this comment.
Code Review
This pull request introduces a FallbackPlugin to handle model fallbacks for specific HTTP error codes. The implementation is solid, with good documentation and comprehensive unit tests. My main feedback is to ensure consistency in the model names used in the README examples to align with the sample code, which will improve clarity for users.
There was a problem hiding this comment.
The model names in this configuration example are inconsistent with the sample agent code (agent.py). To avoid confusion, please update the model names to match the sample implementation (gemini-3-flash-preview and gemini-2.5-pro).
| root_model="gemini-2.0-flash", # Primary model, always tried first. | |
| fallback_model="gemini-1.5-pro", # Backup model recorded in metadata. | |
| root_model="gemini-3-flash-preview", # Primary model, always tried first. | |
| fallback_model="gemini-2.5-pro", # Backup model recorded in metadata. |
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
google/adk-python-community#88
Unit Tests:
All passed