ai-tube / src /app /server /actions /submitVideoRequest.ts
jbilcke's picture
preparing transition to user-generated content + gaussians
ac7030c
raw
history blame
991 Bytes
"use server"
import { ChannelInfo, VideoGenerationModel, MediaInfo, VideoOrientation } from "@/types/general"
import { uploadVideoRequestToDataset } from "./ai-tube-hf/uploadVideoRequestToDataset"
export async function submitVideoRequest({
channel,
apiKey,
title,
description,
prompt,
model,
lora,
style,
voice,
music,
tags,
duration,
orientation,
}: {
channel: ChannelInfo
apiKey: string
title: string
description: string
prompt: string
model: VideoGenerationModel
lora: string
style: string
voice: string
music: string
tags: string[]
duration: number
orientation: VideoOrientation
}): Promise<MediaInfo> {
if (!apiKey) {
throw new Error(`the apiKey is required`)
}
const { videoRequest, videoInfo } = await uploadVideoRequestToDataset({
channel,
apiKey,
title,
description,
prompt,
model,
lora,
style,
voice,
music,
tags,
duration,
orientation
})
return videoInfo
}