@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
53 lines (52 loc) • 1.55 kB
TypeScript
/**
* Google Gemini Live Voice API Handler
*
* Implementation of bidirectional voice communication using Gemini's Live API.
*
* @module voice/providers/GeminiLive
*/
import { BaseRealtimeHandler } from "../RealtimeVoiceAPI.js";
import type { TTSAudioFormat, RealtimeAudioChunk, RealtimeConfig, RealtimeSession } from "../../types/index.js";
/**
* Google Gemini Live Voice API Handler
*
* Implements bidirectional voice communication with Gemini's Live API.
*
* @see https://ai.google.dev/gemini-api/docs/live
*/
export declare class GeminiLive extends BaseRealtimeHandler {
readonly name = "gemini-live";
private readonly apiKey;
private ws;
private audioChunkIndex;
private pendingFunctionCalls;
constructor(apiKey?: string);
isConfigured(): boolean;
getSupportedFormats(): TTSAudioFormat[];
connect(config: RealtimeConfig): Promise<RealtimeSession>;
disconnect(): Promise<void>;
sendAudio(audio: Buffer | RealtimeAudioChunk): Promise<void>;
sendText(text: string): Promise<void>;
triggerResponse(): Promise<void>;
cancelResponse(): Promise<void>;
/**
* Send setup message with configuration
*/
private sendSetup;
/**
* Wait for setup complete message
*/
private waitForSetupComplete;
/**
* Handle incoming WebSocket messages
*/
private handleMessage;
/**
* Parse audio format from MIME type
*/
private parseAudioFormat;
/**
* Handle function call from model
*/
private handleFunctionCall;
}