fix(translator): honor APIKeyPassthrough for Gemini provider#2042
fix(translator): honor APIKeyPassthrough for Gemini provider#2042mesutoezdil wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the Gemini model translation path so it correctly supports APIKeyPassthrough, aligning Gemini with the behavior already implemented for other providers in the ADK agent translator.
Changes:
- Avoid injecting the Google API key env var/secret ref when
APIKeyPassthroughis enabled (and only mount the secret when passthrough is off and a secret is configured). - Ensure the translated
adk.Geminimodel config reflectsapi_key_passthrough.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adb6fd6 to
ce7e91f
Compare
EItanya
left a comment
There was a problem hiding this comment.
Makes sense, is passthrough implemented for Gemini in our adk + adk go?
hm not fully. the python adk has the api_key_passthrough field on kagentgeminillm but is missing set_passthrough_key(), so llmassthroughplugin skips gemini at runtime. go adk has no gemini model implementation at all. my pr fixes the translator side only. |
If this doesn't fully work then can we add those fixes? |
db8f006 to
4781a44
Compare
- skip Google API key secret mount when passthrough is enabled - set api_key_passthrough on adk.Gemini model struct - implement set_passthrough_key on KAgentGeminiLlm so LLMPassthroughPlugin works at runtime Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
4781a44 to
4a2fc83
Compare
done |
The Gemini provider in the model translator was not checking
APIKeyPassthrough.It always tried to mount the Google API key secret, even when passthrough mode was enabled.
It also never set
APIKeyPassthroughon the ADK model struct.All other providers (OpenAI, Anthropic, AzureOpenAI, Ollama) already handle this correctly.