feat(adk): native Gemini factory for Format=Gemini proxies - #693
Merged
Merged
Conversation
Add donkey.adk.gemini() and the module-level integrations.adk.gemini(): they return ADK's native google.adk.models.Gemini bound to a Format=Gemini proxy, with the shared DonkeyAsyncClient injected via HttpOptions.httpx_async_client (BG §1.8). model() stays on LiteLLM. Core, so gemini() records no conformance exemption: - transport: read the requested model from the Gemini URL path (models/<m>:generateContent|streamGenerateContent) when the body has none. - lastcall: parse Gemini usageMetadata (buffered and SSE). Live-verified 2026-09-29 against ddk-gemini-inbound (§0.3): x-goog-api-key coexists with client_id/secret, streaming, tool calling, 401/404 refusals (classify(exc.response)), body model ignored. Redacted fixtures added. verify_frameworks gains an adk.gemini row (VERIFIED LIVE). Docs, ledger (§2, §8), READMEs and website updated. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #691
Summary
donkey.adk.gemini("gemini-2.5-flash", **kw)and the module-leveldonkey_kit.integrations.adk.geminireturn ADK's nativegoogle.adk.models.Gemini, bound to aFormat=Geminiproxy. The sharedDonkeyAsyncClientis injected throughHttpOptions.httpx_async_client(BG §1.8).gemini_connection_kwargs()is the manual-equivalent escape hatch.model()is unchanged (LiteLLM).core/transport.pyreads the requested model from the Gemini URL path (models/<m>:generateContent|streamGenerateContent) when the body has none.core/lastcall.pyparses GeminiusageMetadata, both buffered and SSE.last_callall work, andgemini()records no conformance exemption. The ADKKNOWN_LIMITATIONSrows are now scoped tomodel().ddk-gemini-inbound(§0.3):x-goog-api-keycoexists withclient_id/client_secret.AuthError. Unknown model → Google's 404, which classifies asUpstreamRequestError, viaclassify(exc.response). The nativeAPIErroris not wrapped.modelfield.tests/fixtures/anypoint/gemini_inbound/.verify_frameworks.pyhas a newadk.geminirow. The live check runs whenDONKEY_GEMINI_PROXY_URLis set; it reported VERIFIED (LIVE) here.Docs (ddk-docs-sync)
docs/verified-apis.md: the §2 Gemini row was re-probed and "no SDK adapter" removed; §8 has a new ADK-native-Gemini row, VERIFIED (LIVE). Maintainer sign-off on that row = approving this PR.frameworks/adk.mdxhas a new Native Gemini section: the three forms, the manual equivalent,base_url, whichlast_callfields stayNone, readinglast_callinafter_model_callback,classify(exc.response), and one Donkey per event loop.frameworks/index.mdx(Format mapping and injection table)feature-overview,telemetry,reference/last-call, andexamples/{adk,gemini}ARCHITECTURE.mdandCONTRIBUTING.mdpython/examples/adk, the fixture README and the docstringswebsite/public(regenerated)examples/general/gateway-identity.mdxwas left unchanged: it is captured demo output and is still accurate formodel().Test plan
pytest -q: 780 passed, 10 skippedmypy,ruff check .,lint-imports(5/5 contracts kept)verify_frameworks.py --only adk: both rows signature-confirmed offline;--only adk.gemini --live→ VERIFIED (LIVE)website:next buildpasses (61 pages)Post-deploy steps
test_adk_builds_a_native_gemini_modeland itscoverage.tomlentry once a release containinggemini()is published (follow-up: Donkey-Development-Kit/donkey-development-kit-acceptance#10).asyncio.runcalls fails. It is documented.ddk-gemini-inboundconsumer pair used for the live run.