feat(ai-gemini): add Google Veo video adapter on the typed-duration contract#741
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🚀 Changeset Version Preview4 package(s) bumped directly, 27 bumped as dependents. 🟥 Major bumps
🟨 Minor bumps
🟩 Patch bumps
|
|
View your CI Pipeline Execution ↗ for commit 27eaac5
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-skills
@tanstack/ai-devtools-core
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-openrouter
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-schemas
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
…n contract (#634) Restacked on 618-image-to-image-and-image-to-video-support to adopt the multimodal MediaPrompt format, carrying a minimal additive port of the #534 typed-duration contract: - @tanstack/ai (non-breaking): VideoAdapter/BaseVideoAdapter gain a TModelDurationByName generic (default Record<string, number> preserves existing duration?: number typing), DurationOptions, snapToDurationOption, and default availableDurations()/snapDuration() implementations. generateVideo's duration is typed via VideoDurationForAdapter. - @tanstack/ai-gemini: GeminiVideoAdapter over generateVideos / getVideosOperation with per-model typed durations (Veo 3.x 4|6|8, Veo 2 5|6|8 per current Veo docs), MediaPrompt image routing (start_frame → image, end_frame → lastFrame, reference/character → referenceImages), RAI filter surfacing, geminiVideo/createGeminiVideo factories, and finalized Veo model-meta entries. - E2E: gemini added to video-gen with a custom aimock mount for :predictLongRunning + operations polling; all transports pass. - Docs + media-generation skill updated for Veo (typed durations, image-to-video role table). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
27eaac5 to
1b52533
Compare
1b52533
into
618-image-to-image-and-image-to-video-support
🎯 Changes
Closes #634. Stacked on #624 (
618-image-to-image-and-image-to-video-support) — this PR targets that branch, adopts its multimodalMediaPromptformat, and should land after it.@tanstack/ai— additive typed-duration contract (minor, non-breaking)VideoAdapter/BaseVideoAdaptergain aTModelDurationByNamegeneric. The default (Record<string, number>) preserves today'sduration?: numbertyping for adapters without a map (Sora, fal unchanged).availableDurations()→DurationOptionstagged union (discrete | range | mixed | none); default{ kind: 'none' }.snapDuration(seconds)→ closest valid duration; defaultundefined.snapToDurationOptionexported from@tanstack/ai/adaptersfor adapter authors.generateVideo({ duration })typed per model viaVideoDurationForAdapter<TAdapter>.@tanstack/ai-gemini— Veo adapter (minor)GeminiVideoAdapterover@google/genaimodels.generateVideos(:predictLongRunning) /operations.getVideosOperation;getVideoStatusmapsdone/errorand surfaces all-samples-RAI-filtered asfailedwith reasons;getVideoUrlreturnsresponse.generatedVideos[0].video.uri.'start_frame'image → inputimage,'end_frame'→lastFrame,'reference'/'character'→referenceImages(ASSET). Image parts convert from data sources, base64data:URIs,gs://URIs, or fetched HTTP URLs. Multiple starting images / video / audio parts throw;'mask'/'control'roles throw.geminiVideo('veo-3.0-generate-001')→duration?: 4 | 6 | 8; Veo 2 →5 | 6 | 8;snapDuration(7)→6.sizeis the aspect ratio ('16:9' | '9:16');resolution/generateAudio/negativePromptetc. viamodelOptions(vendorGenerateVideosConfigminus adapter-managed fields).GEMINI_VIDEO_MODELSunion); the staleGeminiGenerationConfigOptionsreference replaced with the intersection the Imagen entries use.clientseam) includingexpectTypeOfcompile-time duration assertions and MediaPrompt routing coverage.E2E, docs, skill
'gemini'added tovideo-gen;global-setup.tsmounts Veo's:predictLongRunning+ operations-poll endpoints (aimock 1.29 doesn't model the long-running pair), responding with the raw MLDev wire shape the SDK normalizes. All three transports pass; openaivideo-gen+image-to-videosuites still green. Gemini stays out of theimage-to-videoe2e set — that spec's journal assertion is tied to aimock's/v1/videospipeline, which custom mounts bypass; Veo's image routing is unit-tested (noted infeature-support.ts).docs/media/video-generation.md: Veo section (typed durations table,snapDurationexample, download-auth note); role-hint and provider-support tables updated from "Veo planned" to actual mappings.media-generationSKILL.md updated alongside.Duration values vs the issue
The issue's table said Veo 3.x =
4 | 8, Veo 2 =5–8, and asked to confirm before locking. Current official Veo docs say Veo 3.x:4 | 6 | 8, Veo 2:5 | 6 | 8— those shipped, sosnapDuration(7)returns6(not8as the issue's acceptance line assumed). Live API confirmation was attempted via free invalid-duration probes but the key's prepaid credits are depleted (429 before validation); docs are the source of truth. (Also notedurationSecondsis a number in the Gemini API, unlike Sora's string seconds, and the issue'spackages/typescript/…paths predate the repo restructure.)✅ Checklist
pnpm run test:pr.🚀 Release Impact
🤖 Generated with Claude Code