Class VideoGenerationModel
- Namespace
- GenerativeAI
- Assembly
- GenerativeAI.dll
A client for interacting with the Gemini API for video generation tasks. Note: Video generation capabilities might be specific to certain API versions or platforms (e.g., Vertex AI).
public class VideoGenerationModel : BaseClient
- Inheritance
-
VideoGenerationModel
- Inherited Members
- Extension Methods
Constructors
VideoGenerationModel(IPlatformAdapter, string, HttpClient?, ILogger?)
Initializes a new instance of the VideoGenerationModel class.
public VideoGenerationModel(IPlatformAdapter platform, string model = "veo-2.0-generate-001", HttpClient? httpClient = null, ILogger? logger = null)
Parameters
platformIPlatformAdapterThe platform adapter for integrating with the API.
modelstringThe name of the video generation model.
httpClientHttpClientOptional HTTP client instance for making API calls.
loggerILoggerOptional logger instance for logging operations.
Properties
ModelName
Gets or sets the name of the video generation model.
public string ModelName { get; set; }
Property Value
Methods
AwaitForLongRunningOperation(string, int?, CancellationToken)
Awaits the completion of a long-running operation specified by its operation ID. This method repeatedly checks the operation's progress until it's complete or until the specified timeout is reached.
public Task<GenerateVideosOperation?> AwaitForLongRunningOperation(string operationId, int? timeOut = null, CancellationToken cancellationToken = default)
Parameters
operationIdstringThe unique identifier of the long-running operation to monitor.
timeOutint?Optional timeout (in milliseconds) for awaiting the operation. If not provided, the default timeout specified by LongRunningOperationTimeout is used.
cancellationTokenCancellationTokenAn optional token to observe and respond to cancellation requests.
Returns
- Task<GenerateVideosOperation>
Returns a GoogleLongRunningOperation instance representing the final state of the long-running operation upon completion. Throws an exception if the operation encounters an error.
GenerateVideosAsync(GenerateVideosRequest, CancellationToken)
Generates videos based on a text prompt and optional image input and configuration. This typically initiates a long-running operation.
public Task<GenerateVideosOperation?> GenerateVideosAsync(GenerateVideosRequest request, CancellationToken cancellationToken = default)
Parameters
requestGenerateVideosRequestThe request containing the prompt, optional image, and configuration for video generation.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- Task<GenerateVideosOperation>
A GenerateVideosOperation representing the long-running video generation task.
GenerateVideosAsync(string, ImageSample?, GenerateVideosConfig?, CancellationToken)
Generates videos based on a specified text prompt, an optional reference image, and configuration settings. This operation typically initiates a long-running task.
public Task<GenerateVideosOperation?> GenerateVideosAsync(string prompt, ImageSample? referenceImage = null, GenerateVideosConfig? config = null, CancellationToken cancellationToken = default)
Parameters
promptstringThe text prompt to guide the video generation process.
referenceImageImageSampleAn optional reference image to influence the video's style or content.
configGenerateVideosConfigOptional configuration settings for customizing the video generation.
cancellationTokenCancellationTokenA token to observe while waiting for the operation to complete, allowing it to be cancelled.
Returns
- Task<GenerateVideosOperation>
A GenerateVideosOperation representing the long-running operation for video generation.
GetVideoGenerationStatusAsync(string, int?, CancellationToken)
Awaits the completion of a long-running operation specified by its operation ID. This method repeatedly checks the operation's progress until it's complete or until the specified timeout is reached.
public Task<GenerateVideosOperation?> GetVideoGenerationStatusAsync(string operationId, int? timeOut = null, CancellationToken cancellationToken = default)
Parameters
operationIdstringThe unique identifier of the long-running operation to monitor.
timeOutint?Optional timeout (in milliseconds) for awaiting the operation. If not provided, the default timeout specified by LongRunningOperationTimeout is used.
cancellationTokenCancellationTokenAn optional token to observe and respond to cancellation requests.
Returns
- Task<GenerateVideosOperation>
Returns a GoogleLongRunningOperation instance representing the final state of the long-running operation upon completion. Throws an exception if the operation encounters an error.