import { AICapabilities, AIInterface, AIMessage, AIModel, AIResponse, ChatOptions, CompletionOptions, EmbeddingOptions, EmbeddingResponse, ImageDescriptionOptions, ImageEmbeddingOptions, ImageGenerationOptions, ImageGenerationResponse, MessageOptions, OpenAICompatVideoOptions, TTSOptions, TTSResponse, VideoGenerationJob, VideoGenerationOptions, VideoGenerationResult, VideoGenerationStatusResult, Voice, VoiceCloneOptions, VoiceDesignOptions, VoiceListOptions } from '../types'; /** * OpenAI-compatible video-generation provider for `/v1/videos`-shaped * gateways (LiteLLM, Sora-shaped providers). * * @example * ```typescript * import { getAI } from '@happyvertical/ai'; * * const video = await getAI({ * type: 'openai-compat-video', * baseUrl: 'https://llm.happyvertical.com/v1', * apiKey: process.env.OPENAI_COMPAT_VIDEO_API_KEY!, * }); * * const job = await video.submitVideoGenerationJob({ * prompt: 'A time-lapse of clouds over a mountain range', * durationSeconds: 8, * }); * ``` */ export declare class OpenAICompatVideoProvider implements AIInterface { private options; constructor(options: OpenAICompatVideoOptions); private get baseUrl(); private request; private rawRequest; /** * Submit an asynchronous video-generation job. * * `resolution` is forwarded as the gateway's `size` field only when it is * already in `WIDTHxHEIGHT` form (e.g. `'1280x720'`); other resolution * labels (`'720p'`) are not translated and the gateway's default size * applies instead — keeping this adapter thin rather than guessing a * pixel size per vendor. `negativePrompt`, `seed`, and `fps` are not part * of the documented OpenAI videos schema and are not forwarded. */ submitVideoGenerationJob(options: VideoGenerationOptions): Promise; /** * Poll the status of a video-generation job. * * The gateway's status response does not include the video bytes, so * `result` on a succeeded job carries only metadata (mimeType, duration, * dimensions) plus a `url` when the gateway happens to include one * directly. Call {@link fetchVideoGenerationResult} to download the bytes. */ getVideoGenerationJob(handle: VideoGenerationJob): Promise; /** * Fetch the result of a completed video-generation job, downloading the * rendered bytes from the gateway's content endpoint. * * @throws {AIError} When the job has not succeeded yet */ fetchVideoGenerationResult(handle: VideoGenerationJob): Promise; /** * Cancel a video-generation job. Cancellation of an in-flight Sora-shaped * job is not part of the documented OpenAI `videos` API and is * gateway-dependent (e.g. LiteLLM's Veo passthrough may support it); this * attempts the conventional `/videos/{id}/cancel` REST call and surfaces * an {@link AIError} if the gateway rejects or does not implement it. */ cancelVideoGenerationJob(handle: VideoGenerationJob): Promise; /** * Cheap auth-shaped check for video-generation access. * * This probes `GET /videos/{sentinel-id}` rather than listing videos: * LiteLLM (the primary target gateway) requires a `custom_llm_provider` * parameter on its `GET /v1/videos` list route that this generic adapter * has no context to supply, so a list-based check would fail with valid * credentials on the flagship gateway. A single-resource GET works * uniformly instead, classified as: * - `401`/`403` → invalid credentials, throws {@link AuthenticationError} * - `404` → authenticated successfully, the sentinel id just doesn't * exist — this is a **valid** result, not a failure * - `2xx` → valid (the sentinel id coincidentally exists) * * Callers on a hot path must cache the result themselves. */ validateVideoGenerationAccess(): Promise; private mapVideo; getModels(): Promise; getCapabilities(): Promise; chat(_messages: AIMessage[], _options?: ChatOptions): Promise; complete(_prompt: string, _options?: CompletionOptions): Promise; message(_text: string, _options?: MessageOptions): Promise; embed(_text: string | string[], _options?: EmbeddingOptions): Promise; embedImage(_image: string | Buffer, _options?: ImageEmbeddingOptions): Promise; describeImage(_image: string | Buffer, _prompt?: string, _options?: ImageDescriptionOptions): Promise; generateImage(_prompt: string, _options?: ImageGenerationOptions): Promise; stream(_messages: AIMessage[], _options?: ChatOptions): AsyncIterable; countTokens(_text: string): Promise; synthesizeSpeech(_text: string, _options?: TTSOptions): Promise; streamSpeech(_text: string, _options?: TTSOptions): AsyncIterable; cloneVoice(_options: VoiceCloneOptions): Promise; designVoice(_options: VoiceDesignOptions): Promise; getVoices(_options?: VoiceListOptions): Promise; } //# sourceMappingURL=openai-compat-video.d.ts.map