busy-breakfast-32623
10/06/2025, 9:24 AMtall-airline-16756
10/06/2025, 9:24 AMtall-airline-16756
10/06/2025, 9:25 AMturn_detection parameter within the AgentSession. LiveKit offers several turn detection modes to choose from:
• LiveKit Turn Detector Model (Recommended): This is a great option! It uses the MultilingualModel from the livekit.plugins.turn_detector.multilingual package, which combines contextual understanding with VAD to boost accuracy. Here’s a quick example to get you started:
from livekit.agents import AgentSession
from livekit.plugins import deepgram, silero
from livekit.plugins.turn_detector.multilingual import MultilingualModel
session = AgentSession(
turn_detection=MultilingualModel(),
stt=deepgram.STT(),
vad=silero.VAD.load(),
llm=openai.LLM(),
tts=deepgram.TTS(),
)
• Other Modes: Depending on what fits your needs best, you can also set turn_detection to "vad", "stt", "realtime_llm", or "manual".
• Fine-Tuning: You might find it helpful to adjust min_endpointing_delay and max_endpointing_delay to get the responsiveness just right.
If you have any questions or would like more details, please don’t hesitate to reach out—I’m here to help!
Sources: livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector... | How does end-of-utterance detection work in conversations? | Gemini Live API plugin | LiveKit Docs | Azure OpenAI Realtime API and LiveKit | LiveKit Docs | complex-agents/turn-taking/README.mdbusy-breakfast-32623
10/06/2025, 9:26 AMtall-airline-16756
10/06/2025, 9:27 AMautomatic_activity_detection.disabled = True in realtime_input_config.
2. Then, provide a separate streaming STT model, since LiveKit's turn detector works based on STT output.
Here’s a sample configuration to guide you:
from livekit.agents import AgentSession
from livekit.plugins import google, deepgram
session = AgentSession(
turn_detection=MultilingualModel(),
vad=silero.VAD.load(),
stt=deepgram.STT(),
llm=google.beta.realtime.RealtimeModel(
realtime_input_config=types.RealtimeInputConfig(
automatic_activity_detection=types.AutomaticActivityDetection(
disabled=True,
),
),
input_audio_transcription=None, # Let STT plugin handle transcription
),
)
If you have any questions or need a hand with this setup, please don’t hesitate to reach out. I’m here to help!
Sources: Turn detection and interruptions | LiveKit Docs | Gemini Live API plugin | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | LiveKit turn detector plugin | LiveKit Docs