late-businessperson-58140
12/17/2025, 9:29 AMtall-airline-16756
12/17/2025, 9:29 AMtall-airline-16756
12/17/2025, 9:30 AMfrom livekit.plugins import google
llm = google.realtime.RealtimeModel(model="gemini-2.5-flash-native-audio-preview-09-2025")
• Ensure you're calling the realtime/bidirectional interface (bidiGenerateContent) — only select live/streaming models support that.
• Verify authentication:
◦ Set GOOGLE_API_KEY for Gemini Live API.
◦ If using Vertex AI, set GOOGLE_APPLICATION_CREDENTIALS to your service account key.
If this doesn’t resolve it, please share:
1. The exact model string you’re using.
2. The code snippet that initializes the RealtimeModel and starts the bidi stream.
3. Whether you’re using the Gemini API directly or Vertex AI.
I’ll review those and suggest the precise fix.
Sources: Gemini Live API plugin | LiveKit docslate-businessperson-58140
12/17/2025, 9:31 AMtall-airline-16756
12/17/2025, 9:31 AMgemini-2.0-flash-exp
• gemini-2.5-flash-native-audio-preview-09-2025
If you need examples for initializing either model with google.realtime.RealtimeModel, or want to confirm which one supports a specific feature (speech-to-speech, native audio input, etc.), tell me which feature you need and I’ll provide the exact snippet.
Sources: Gemini Live API plugin | LiveKit docslate-businessperson-58140
12/17/2025, 9:34 AMtall-airline-16756
12/17/2025, 9:34 AMgemini-2.0-flash-exp or gemini-2.5-flash-native-audio-preview-09-2025 — by configuring the model to use the TEXT modality.
If you want, tell me which SDK/language you’re using and I’ll provide the exact initialization snippet to return text only.
Sources: Gemini Live API plugin | LiveKit docslate-businessperson-58140
12/17/2025, 9:37 AMtall-airline-16756
12/17/2025, 9:37 AM1007 close with reason "Cannot extract voices from a non-audio request." — that means the RealtimeModel expected audio in the request (for voice extraction / native-audio flows) but received a non-audio payload.
What you can do next:
• If you want text-only responses: configure the model to use the TEXT modality so audio processing/voice extraction isn't required.
◦ Set modalities=[Modality.TEXT] (or the equivalent in your SDK) when creating the RealtimeModel.
• If you intend to send audio (speech-to-speech or native-audio flows): make sure you send a proper audio track / audio frames on the bidi stream or attach a microphone track so the RealtimeModel receives audio input.
• If using a native-audio model (e.g., gemini-2.5-flash-native-audio-preview-09-2025), do not send a non-audio request that includes voice configuration expecting extraction.
If you’d like, tell me:
1. Which model you’re using.
2. The modalities/options you set when initializing the RealtimeModel.
3. A short code snippet showing how you open the bidi stream / send the request.
I’ll provide the exact snippet to fix either the text-only or audio flow.late-businessperson-58140
12/17/2025, 9:39 AMtall-airline-16756
12/17/2025, 9:39 AMgemini-2.5-flash-native-audio-preview-09-2025. That model expects native audio unless configured otherwise — your error shows the model received a non-audio request while voice extraction was expected.
To resolve this, choose one of two options and tell me which you want to implement:
1) Text-only responses (no audio required)
• Initialize the RealtimeModel with TEXT modality so the model won't expect audio:
from livekit.plugins import google
from livekit.plugins.google import Modality
llm = google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-09-2025",
modalities=[Modality.TEXT]
)
This accepts text input (or transcribed audio) and returns text responses.
2) Audio (speech-to-speech / native audio) — send real audio
• Ensure you send an audio track/frames on the bidi stream (microphone or PCM frames) rather than a non-audio payload.
• Do not set modalities to TEXT-only; include audio modality or native audio settings so voice extraction runs.
Tell me which option you want (text-only or audio). If audio, paste:
• The code snippet that opens the bidi stream and sends the initial request, and
• How you attach/send audio (mic track, raw frames, or other).
I’ll provide the exact snippet to fix your flow.late-businessperson-58140
12/17/2025, 9:40 AMtall-airline-16756
12/17/2025, 9:40 AMgemini-2.5-flash-native-audio-preview-09-2025 with modalities=[Modality.TEXT] but still get the 1007 "Cannot extract voices from a non-audio request" error. Let's pinpoint the issue.
Please check and apply these items:
1. Import and use the correct Modality enum:
from google.genai.types import Modality
1. Ensure you disable audio in room options so the agent won’t initialize audio input:
from livekit.plugins.room_io import RoomInputOptions
room_options = RoomInputOptions(audio_enabled=False)
1. Remove any voice/tts/affective settings (e.g., voice, enable_affective_dialog) when using modalities=[Modality.TEXT].
2. Minimal initialization example to test:
from livekit.agents import AgentSession
from livekit.plugins import google
from google.genai.types import Modality
from livekit.plugins.room_io import RoomInputOptions
session = AgentSession(
llm=google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-09-2025",
api_key=settings.GOOGLE_API_KEY,
modalities=[Modality.TEXT],
temperature=0.8,
),
room_options=RoomInputOptions(audio_enabled=False),
)
If you’ve already done all the above and still see the error, please paste:
• The exact imports and the small code block that creates the RealtimeModel and starts the session (minimal reproducible snippet).
• Any room/agent options you set (especially anything related to audio or TTS).
I’ll review that snippet and point out the specific line causing the audio expectation.
Sources: Gemini Live API plugin | LiveKit docs | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Text and transcriptions | LiveKit docs | OpenAI Realtime API plugin guide | LiveKit docslate-businessperson-58140
12/17/2025, 9:42 AM