Skip to content

chore(ts-react-chat): sync structured-output Gemini dropdown to current model list #621

Description

@tombeckenham

The Gemini provider dropdown in `examples/ts-react-chat/src/routes/generations.structured-output.tsx` (added in #605) has two known mismatches against Google's current published model list (https://ai.google.dev/gemini-api/docs/models).

This is a narrowly scoped subset of #620 — useful for a maintainer who wants to fix the demo without taking on the full model-meta refresh.

Current dropdown state

```ts
gemini: [
{ value: 'gemini-3.5-flash', label: 'Gemini 3.5 Flash' }, // ✓ stable, in spec
{ value: 'gemini-3-pro-preview', label: 'Gemini 3 Pro (Preview)' }, // ✗ not in Google's docs anymore
{ value: 'gemini-3-flash-preview', label: 'Gemini 3 Flash (Preview)' }, // ✓
{ value: 'gemini-3.1-pro-preview', label: 'Gemini 3.1 Pro (Preview)' }, // ✓
{ value: 'gemini-3.1-flash-lite-preview', label: '...' }, // ✓
// missing: 'gemini-3.1-flash-lite' (stable GA)
]
```

Fix 1: remove `gemini-3-pro-preview`

Google's docs no longer list this id — appears retired in favor of `gemini-3.1-pro-preview` and `gemini-3.5-flash`. Safe to remove from the dropdown alone: `GEMINI_3_PRO` is still in `ai-gemini/model-meta` (kept by #620 to keep type-map and consumers compiling), so removing it from just the dropdown doesn't cascade.

If a maintainer also wants to remove the constant from model-meta, that's #620 territory.

Fix 2: add `gemini-3.1-flash-lite` (stable)

Google's docs list both `gemini-3.1-flash-lite` (stable) and `gemini-3.1-flash-lite-preview` (preview) as separate routes. The repo only has the preview entry.

This one requires touching `ai-gemini/model-meta` first — `geminiText('gemini-3.1-flash-lite')` would TypeScript-fail today because the parameter is typed as `(typeof GEMINI_MODELS)[number]` and the stable id isn't in that union. Minimum work:

  1. Add `GEMINI_3_1_FLASH_LITE_STABLE` (or similar name) const in `ai-gemini/model-meta.ts` with `name: 'gemini-3.1-flash-lite'`.
  2. Add `.name` to `GEMINI_MODELS` array.
  3. Add to `GeminiChatModelProviderOptionsByName`, `GeminiChatModelToolCapabilitiesByName`, `GeminiModelInputModalitiesByName` type maps.
  4. Add to `GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS` set (it's a Gemini 3.x model, so qualifies for the Route structured-output through native combined-mode where supported (skip finalization round-trip) #605 native combined path).
  5. Add to the dropdown.

Acceptance

  • Dropdown lists every Gemini text/chat id from Google's current docs that the adapter supports.
  • No dropdown entries that 404 against Google's API.
  • `pnpm --filter @tanstack/ai-gemini test:types` clean.
  • The structured-output demo (`/generations/structured-output`) round-trips for every dropdown option.

Context

Filed during #605 review. The dropdown drift was noticed but explicitly scoped out of #605 to keep the routing PR focused. #620 covers this plus the broader model-meta freshness work; this issue is the demo-only slice for anyone wanting a quick win.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions