Skip to main content

Gemini Live

GeminiLiveAdapter bridges a bidirectional audio stream to Google’s Gemini Live native-audio API. It speaks the same connect / sendAudio / onEvent / close surface as OpenAIRealtimeAdapter, so you can swap engines without touching the call handler. Use it as an alternative to OpenAI Realtime when you want native-audio Gemini voices, longer context, or lower per-minute pricing.

Install

Native-audio Gemini Live is a v1alpha-only API. Install the optional peer dependency:
Set GEMINI_API_KEY in your environment.

Constructor

Usage

Pass the adapter as the engine on phone.agent({...}):
Tools work the same way as on OpenAI Realtime — pass tools: [...] on phone.agent({...}) and Patter forwards function calls to Gemini’s functionDeclarations shape.

Models

The defaults change as Google promotes native audio to GA.

Voices

Puck, Charon, Kore, Fenrir, Aoede — Gemini’s built-in PrebuiltVoiceConfig set. Pass any one as voice.

When to use Gemini Live vs alternatives

Notes

  • Barge-in is implicit: Gemini Live runs server-side VAD and interrupts on user speech. cancelResponse() is a no-op for compatibility.
  • The adapter resamples nothing — pass PCM16 mono at inputSampleRate Hz. Patter’s telephony layer resamples 8 kHz mulaw up to 16 kHz before this point.
  • @google/genai is imported lazily, so default installs of getpatter do not pay the load cost.

What’s Next

Engines

All engines side by side.

OpenAI Realtime

The default engine.

Agents

System prompts, tools, first messages.

Tools

Function calling inside a realtime session.