Repository navigation
Canonical Gemini model listing with strict discovery and explicit filters - #63
Merged
Merged
Conversation
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.
Canonical model-list contract
Normal successor to the strict-discovery candidate at e4b6d83. The unshipped parallel
discover_models()method is removed; its strict all-page SDK transport now backsasync list_models(*, filters=None) -> list[ModelInfo].Noneuses frozen configuredmodel_filters. Every explicit mapping REPLACES defaults:{}is unfiltered,include=[]returns none, exclusions win, glob matching is case-insensitive and OS-independent. Existing selectable ID spelling/resource scopes are preserved (the pre-existing Developermodels/normalization remains).include=["*"],exclude=[],hide_dated=true,chat_only=true,latest_per_tier=true. Select newest numeric Gemini Pro/Flash/Flash-Lite in each resource scope, plus a strictly newer preview. Prefer matching aliases over snapshots. Unknown families/suffixes remain in the unfiltered view. No invented Pro or other model ID.thinking/streamGenerateContentmetadata becomes capabilities. Missing Core-required integer limits are 0 (documented unknown sentinel), not invented inference limits; listing defaults are empty.get_model_list_info()v1 metadata advertisessource,filters_keyword,filters_schema,default_filters,unfiltered, andoverride. No Core or Foundation dependency/change.Preserved safety and inference
Every page is validated before local filtering, including
include=[]. Genuine empty arrays and valid omitted ProtoJSON repeated collections remain successful; wrong-type/null/error/unrelated payloads and later-page failures remain errors, never partial success. Existing API-key/custom-endpoint/Vertex route ownership, cancellation, retry behavior and no-cache/no-static-fallback rules remain. Errors and retry events are sanitized. Image selection is separate.Exact explicitly selected hidden models still generate with the same model, effort, temperature, output limit and extra request parameters. Listing is neither an inference allow-list nor proof of account entitlement.
The locked SDK 2.30.1 exposes a native filter string, but equivalent common Developer/Vertex latest-tier/alias/glob semantics are not established. This change sends no speculative native filter: one complete list (plus required pagination) is filtered locally.
Current evidence
Head:
6669ea5a15affe6ab9ed9b4ef31b36a595b5c282Tree:
f7c8a855e67f696c78a1efb5e294106a5e6ef55dpython-projectqualification with lockedgoogle-genai==2.30.1,amplifier-core==1.6.1,httpx==0.28.1. Real SDK MockTransport checks, no live provider calls or credentials./workspaceentry insys.path; import origin asserted in a separate temporary virtual environment. Every packaged module's source bytes == wheel bytes == installed bytes. Ruff passed for selectors and changed listing tests.4ec85551f9fede673839d4a45f12649acacdff0281773379913b727e786bff1c. Built from tree08c6a2ccec7b3c70306df4ce9bcfe505860f5c3b; all runtime source bytes match final head. The successor changes only the behavioral test harness.06c30d8failed both minors solely because the inherited offline behavioral test still mocked the former SDK pager. Its stale mock allowed a discovery GET using its forced nonfunctional placeholder key to reach the live endpoint and fail; no inference ran. This unintended request is explicitly retained, not covered by the managed-run offline claim. The successor binds that test to the real SDK MockTransport and checks the request count. No test is skipped to hide the failure.Controlled fixture example, not an entitlement assertion: returned Pro2.5, Flash3.7/3.8, Flash-Lite3.5, Flash3.9-preview and an image preview yield Pro2.5, Flash3.8, Flash-Lite3.5 and Flash3.9-preview. No returned Pro means no Pro recommendation.
Retained earlier evidence
The original e4b6d83 candidate's 206 focused / 831 offline suite / 175 wheel-discovery results and its earlier ProtoJSON correction history remain attributable only to that original source. Current changed-risk evidence above supersedes its discovery-interface assertions; no old full-suite result is claimed for the new head.
Parent owns independent acceptance and merge. No merge, release, live adoption, force-push, recursive workers, Core changes, Foundation dependency or other repository edits.