Defined in: realtime-types.ts
Options for the RealtimeClient and useRealtimeChat hook.
getToken: () => Promise<RealtimeToken>;
Function to fetch a realtime token from the server. Called on connect and when the token needs refresh.
adapter: RealtimeAdapter;
The realtime adapter to use (e.g., openaiRealtime(), elevenlabsRealtime()).
optional tools: ReadonlyArray<AnyClientTool>;
Client-side tools with execution logic.
optional autoPlayback: boolean;
Auto-play assistant audio responses. Default: true.
optional autoCapture: boolean;
Request microphone access on connect. Default: true.
optional instructions: string;
System instructions for the assistant.
optional voice: string;
Voice to use for audio output (provider-specific, e.g., 'alloy' for OpenAI).
optional vadMode: 'server' | 'semantic' | 'manual';
Voice activity detection mode. Default: 'server'.
optional outputModalities: Array<'audio' | 'text'>;
Output modalities for responses.
optional temperature: number;
Temperature for generation (provider-specific range).
optional maxOutputTokens: number | 'inf';
Maximum number of tokens in a response.
optional semanticEagerness: 'low' | 'medium' | 'high';
Eagerness level for semantic VAD.
optional onStatusChange: (status: RealtimeStatus) => void;
Called when connection status changes.
optional onModeChange: (mode: RealtimeMode) => void;
Called when session mode changes.
optional onMessage: (message: RealtimeMessage) => void;
Called when a new message is added to the conversation.
optional onError: (error: Error) => void;
Called when an error occurs.
optional onConnect: () => void;
Called when connection is established.
optional onDisconnect: () => void;
Called when disconnected.
optional onInterrupted: () => void;
Called when the assistant's response is interrupted.