@assistant-ui/react
Version:
Open-source TypeScript/React library for building production-grade AI chat experiences
26 lines • 1.26 kB
TypeScript
import { type RealtimeVoiceAdapter } from "@assistant-ui/core";
/** Options for a browser WebSocket connection to the Gemini Live API. */
export type GeminiLiveVoiceAdapterOptions = {
/** Return a short-lived ephemeral token minted by your authenticated server. Keep the API key and session configuration on the server. */
getToken: (options: {
signal: AbortSignal;
}) => Promise<string>;
/** Live model to connect to, such as `gemini-3.8-live`; it must match the model your token was minted for. */
model: string;
};
/**
* Connects browser microphone audio directly to the Gemini Live API over a
* WebSocket. Configure the model, voice, and transcription on the server
* through the ephemeral token's connection constraints. Each connection starts
* a new conversation; existing thread history and assistant-ui tools are not
* sent to the voice model, and sessions end when Google's session limit is
* reached.
*/
export declare class GeminiLiveVoiceAdapter implements RealtimeVoiceAdapter {
private readonly options;
constructor(options: GeminiLiveVoiceAdapterOptions);
connect(options: {
abortSignal?: AbortSignal;
}): RealtimeVoiceAdapter.Session;
}
//# sourceMappingURL=GeminiLiveVoiceAdapter.d.ts.map