import { RealtimeAgent, RealtimeSession, RealtimeAgentConfiguration } from '@openai/agents-realtime'; import { RealtimeProvider, RealtimeProviderConfig, RealtimeProviderCallbacks, RealtimeMessage, AudioFormat } from './RealtimeProvider'; interface WebSocketRealtimeProviderBaseOptions { voiceMap?: Record; } /** * Shared base for OpenAI-compatible WebSocket realtime providers. * * This covers the common pieces used by both `vowel-prime` and Grok: * - OpenAI Agents SDK tool definitions * - manual audio streaming over WebSocket transports * - queued text/image messages until the session is fully ready * - tool response resolution * - session.updateAgent() based instruction updates */ export declare abstract class WebSocketRealtimeProviderBase extends RealtimeProvider { protected agent: RealtimeAgent | null; protected session: RealtimeSession | null; protected isConnected: boolean; protected originalAgentConfig: RealtimeAgentConfiguration | null; protected pendingToolExecutions: Map void>; protected messageQueue: Array<{ type: 'text' | 'image'; data: string; }>; protected isFullyReady: boolean; protected sessionCreatedResolver: (() => void) | null; protected voiceMap: Record; private pendingToolContinuationTimer; private hasLoggedAudio; constructor(config: RealtimeProviderConfig, callbacks: RealtimeProviderCallbacks, options?: WebSocketRealtimeProviderBaseOptions); getAudioFormat(): AudioFormat; getInputAudioFormat(): AudioFormat; getOutputAudioFormat(): AudioFormat; handlesAudioInternally(): boolean; protected getLogLabel(): string; protected getDefaultTurnDetectionMode(): 'client_vad' | 'server_vad' | 'disabled'; protected getResolvedTurnDetectionMode(): 'client_vad' | 'server_vad' | 'disabled'; protected getConfiguredAudioFormat(direction: 'input' | 'output'): Partial; protected mapVoiceName(voice: string): string; protected createSDKTools(): any[]; disconnect(): Promise; sendAudio(audioData: string, _format?: AudioFormat): void; commitAudio(concatenatedAudioBuffer: ArrayBuffer): void; sendText(text: string): void; sendImage(imageUrl: string): void; interrupt(): void; sendToolResponse(toolCallId: string, toolName: string, result: any): void; private clearPendingToolContinuationTimer; protected normalizeMessage(_rawMessage: any): RealtimeMessage | null; sendSessionUpdate(updates: { instructions?: string; }): void; protected updateAgentAsync(newInstructions: string): Promise; /** * Set up common SDK event listeners for all WebSocket providers. * This consolidates event handling that was previously duplicated across * OpenAI, VowelPrime, and Grok providers. * * Providers should call this method during their connect() after session is created. */ protected setupSDKSessionEventListeners(): void; } export {}; //# sourceMappingURL=WebSocketRealtimeProviderBase.d.ts.map