Skip to content
Source
Sign inSign up
TanStack/schemas

Publish a per-model video schema for each Gemini Omni model (#658) #665

Mergedtombeckenhammerged 1 commit intomain fromrefs/pull/665/headmerged by tombeckenham View on GitHub

tombeckenhamcommented

Closes #658.

Review src/server/providers/gemini-video.ts first. It builds the schemas. The rest wires them in.

GET /v1/openapi/gemini?activity=video now has one request schema for each Gemini Omni model. Each has that model's own response_format.duration list.

The issue asked for durationSeconds on predictLongRunning. Google's docs no longer match that, so the issue was rewritten before this was coded (scope agreed: Omni only):

  • Veo is shut down on the Gemini API (2026-10-22). It gets nothing here.
  • Omni runs on the Interactions API, POST /v1beta/interactions. The duration is response_format.duration, a string such as "15s". There is no negativePrompt.

What changed

  • Sync. fetchSpec reads Google's Interactions OpenAPI document (https://ai.google.dev/static/api/interactions.openapi.json) and stores one endpoint for each video model.
    • The body is Google's create request with model set to that model and VideoResponseFormat.duration as an enum.
    • The range comes from the model page's Output video limit: "3s" to "15s" for gemini-omni-1.2-flash, "3s" to "10s" for gemini-omni-1.1-flash.
    • aspect_ratio and resolution keep Google's enums.
    • The model pages to read are the index pages for the ids that Google's video guide names.
    • The endpoint id is the model id. The stored path is the real path. Derivation is generated.
  • Poll. A Gemini row is video when its docs page states an Output video limit, and its schemaEndpointId is its own id. The Models API lists Omni the same as a chat model (generateContent), so the page is the only signal.
  • OpenAPI document. Provider-grained endpoints that share a path become one operation. The body is an anyOf of components tagged x-modelschemas-model, as in the fal document. ?model= gives that one model's body. There is no # path key.

Behaviour changes to check

  • Omni rows move from chat to video. gemini-omni-1.1-flash and gemini-omni-1.2-flash leave ?activity=chat.
  • A chat-listed Gemini row whose docs page is unread keeps its stored activity and route. Before, it was written as chat. A row first seen while the docs are down has no activity until the page loads. An existing test (#567) expected chat and now expects this.
  • The Gemini spec sync reads four more documents and fails if any of them fails or loses its shape. It does not publish an unbounded duration, and it does not record a false endpoint.removed.

Not done

  • docs/api-changes.md has no entry. Two other video PRs are open and that file is edited at the top by each. Say so if you want the entry added here.
  • A video model that the video guide does not name gets a video row with no schema. Today the guide names gemini-omni-1.2-flash, and 1.1 is on the same page.
  • The general Interactions route for chat models is not ingested.
  • The cached docs pages (six-hour TTL) have no Output video field yet. The Omni rows stay chat until the cache expires.

After deploy

Run POST /v1/admin/sync/gemini so the two endpoints exist before the poll binds the rows to them.

Tested

  • pnpm run test: 253 files, 2492 tests pass. pnpm run lint and pnpm run typecheck pass.
  • New tests: the page parser, the schema builder (with the cases that throw), the poll for an Omni row, and the assembled document (?activity=video, ?model= for an Omni model, ?model= for a Veo model).
  • Ran the builder against Google's live documents on 2026-11-16: two endpoints, no warnings, no dangling $ref.
  • Not run: a sync into a local D1. pnpm run rederive -- gemini fails on main before it reaches Gemini (ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX in packages/rate-card/src/evaluate.ts).
    1. tombeckenham linked this to fix #658

    2. Warning

      Review limit reached

      You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

      Next included review available in 47 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used the included review currently available.

      Learn how review limits work.

      Review configuration:

      Run configuration

      • Source mode: Auto
      • Repository: Unavailable
      • Branch: Unavailable
      • File: No configuration file from this repository applied
      • Commit: Unavailable
      • Layers: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: b81427fb-f69f-46c3-bf0a-816f11e50882
      Commits

      Reviewing files that changed from the base of the PR and between 876992937d62891e9738527934373ad840c758cf and a6186abd3c50249f62a605f06e977d3a941c86d1.

      Files selected for processing: 9

      • CLAUDE.md
      • src/server/provider-openapi.ts
      • src/server/provider-openapi.worker.test.ts
      • src/server/providers/fixtures/gemini-omni-flash.md.txt
      • src/server/providers/gemini-features.ts
      • src/server/providers/gemini-list.test.ts
      • src/server/providers/gemini-video.test.ts
      • src/server/providers/gemini-video.ts
      • src/server/providers/gemini.ts
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      Share

    3. ⚠️ No Changeset found

      Latest commit: a6186abd3c50249f62a605f06e977d3a941c86d1

      Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      Click here to learn what changesets are, and how to add one.

      Click here if you're a maintainer who wants to add a changeset to this PR

    4. tombeckenham merged thisa92822e

    5. tombeckenham closed this

Sign in to join this conversation.