import type OpenAI from "openai"; import type { SpeechCreateParams } from "openai/resources/audio/speech"; import { type GenerateSpeech, type GenerateSpeechOptions } from "@use-crux/core"; /** * OpenAI speech has no extra body controls beyond Crux's portable fields. * Streaming formats stay excluded because this operation returns completed audio. */ export interface OpenAISpeechExtra { readonly stream_format?: never; } /** Voice names and custom voice references accepted by OpenAI speech models. */ export type OpenAISpeechVoice = SpeechCreateParams["voice"]; /** * Flat OpenAI speech operation attached to a bound adapter. * * It performs one native Speech API call, never persists the returned bytes, * and propagates provider failures unchanged. * * @example * ```ts * const result = await openai.generateSpeech({ * model: 'gpt-4o-mini-tts', text: 'Hello', voice: 'alloy', outputFormat: 'mp3' * }) * ``` */ export type OpenAIGenerateSpeech = GenerateSpeech; export type OpenAISpeechInput = GenerateSpeechOptions; /** Bind one stateless native OpenAI speech operation. */ export declare function createOpenAIGenerateSpeech(client: OpenAI): OpenAIGenerateSpeech; /** Define OpenAI speech mechanics for provider-runtime compilation. */ export declare function createOpenAISpeechOperation(client: OpenAI): import("@use-crux/core/adapter").CompletedOperationDefinition | undefined; guardrails?: readonly import("@use-crux/core").Guardrail[]; safety?: import("@use-crux/core/safety").SafetyTuneOptions; extra?: OpenAISpeechExtra | undefined; }>, { model: string; text: string; voice?: string | OpenAI.Audio.Speech.SpeechCreateParams.ID | undefined; outputFormat?: string; instructions?: string; speed?: number; language?: string; abortSignal?: AbortSignal; timeout?: Readonly<{ totalMs?: number; stepMs?: number; }> | undefined; guardrails?: readonly import("@use-crux/core").Guardrail[]; safety?: import("@use-crux/core/safety").SafetyTuneOptions; extra?: OpenAISpeechExtra | undefined; }, { raw: Response; bytes: Uint8Array; }, import("@use-crux/core/adapter").GenerateSpeechPayload, { kind: string; size: number | undefined; }>; /** Return the first unsupported OpenAI speech control, if one exists. */ export declare function openAISpeechIssue(options: OpenAISpeechInput): { capability: string; path: string; remediation: string; } | undefined; /** Build the exact native request for completed or body-streaming speech. */ export declare function openAISpeechRequest(options: OpenAISpeechInput, streamFormat?: "audio"): SpeechCreateParams; /** Resolve the canonical media type for one OpenAI speech output format. */ export declare function openAISpeechMediaType(format: string | undefined): string;