Class VeoModel
java.lang.Object
com.google.genkit.plugins.googlegenai.VeoModel
- All Implemented Interfaces:
Model,Action<ModelRequest,,ModelResponse, ModelResponseChunk> Registerable
Video generation model using Google Veo.
This model generates videos using Google's Veo video generation models. Veo supports both text-to-video and image-to-video generation.
Supported models:
- veo-2.0-generate-001
- veo-3.0-generate-001
- veo-3.0-fast-generate-001
- veo-3.1-generate-preview
- veo-3.1-fast-generate-preview
Configuration options (via custom config):
- numberOfVideos - Number of videos to generate (1-4, default: 1)
- durationSeconds - Video duration (5-8 seconds, default: 5)
- aspectRatio - Aspect ratio (16:9 or 9:16, default: 16:9)
- personGeneration - Allow person generation (allowed/disallowed)
- negativePrompt - Negative prompt for generation
- enhancePrompt - Enable prompt enhancement (default: true)
- seed - Random seed for reproducibility
- outputGcsUri - GCS URI for output
- generateAudio - Generate audio with video (veo-3.0+ only)
- pollIntervalMs - Polling interval in ms (default: 5000)
- timeoutMs - Operation timeout in ms (default: 300000)
-
Constructor Summary
ConstructorsConstructorDescriptionVeoModel(String modelName, GoogleGenAIPluginOptions options) Creates a VeoModel for the specified model. -
Method Summary
Modifier and TypeMethodDescriptiongetInfo()Gets information about the model's capabilities.getName()Returns the name of the action.static booleanisVeoModel(String modelName) Checks if the given model name is a supported Veo model.run(ActionContext context, ModelRequest request) Generates a response from the given request.run(ActionContext context, ModelRequest request, Consumer<ModelResponseChunk> streamCallback) Generates a streaming response from the given request.booleanReturns whether this model supports streaming.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.genkit.ai.Model
getDesc, getInputSchema, getMetadata, getOutputSchema, getType, register, runJson, runJsonWithTelemetry
-
Constructor Details
-
VeoModel
Creates a VeoModel for the specified model.- Parameters:
modelName- the Veo model nameoptions- the plugin options
-
-
Method Details
-
getName
Description copied from interface:ActionReturns the name of the action.- Specified by:
getNamein interfaceAction<ModelRequest,ModelResponse, ModelResponseChunk> - Returns:
- the action name
-
getInfo
Description copied from interface:ModelGets information about the model's capabilities. -
supportsStreaming
public boolean supportsStreaming()Description copied from interface:ModelReturns whether this model supports streaming.- Specified by:
supportsStreamingin interfaceModel- Returns:
- true if streaming is supported
-
run
Description copied from interface:ModelGenerates a response from the given request.- Specified by:
runin interfaceAction<ModelRequest,ModelResponse, ModelResponseChunk> - Specified by:
runin interfaceModel- Parameters:
context- the action contextrequest- the model request- Returns:
- the model response
-
run
public ModelResponse run(ActionContext context, ModelRequest request, Consumer<ModelResponseChunk> streamCallback) Description copied from interface:ModelGenerates a streaming response from the given request.- Specified by:
runin interfaceAction<ModelRequest,ModelResponse, ModelResponseChunk> - Specified by:
runin interfaceModel- Parameters:
context- the action contextrequest- the model requeststreamCallback- callback for streaming chunks- Returns:
- the final model response
-
isVeoModel
Checks if the given model name is a supported Veo model.- Parameters:
modelName- the model name to check- Returns:
- true if the model is a Veo model
-