HeyGenVideoModel
Namespace: Vercel.AI.HeyGen
public sealed class HeyGenVideoModel : IVideoModel, IVideoCallerHeyGen video model. CancellationToken) submits a job and CancellationToken) reads it.
The operation is a JSON object with videoId, mode and resolution.
The result is the signed video URL. The bytes are not downloaded.
Inheritance: object
Implements: IVideoModel, IVideoCaller
Constructors
Section titled “Constructors”HeyGenVideoModel(HeyGenProvider, string, Func<DateTimeOffset>?)
Section titled “HeyGenVideoModel(HeyGenProvider, string, Func<DateTimeOffset>?)”public HeyGenVideoModel(HeyGenProvider provider, string modelId, Func<DateTimeOffset>? clock = null)Creates a model. <code class=“paramref”>clock</code> sets the response timestamp.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
HeyGenProvider | |
modelId |
string | |
clock |
Func<DateTimeOffset> |
Properties
Section titled “Properties”CanGenerate
Section titled “CanGenerate”public bool CanGenerate { get; }True when doGenerate exists.
Value: bool
CanStart
Section titled “CanStart”public bool CanStart { get; }True when doStart exists.
Value: bool
CanStatus
Section titled “CanStatus”public bool CanStatus { get; }True when doStatus exists.
Value: bool
CanWebhook
Section titled “CanWebhook”public bool CanWebhook { get; }False. HeyGen is polled.
Value: bool
MaxVideosPerCall
Section titled “MaxVideosPerCall”public int? MaxVideosPerCall { get; }HeyGen creates one video per call.
Value: int?
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version. Always v4.
Value: string
Methods
Section titled “Methods”DoGenerateAsync(VideoModelCall, CancellationToken)
Section titled “DoGenerateAsync(VideoModelCall, CancellationToken)”public Task<VideoModelResult> DoGenerateAsync(VideoModelCall call, CancellationToken cancellationToken)Generates videos in one call.
Parameters
| Name | Type | Description |
|---|---|---|
call |
VideoModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<VideoModelResult>
DoGenerateAsync(VideoCallOptions, CancellationToken)
Section titled “DoGenerateAsync(VideoCallOptions, CancellationToken)”public Task<VideoResult> DoGenerateAsync(VideoCallOptions options, CancellationToken cancellationToken)Starts a job and polls it until the video is ready.
Parameters
| Name | Type | Description |
|---|---|---|
options |
VideoCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<VideoResult>
DoStartAsync(VideoModelCall, CancellationToken)
Section titled “DoStartAsync(VideoModelCall, CancellationToken)”public Task<VideoStartResult> DoStartAsync(VideoModelCall call, CancellationToken cancellationToken)Starts an asynchronous generation.
Parameters
| Name | Type | Description |
|---|---|---|
call |
VideoModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<VideoStartResult>
DoStatusAsync(VideoModelCall, CancellationToken)
Section titled “DoStatusAsync(VideoModelCall, CancellationToken)”public Task<VideoStatusResult> DoStatusAsync(VideoModelCall call, CancellationToken cancellationToken)Reads operation status.
Parameters
| Name | Type | Description |
|---|---|---|
call |
VideoModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<VideoStatusResult>
HandleWebhookAsync(Func<Task<VideoWebhook>>, CancellationToken)
Section titled “HandleWebhookAsync(Func<Task<VideoWebhook>>, CancellationToken)”public Task<VideoWebhook> HandleWebhookAsync(Func<Task<VideoWebhook>> webhook, CancellationToken cancellationToken)Turns a webhook factory into a URL and a received task.
Parameters
| Name | Type | Description |
|---|---|---|
webhook |
Func<Task<VideoWebhook>> | |
cancellationToken |
CancellationToken |
Returns: Task<VideoWebhook>
ResolveMaxVideosPerCallAsync(CancellationToken)
Section titled “ResolveMaxVideosPerCallAsync(CancellationToken)”public Task<int?> ResolveMaxVideosPerCallAsync(CancellationToken cancellationToken)Resolves a functional limit. The default is MaxVideosPerCall.
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken |
CancellationToken |
Returns: Task<int?>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product