feat(gemini): Phase 6 - list models + remote discovery#1688
Merged
Conversation
Add remote model discovery for the Gemini provider (issue #1598). - Add GeminiModelList/GeminiModelEntry serde structs with camelCase mapping - Implement list_models_remote() using x-goog-api-key header (not query param) - Filter to generative models only (supportedGenerationMethods contains generateContent) - Strip models/ prefix from name field to produce clean model IDs - Populate context_window from inputTokenLimit, display_name from displayName - Save results to ModelCache::for_slug("gemini") - Wire AnyProvider::Gemini arm in any.rs to delegate to list_models_remote() - Add 13 unit tests covering happy path, filtering, error responses, serde edge cases
c91c407 to
44f79c6
Compare
6 tasks
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 #1598. Part of #1592.
Summary
GET /v1beta/modelsendpoint inGeminiProvider::list_models_remote()RemoteModelInfowith context window and display name populatedAnyProvider::Geminiarm inany.rsto delegate tolist_models_remote()CHANGELOG.md[Unreleased]sectionImplementation Details
x-goog-api-keyheader (not query param — avoids log exposure)models/prefix stripped from model IDs (e.g.models/gemini-2.0-flash→gemini-2.0-flash)context_windowfrominputTokenLimit,display_namefromdisplayName,created_at: NoneModelCache::for_slug("gemini")Test Plan
modelsfield, unknown fields, missinginputTokenLimit)cargo +nightly fmt --checkpassescargo clippy --workspace --features full -- -D warningspassescargo nextest run --workspace --features full --lib --bins: 5288 passed