This realtime docs for gemini is a bit confusing....
# ask-ai
p
This realtime docs for gemini is a bit confusing. The model gemini-2.5-flash appears to not support bidigeneratcontent so the realtime model fails. but when i chage it to "gemini-2.5-flash-native-audio-preview-09-2025" - it works. Is that expected? What's the most up to date realtime model for gemini?
t
Thanks for reaching out, adit-kulkarni. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see you're asking whether it's expected that
gemini-2.5-flash
fails for bidirectional generative realtime and that
gemini-2.5-flash-native-audio-preview-09-2025
works. You're right to test both. This is expected.
gemini-2.5-flash
does not provide the native audio streaming / Gemini Live capabilities required for full bidirectional generative realtime interactions. For low-latency, bidirectional speech (proactivity, affective dialog, thinking mode, native audio streaming, etc.), use the native-audio preview model. The current recommended realtime model is: • gemini-2.5-flash-native-audio-preview-09-2025 If you want, tell me how you instantiate the RealtimeModel (snippet or config) and I’ll confirm the exact fields to set (voice, proactivity, enable_affective_dialog, thinking config) to match realtime behavior. Sources: Gemini Live API plugin | LiveKit docs | Gemini Realtime Agent with Live Vision | LiveKit docs
p
Goal: Implement push-to-talk with Gemini Realtime model (gemini-2.5-flash-native-audio-preview-09-2025) using LiveKit Agents framework with RoomIO. Our setup: - iOS app using LiveKit SDK (LiveKitComponents) streams audio via RoomIO - Python agent with AgentSession(turn_detection="manual") + google.realtime.RealtimeModel - automatic_activity_detection.disabled=True in realtime_input_config - Silero VAD added to session - RPC handlers for start_turn / end_turn Current code flow: # Session creation session = AgentSession( turn_detection="manual", vad=ctx.proc.userdata["vad"], llm=google.realtime.RealtimeModel( model="gemini-2.5-flash-native-audio-preview-09-2025", voice="Puck", realtime_input_config=types.RealtimeInputConfig( automatic_activity_detection=types.AutomaticActivityDetection(disabled=True), ), ), ) await session.start(agent=agent, room=ctx.room, room_options=...) session.input.set_audio_enabled(False) # start_turn RPC: session.interrupt() session.clear_user_turn() session.input.set_audio_enabled(True) # end_turn RPC: session.input.set_audio_enabled(False) session.commit_user_turn() What happens: - start_turn RPC succeeds, logs show input stream attached - User speaks (8+ seconds of audio) - end_turn RPC succeeds, logs show input stream detached then commit_user_turn called - No transcription events appear in logs - No response from Gemini What we've tried: 1. Different orderings of set_audio_enabled(False) and commit_user_turn() 2. Using generate_reply() instead of commit_user_turn() 3. Adding Silero VAD to trigger activity signals 4. Removing automatic_activity_detection.disabled (this caused Gemini to auto-respond before button release - not what we want) Key observation: The official push_to_talk.py example uses STT-LLM-TTS pipeline (Deepgram + OpenAI + Cartesia), NOT a RealtimeModel. It also creates RoomIO explicitly before session.start(). Question: Is push-to-talk with Gemini RealtimeModel + RoomIO actually supported? If so, what are we missing? If not, what's the recommended approach for push-to-talk with Gemini?
t
Thanks — I reviewed your setup and logs. You're asking whether push-to-talk with the Gemini Realtime model (gemini-2.5-flash-native-audio-preview-09-2025) + RoomIO is supported, and if so what you’re missing. Short answer: Push-to-talk with the RealtimeModel + manual turn detection is not supported. Your symptoms match the known limitation: disabling automatic activity detection and using
turn_detection="manual"
prevents the model from receiving a clear end-of-input signal, and
commit_user_turn()
does not trigger the Realtime model to transcribe/process the buffered audio the way it does for STT→LLM pipelines. Why this is happening (brief): • Realtime Gemini expects continuous bidirectional streaming and relies on activity/endpointing on the realtime stream to start processing. •
set_audio_enabled()
controls whether audio frames are fed but does not send an explicit “end of user audio” event the RealtimeModel consumes. •
commit_user_turn()
triggers pipeline-style LLM workflows but has no effect for Realtime models. Recommended approaches • Recommended (practical): Switch to an STT → LLM → TTS pipeline with
turn_detection="manual"
. That pipeline explicitly transcribes the push-to-talk audio, then calls the LLM and TTS when you call
commit_user_turn()
. This matches the working push_to_talk example and gives reliable push-to-talk behavior. ◦ Keep Silero VAD if you want optional activity hints, but use manual commit to control turn boundaries. • Advanced (if you must use Realtime Gemini): Capture audio on the client during the button press and stream the recorded PCM directly to Gemini Live API via a custom streaming path (bypassing AgentSession pipeline). This is more complex: you must handle the realtime connection, endpointing, and sync yourself. • Less reliable alternative: Publish audio only during the button press and try to rely on server-side VAD, but this frequently causes auto-responses or missed endpointing and is not recommended. If you want, I can: • Help convert your AgentSession to a pipeline example (STT + LLM + TTS) using your current RPC flow, and provide the minimal code changes. • Or walk through the client-side streaming approach and the exact signals Gemini Live needs if you prefer the advanced route. Which option would you like to pursue? Sources: Turns overview | LiveKit docs | Agent session | LiveKit docs | Google AI and LiveKit | LiveKit Docs | Realtime model plugins | LiveKit Docs