chore: import upstream snapshot with attribution
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
# google-video (Google Video)
|
||||
|
||||
This example demonstrates Google Veo video generation models for AI-powered video creation from text prompts.
|
||||
|
||||
You can run this example with:
|
||||
|
||||
```bash
|
||||
npx promptfoo@latest init --example google-video
|
||||
cd google-video
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Choose one:
|
||||
|
||||
- Google AI Studio / Gemini API key
|
||||
- Google Cloud project with Vertex AI API enabled and authentication via `gcloud auth application-default login`
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Option 1: Google AI Studio / Gemini API
|
||||
export GOOGLE_API_KEY=your-api-key
|
||||
|
||||
# Option 2: Vertex AI
|
||||
gcloud services enable aiplatform.googleapis.com
|
||||
gcloud auth application-default login
|
||||
export GOOGLE_PROJECT_ID=your-project-id
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `GOOGLE_API_KEY` - Google AI Studio / Gemini API key
|
||||
- `GOOGLE_PROJECT_ID` - Google Cloud project ID for Vertex AI
|
||||
|
||||
## Available Models
|
||||
|
||||
| Model | Description | Duration |
|
||||
| -------------------------- | ----------------------------------- | -------- |
|
||||
| `veo-3.1-generate-preview` | Latest with video extension support | 4, 6, 8s |
|
||||
| `veo-3.1-fast-preview` | Fast Veo 3.1 | 4, 6, 8s |
|
||||
| `veo-3-generate` | Veo 3.0 standard | 4, 6, 8s |
|
||||
| `veo-3-fast` | Veo 3.0 fast | 4, 6, 8s |
|
||||
| `veo-2-generate` | Veo 2.0 | 5, 6, 8s |
|
||||
|
||||
## Running the Example
|
||||
|
||||
```bash
|
||||
npx promptfoo@latest eval
|
||||
```
|
||||
|
||||
## Configuration Options
|
||||
|
||||
| Option | Type | Description |
|
||||
| ------------------ | ------ | --------------------------------------------------------------- |
|
||||
| `aspectRatio` | string | `16:9` (default) or `9:16` |
|
||||
| `resolution` | string | `720p` (default) or `1080p` |
|
||||
| `durationSeconds` | number | Duration: 4, 6, 8 for Veo 3.x; 5, 6, 8 for Veo 2 |
|
||||
| `personGeneration` | string | `allow_adult` or `dont_allow` |
|
||||
| `negativePrompt` | string | Concepts to avoid |
|
||||
| `image` | string | Source image for image-to-video |
|
||||
| `lastImage` | string | End frame for interpolation |
|
||||
| `extendVideoId` | string | Operation ID from previous Vertex Veo generation (Veo 3.1 only) |
|
||||
| `referenceImages` | array | Up to 3 style reference images (file paths or objects) |
|
||||
|
||||
## Features
|
||||
|
||||
### Text-to-Video
|
||||
|
||||
Generate videos from text prompts (see `promptfooconfig.yaml`).
|
||||
|
||||
### Image-to-Video
|
||||
|
||||
Generate videos from a starting image (see `promptfooconfig-image.yaml`).
|
||||
|
||||
### Video Extension (Veo 3.1)
|
||||
|
||||
Extend previously generated Veo videos using the explicit Vertex provider path and an operation ID (see `promptfooconfig-extension.yaml`).
|
||||
|
||||
## Notes
|
||||
|
||||
- Generated videos are stored in promptfoo's blob storage system
|
||||
- Videos use content-addressable hashing for automatic deduplication
|
||||
- Use `--no-cache` flag to force regeneration
|
||||
- Videos are served via the local server for viewing in the UI
|
||||
- Veo models use long-running operations with polling for completion
|
||||
- `google:video:*` uses Google AI Studio by default and auto-detects Vertex AI when project-based auth is configured
|
||||
- Existing project-based `google:video:*` configs remain compatible, but `vertex:video:*` is the recommended explicit path for Vertex-only flows such as `extendVideoId`
|
||||
@@ -0,0 +1,29 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Google Veo video extension (Veo 3.1 only)
|
||||
|
||||
prompts:
|
||||
- 'Continue this video: {{continuation}}'
|
||||
|
||||
providers:
|
||||
- id: vertex:video:veo-3.1-generate-preview
|
||||
config:
|
||||
# Use the operation ID from a previous Veo video generation
|
||||
# This is returned in metadata.operationName of the generation response
|
||||
extendVideoId: projects/YOUR_PROJECT/locations/us-central1/publishers/google/models/veo-3.1-generate-preview/operations/YOUR_OPERATION_ID
|
||||
durationSeconds: 6 # Valid: 4, 6, 8 for Veo 3.x
|
||||
|
||||
tests:
|
||||
- vars:
|
||||
continuation: The camera pans to reveal a beautiful sunset on the horizon
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
- vars:
|
||||
continuation: The scene transitions smoothly to a night sky with stars appearing
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
|
||||
# Note: Video extension uses the explicit Vertex AI provider path.
|
||||
# To use this:
|
||||
# 1. First generate a video using promptfooconfig.yaml
|
||||
# 2. Get the operation ID from the results (metadata.operationName field)
|
||||
# 3. Replace YOUR_PROJECT and YOUR_OPERATION_ID above with your values
|
||||
@@ -0,0 +1,27 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Google Veo image-to-video generation
|
||||
|
||||
prompts:
|
||||
- 'Animate this image: {{animation}}'
|
||||
|
||||
providers:
|
||||
- id: google:video:veo-3.1-generate-preview
|
||||
config:
|
||||
# Provide your own image path here
|
||||
image: file://assets/start-frame.jpg
|
||||
aspectRatio: '16:9'
|
||||
durationSeconds: 5
|
||||
|
||||
tests:
|
||||
- vars:
|
||||
animation: The camera slowly zooms in while the scene comes to life
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
- vars:
|
||||
animation: Gentle motion with leaves rustling and clouds drifting
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
|
||||
# Note: You need to create an assets/ directory with your images
|
||||
# mkdir assets
|
||||
# cp /path/to/your/image.jpg assets/start-frame.jpg
|
||||
@@ -0,0 +1,26 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Google Veo video generation
|
||||
|
||||
prompts:
|
||||
- 'Generate a video: {{prompt}}'
|
||||
|
||||
providers:
|
||||
- id: google:video:veo-3.1-generate-preview
|
||||
config:
|
||||
aspectRatio: '16:9'
|
||||
resolution: '720p'
|
||||
durationSeconds: 6 # Valid: 4, 6, 8 for Veo 3.x
|
||||
|
||||
tests:
|
||||
- vars:
|
||||
prompt: A serene mountain landscape with clouds drifting slowly across the peaks at sunset
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
- vars:
|
||||
prompt: A cat playing with a ball of yarn on a cozy living room floor
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
- vars:
|
||||
prompt: Ocean waves gently rolling onto a sandy beach with palm trees swaying in the breeze
|
||||
assert:
|
||||
- type: is-valid-video
|
||||
Reference in New Issue
Block a user