gemini-2.5-flash-native-audio-preview-09-2025 with...
# ask-ai
a
gemini-2.5-flash-native-audio-preview-09-2025 with eleven labs
t
Thanks for reaching out, Parth. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help with that. Quick clarification so I give the right guidance: • Do you want Gemini (gemini-2.5-flash-native-audio-preview-09-2025) to handle real‑time voice generation and use ElevenLabs only for STT/transcription, or do you want Gemini to produce text and route that text into ElevenLabs TTS for voice output? • Are you building this inside a LiveKit Agent or a custom pipeline? If LiveKit Agent, please share whether you’re using the Gemini plugin (
RealtimeModel
) or ElevenLabs plugins already. With those details I’ll provide the exact integration options and example config steps. Sources: Gemini Live API plugin | LiveKit docs | ElevenLabs TTS | LiveKit Docs | ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs STT plugin guide | LiveKit docs | ElevenLabs STT | LiveKit docs
a
ElevenLabs TTS for voice output
t
Great — you want Gemini to produce text and route that text into ElevenLabs TTS for voice output. Below are the concise, actionable steps and example configs for LiveKit Agents in both Python and Node.js. What to do 1. Configure Gemini to output text-only by setting
modalities=[Modality.TEXT]
(or the equivalent). 2. Configure ElevenLabs as the Agent session
tts
provider with your ElevenLabs
voice_id
and model. 3. Provide API keys for both providers (Google and ElevenLabs) via env vars or API key fields. 4. (Optional) Choose your STT provider (Google STT or ElevenLabs STT) if you need live transcription. Python example
Copy code
from livekit.agents import AgentSession
from livekit.plugins import google, elevenlabs
from google.genai.types import Modality

session = AgentSession(
    llm=google.realtime.RealtimeModel(
        model="gemini-2.5-flash-native-audio-preview-09-2025",
        api_key="YOUR_GOOGLE_API_KEY",
        modalities=[Modality.TEXT],  # text-only output from Gemini
    ),
    tts=elevenlabs.TTS(
        voice_id="YOUR_ELEVEN_VOICE_ID",
        model="eleven_multilingual_v2",
        api_key="YOUR_ELEVEN_API_KEY",
    ),
    stt=google.STT(),  # optional
)
Node.js example
Copy code
import * as google from '@livekit/agents-plugin-google';
import * as elevenlabs from '@livekit/agents-plugin-elevenlabs';
import { AgentSession } from '@livekit/agents';

const session = new AgentSession({
  llm: new google.realtime.RealtimeModel({
    model: "gemini-2.5-flash-native-audio-preview-09-2025",
    apiKey: process.env.GOOGLE_API_KEY,
    modalities: [google.types.Modality.TEXT],
  }),
  tts: new elevenlabs.TTS({
    voice: { id: "YOUR_ELEVEN_VOICE_ID" },
    model: "eleven_multilingual_v2",
    apiKey: process.env.ELEVEN_API_KEY,
  }),
  stt: new google.STT(), // optional
});
Key points •
modalities=[Modality.TEXT]
prevents Gemini from producing audio so ElevenLabs can synthesize speech. • Provide
GOOGLE_API_KEY
and
ELEVEN_API_KEY
(env vars or in constructors). • ElevenLabs TTS gives control over voice, model, and synthesis settings. • Plugin packages: Python (install LiveKit agents with google & elevenlabs extras), Node.js (
@livekit/agents-plugin-google
,
@livekit/agents-plugin-elevenlabs
). If you want, I can: • Show how to stream Gemini text responses directly to ElevenLabs for low-latency playback. • Provide a complete sample that includes STT -> Gemini -> ElevenLabs playback flow. Which one would you like next? Sources: Gemini Live API plugin | LiveKit docs | ElevenLabs TTS plugin guide | LiveKit Docs | Google Gemini LLM plugin guide | LiveKit Docs
a
check that model of gemini 2.5 flash native audio preview accept TEXT modality or not
t
Yes —
gemini-2.5-flash-native-audio-preview-09-2025
accepts the TEXT modality. You can set
modalities=[Modality.TEXT]
to force text-only output and route that text to ElevenLabs TTS.