Support provider-prefixed Gemini model IDs#5555
Support provider-prefixed Gemini model IDs#5555kenrogers wants to merge 3 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. |
|
Response from ADK Triaging Agent Hello @kenrogers, thank you for creating this PR! Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). You can find more information at https://cla.developers.google.com/. Thanks! |
|
Hi @kenrogers , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Please fix formatting errors by running autoformat.sh |
Summary
gemini/gemini-2.5-flash,vertex_ai/gemini-2.5-flash, andopenrouter/google/gemini-2.5-pro:onlineprojects/...paths from being treated as valid Gemini IDsOPENROUTER_API_KEY,api_base, andopenrouter/...model usageWhy
ADK's Gemini tool checks already normalize native model IDs and Vertex/Apigee paths, but provider-prefixed LiteLLM model IDs were left as-is. That made Google Search reject routed Gemini IDs even when the underlying model name was Gemini. This updates the shared model-name utility so existing Gemini classification paths work for provider-prefixed IDs without special-casing one provider.
Refs #2709.
Tests
uv run --extra test pytest tests/unittests/utils/test_model_name_utils.py tests/unittests/tools/test_google_search_tool.pyuv run --extra dev pyink --check --diff --config pyproject.toml src/google/adk/utils/model_name_utils.py tests/unittests/utils/test_model_name_utils.py tests/unittests/tools/test_google_search_tool.py contributing/samples/hello_world_openrouter/agent.py contributing/samples/hello_world_openrouter/__init__.pyuv run --extra test python -m py_compile contributing/samples/hello_world_openrouter/agent.py