session = AgentSession( # Large Language M...
# ask-ai
e
session = AgentSession( # Large Language Model llm=google.LLM(model="gemini-2.0-flash-exp", _api_key_=GEMINI_API_KEY), # Speech-to-text stt=deepgram.STT(model="nova-3", language="multi"), # Text-to-speech - use configured voice settings tts=cartesia.TTS(model="sonic-3", voice=voice_id, speed="slowest"), # Use Silero VAD for turn detection (already preloaded) vad=ctx.proc.userdata["vad"], # Allow LLM to generate response while waiting for end of turn _preemptive_generation_=True, # ✅ FALSE INTERRUPTION HANDLING: Configure per LiveKit docs # https://docs.livekit.io/agents/build/turns/#false-interruptions _resume_false_interruption_=True, # Automatically resume speech after false interruption _false_interruption_timeout_=1.0, # Wait 2 seconds before detecting false interruption # Interruption settings _allow_interruptions_=True, # Allow user to interrupt agent _min_interruption_duration_=0.8, # Minimum speech duration before triggering interruption _min_interruption_words_=0, # Minimum words (0 = use VAD only) )
t
Thanks for reaching out, Guess. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you configure false interruption handling in LiveKit! You can easily set this up using a couple of parameters in the
AgentSession
constructor: • resume_false_interruption: Simply set this to
True
if you want the agent to continue speaking after a false interruption (this is the default behavior). • false_interruption_timeout: This lets you specify how long (in seconds) the agent should wait after a false interruption before resuming speech. For instance, setting it to
1.0
means the agent will pause for 1 second before continuing. Here’s a quick example to illustrate:
Copy code
session = AgentSession(
    vad=silero.VAD.load(),
    llm=openai.LLM(model="gpt-4o-mini"),
    stt=deepgram.STT(),
    tts=cartesia.TTS(),
    false_interruption_timeout=1.0,         # Wait 1 second before resuming
    resume_false_interruption=True,         # Resume after timeout
)
With this setup, the agent will pause its audio output when interrupted. If it doesn’t detect any user speech within the timeout, it will smoothly pick up right where it left off. If you have any questions or need a hand with anything else, just let me know—I’m here to help! Sources: Turn detection and interruptions | LiveKit Docs | livekit-agents/livekit/agents/voice/agent.py | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee...
e
gemini models supported
name the models
t
I'm glad you asked! LiveKit offers a wonderful variety of Gemini models designed to fit different needs: • Inference Models:
gemini-2.5-pro
,
gemini-2.5-flash
,
gemini-2.5-flash-lite
,
gemini-2.0-flash
,
gemini-2.0-flash-lite
. • Real-Time Voice Models:
gemini-2.0-flash-live-001
,
gemini-live-2.5-flash-preview
,
gemini-2.5-flash-native-audio-preview-09-2025
. • Text-to-Speech (TTS):
gemini-2.5-flash-preview-tts
featuring voices like Kore, Puck, Charon, and more. • Experimental Models:
gemini-1.5-pro
,
gemini-1.5-flash
,
gemini-2.5-pro-preview-05-06
, among others. If you'd like, I’d be more than happy to dive into the details of any specific model or help you figure out which one suits your needs best. Just let me know! Sources: plugins/google/src/models.ts | Gemini Live API plugin | LiveKit docs | Google Gemini LLM | LiveKit Docs | Google Gemini LLM | LiveKit docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
e
how do you write the model name llm= "gemini-2.5-flash" or llm="models/gemini-2.5-flash"
t
I'd be happy to help you with the correct syntax for specifying Gemini model names, which varies depending on the service you're using: • For LiveKit Inference: You'll want to use the full model ID format, like
llm="google/gemini-2.5-flash"
. • For Google Plugin: The short model name works best, for example,
llm="gemini-2.0-flash-001"
. Also, please make sure your authentication method is set up correctly for the backend you've chosen. If you'd like, I’m here to walk you through it or provide some examples—just let me know! Sources: plugins/google/README.md | Google Gemini LLM | LiveKit docs | Google Gemini LLM plugin guide | LiveKit docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/llm.py | AI Agents Framework | livekit/livekit_composite | DeepWiki
e
livekit katest version
t
LiveKit is made up of several components, each with its own version. Here are the latest versions to help you stay up to date: • LiveKit Server: 1.9.3 • JavaScript/TypeScript SDKs:
@livekit/components-react
v2.9.15,
livekit-client
v2.15.8 • Mobile SDKs: Flutter SDK v2.5.3 • Python SDKs: LiveKit RTC v1.0.14, LiveKit API v1.0.5 • Other SDKs: Ruby SDK v0.8.3, Rust SDK v0.7.24 • LiveKit CLI: 2.12.2 If you'd like more details about any specific component or need a hand with upgrading, just let me know—I'm here to help! Sources: Rust SDK & FFI Bridge | livekit/livekit_composite | DeepWiki | version/version.go | Voice Assistant Examples | livekit/livekit_composite | DeepWiki | .version | livekit-protocol/livekit/protocol/version.py
e
tts metrics how to get internal speech id and how much time taken
t
I'm happy to help you find the internal speech ID and the time taken for TTS metrics in LiveKit! You can easily access this information using the
TTSMetrics
object, which is provided right after speech synthesis. Here’s a quick overview: • Speech ID: This is a unique identifier that connects the generated speech to a user’s turn, and you’ll find it in the
speech_id
field. • Timing Metrics: These include
ttfb
(time to first byte),
duration
(total time taken), and
audio_duration
(the length of the generated audio). Here’s a simple example in Python to guide you:
Copy code
from livekit.agents.metrics import TTSMetrics

async def on_metrics_collected(metrics: TTSMetrics):
    print(f"Speech ID: {metrics.speech_id}")
    print(f"Time to first byte: {metrics.ttfb:.4f}s")
    print(f"Total duration: {metrics.duration:.4f}s")
    print(f"Audio duration: {metrics.audio_duration:.4f}s")
Just make sure to register the
metrics_collected
event on your TTS instance to capture these details smoothly. If you have any questions or need more help, please don’t hesitate to ask—I’m here for you! Sources: Logs, metrics, and telemetry | LiveKit docs | Logs, metrics, and telemetry | LiveKit Docs | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee... | agents/src/tts/tts.ts | docs/index.yaml
e
want the livekit-agents 1.2.8 iw ant recentr eleases when did 1.2.3
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
e
@session.on("metrics_collected") def _on_metrics_collected(_ev_: MetricsCollectedEvent): metrics.log_metrics(ev.metrics) usage_collector.collect(ev.metrics) logger.info(f"Metrics collected: {ev.metrics}") how to log stt , tts metrics , llm