import type { Api, Model } from "@oh-my-pi/pi-catalog/types"; import * as AIError from "../error"; import { downloadOpenRouterVideo, pollOpenRouterVideo, submitOpenRouterVideo, type VideoOptions, } from "./openrouter-video"; import type { VideoContent, VideoGenerationRequest, VideoJob } from "./types"; export * from "./openrouter-video"; export * from "./types"; /** Submit an asynchronous video generation job through the model's transport. */ export function submitVideo( model: Model, request: VideoGenerationRequest, options: VideoOptions, ): Promise { if (model.api === "openrouter-video") return submitOpenRouterVideo(model, request, options); throw new AIError.ConfigurationError(`Unsupported video API: ${model.api}`); } /** Poll an asynchronous video generation job through the model's transport. */ export function pollVideo(model: Model, jobId: string, options: VideoOptions): Promise { if (model.api === "openrouter-video") return pollOpenRouterVideo(model, jobId, options); throw new AIError.ConfigurationError(`Unsupported video API: ${model.api}`); } /** Stream generated video content through the model's transport. */ export function downloadVideo(model: Model, jobId: string, options: VideoOptions): Promise { if (model.api === "openrouter-video") return downloadOpenRouterVideo(model, jobId, options); throw new AIError.ConfigurationError(`Unsupported video API: ${model.api}`); }