/** Voice ids supported by the OpenAI Realtime model. */ export declare const SUPPORTED_VOICES: readonly ["alloy", "ash", "ballad", "breeze", "cedar", "cinnamon", "coral", "echo", "ember", "juniper", "marin", "sage", "shimmer", "verse"]; /** Server-side voice-activity turn-detection settings. Pass `null` to disable. */ export type TurnDetectionConfig = { /** Detection mode. Default `'server_vad'`. */ type?: string; /** Speech-probability threshold in [0, 1]. Default `0.5`. */ threshold?: number; /** Audio padding (ms) prepended before detected speech. Default `300`. */ prefixPaddingMs?: number; /** Trailing silence (ms) that ends a turn. Default `200`. */ silenceDurationMs?: number; /** Auto-create a model response when a turn ends. Default `true`. */ createResponse?: boolean; /** Allow user speech to interrupt the model's response. Default `true`. */ interruptResponse?: boolean; }; /** Input-audio transcription settings. Pass `null` to disable transcription. */ export type InputAudioTranscriptionConfig = { /** Transcription model id. Default `'gpt-4o-mini-transcribe'`. */ model?: string; }; /** Configuration for {@link OpenAIRealtime}. */ export type OpenAIRealtimeConfig = { /** Realtime model id. Default `'gpt-4o-realtime-preview'`. */ model?: string; /** Voice id (see {@link SUPPORTED_VOICES}). Default `'alloy'`. */ voice?: string; /** Response modalities. Default `['text', 'audio']`. */ modalities?: string[]; /** Sampling temperature. Default `0.8`. */ temperature?: number; /** * Max output tokens per response. Default the string `'inf'` (unlimited); * `null` omits the param. */ maxResponseOutputTokens?: number | string | null; /** Turn-detection settings, or `null` to disable. Defaults applied when omitted. */ turnDetection?: TurnDetectionConfig | null; /** Input-audio transcription settings, or `null` to disable. Default model applied when omitted. */ inputAudioTranscription?: InputAudioTranscriptionConfig | null; /** Tool-selection strategy. Default `'auto'`. */ toolChoice?: string; }; interface ResolvedConfig { model: string; voice: string; modalities: string[]; temperature: number; maxResponseOutputTokens: number | string | null; turnDetection: Required | null; inputAudioTranscription: Required | null; toolChoice: string; } declare class OpenAIRealtimeImpl { static readonly displayName = "OpenAIRealtime"; _providerName: string; _isRealtimeModel: boolean; apiKey?: string; config: ResolvedConfig; model: string; voice: string; params: Record; constructor(opts?: { apiKey?: string; config?: OpenAIRealtimeConfig | null; [key: string]: any; }); close(): Promise; cleanup(): Promise; getRuntimeConfig(): Record; } export type OpenAIRealtime = OpenAIRealtimeImpl; /** * OpenAI Realtime speech-to-speech (S2S) model. * * @param opts.apiKey OpenAI API key; defaults to the `OPENAI_API_KEY` env var. * @param opts.config Realtime configuration; see {@link OpenAIRealtimeConfig}. */ export declare const OpenAIRealtime: (opts?: { apiKey?: string; config?: OpenAIRealtimeConfig | null; [key: string]: any; }) => OpenAIRealtime; export {};