Publish a per-model video schema for each Gemini Omni model (#658) #665
main fromrefs/pull/665/head·merged by tombeckenham View on GitHubCloses #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 isresponse_format.duration, a string such as"15s". There is nonegativePrompt.
What changed#
- Sync.
fetchSpecreads 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
modelset to that model andVideoResponseFormat.durationas anenum. - The range comes from the model page's
Output videolimit:"3s"to"15s"forgemini-omni-1.2-flash,"3s"to"10s"forgemini-omni-1.1-flash. aspect_ratioandresolutionkeep 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.
- The body is Google's create request with
- Poll. A Gemini row is
videowhen its docs page states anOutput videolimit, and itsschemaEndpointIdis 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
anyOfof components taggedx-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
chattovideo.gemini-omni-1.1-flashandgemini-omni-1.2-flashleave?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) expectedchatand 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.mdhas 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
videorow with no schema. Today the guide namesgemini-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 videofield yet. The Omni rows staychatuntil 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 lintandpnpm run typecheckpass.- 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 -- geminifails onmainbefore it reaches Gemini (ERR_UNSUPPORTED_TYPESCRIPT_SYNTAXinpackages/rate-card/src/evaluate.ts).
- 1
tombeckenham linked this to fix #658
⚠️ 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
tombeckenham merged thisa92822e
tombeckenham closed this
Sign in to join this conversation.
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:
b81427fb-f69f-46c3-bf0a-816f11e50882Reviewing files that changed from the base of the PR and between 876992937d62891e9738527934373ad840c758cf and a6186abd3c50249f62a605f06e977d3a941c86d1.
CLAUDE.mdsrc/server/provider-openapi.tssrc/server/provider-openapi.worker.test.tssrc/server/providers/fixtures/gemini-omni-flash.md.txtsrc/server/providers/gemini-features.tssrc/server/providers/gemini-list.test.tssrc/server/providers/gemini-video.test.tssrc/server/providers/gemini-video.tssrc/server/providers/gemini.tsThanks 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