Can we use Gemini 2.0 Flash Live model and Multila...
# ask-ai
a
Can we use Gemini 2.0 Flash Live model and MultilanguageModel at the same time? Or do we need to change the LLM?
t
Thanks for reaching out, Boram. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey! Could you help me understand where exactly you’re planning to use the Gemini 2.0 Flash Live model along with the MultilanguageModel? Like, is it for a particular integration, API, or some other use case? Just want to make sure I get it right for you!
a
We're currently using Gemini 2.0 Flash Live to enable voice conversations but the turn detection the realtime LLM provides is not without issues so we are looking for ways to get control over the turn detection while still keeping the realtime model for natural conversation.
t
Hey there! You can totally use the Gemini 2.0 Flash Live model for voice conversations and customize how turns are detected by turning off the built-in turn detection and plugging in your own turn detection model. Here’s a little example to get you started:
Copy code
from livekit.plugins import google, deepgram
from livekit.plugins.turn_detector.multilingual import MultilingualModel

session = AgentSession(
    turn_detection=MultilingualModel(),
    vad=silero.VAD.load(),
    stt=deepgram.STT(),
    llm=google.beta.realtime.RealtimeModel(
        model="gemini-2.0-flash-exp",
        realtime_input_config=types.RealtimeInputConfig(
            automatic_activity_detection=types.AutomaticActivityDetection(
                disabled=True,
            ),
        ),
        input_audio_transcription=None,
    )
)
Here’s what this setup does for you: • Turns off Gemini’s built-in turn detection so you can take the reins. • Uses LiveKit’s turn detection model, like the MultilingualModel, to keep things smooth. • Needs a separate STT model because the turn detector works with text output. • Keeps all the cool realtime conversation features of Gemini Live, while letting you control how turns are detected. Sources: Gemini Live API integration guide | LiveKit Docs | Realtime model integrations | LiveKit Docs
a
@modern-rain-52453
t
Hey there! It looks like you mentioned someone in your response. If you have any more questions or need a hand with anything else, just give me a shout—I’m here to help!