I am using gemini-2.5-flash-preview-native-audio-d...
# ask-ai
g
I am using gemini-2.5-flash-preview-native-audio-dialog and it works but sometimes the modell just stops talking and i see the following error: 2025-08-26 090558,713 - WARNING livekit.plugins.google - truncate is not supported by the Google Realtime API. {"pid": 13150, "job_id": "AJ_9pCejP8CFZ9E"}
t
Thanks for reaching out, Jens. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you share a bit more about your setup? For example: • Are you using any specific configurations or custom tweaks with the gemini-2.5-flash-preview-native-audio-dialog? • Does this issue happen every time under certain conditions, or is it more random? • Are you working with the Google Realtime API directly, or is it being used through another service? Getting these details will really help us figure out what’s going on.
g
It seem to be happening more or less every session. I am testing in dev using the cloud playground. No specific tweaks to the configuration
t
Hey there! That error message, "truncate is not supported by the Google Realtime API," pops up because the LiveKit integration with Google's Gemini Live API actually disables the truncate feature on purpose. It’s a known limitation, so when you call the truncate method, it simply doesn’t do anything—this is how it’s set up. The model
gemini-2.5-flash-preview-native-audio-dialog
does work with the LiveKit Google plugin, but just a heads-up, Gemini 2.5 Live has some quirks, especially around function calling, which might impact other features too. If truncation is something you really need, you might want to handle it yourself in your app, like managing the chat context manually. Or, if it fits your project, you could explore other APIs such as OpenAI's Realtime API, which does support truncation events. Feel free to reach out if you want help figuring out a workaround or need any other guidance—I’m here to help! Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | Gemini Live API integration guide | LiveKit Docs | ConversationItemTruncateEvent | LiveKit Agents
g
I do not need the truc function. I removed some unnessisary tool callings functionality, so I do not ge the truncate error. BUT I still have issues where it feels like the agent is "cut off" mid sentence
t
Hey there! It sounds like the agent getting cut off mid-sentence can be a bit frustrating, and there are a few reasons this might be happening: • Turn Detection and Interruptions: The model uses server-side Voice Activity Detection (VAD) to figure out when to switch turns, but sometimes it might misread the audio. Plus, the
allow_interruptions
setting is on by default, which means interruptions can cause those sudden cutoffs. • Truncation Handling: Because LiveKit can’t properly truncate messages (thanks to the Google Realtime API not supporting truncation), this might lead to audio that feels incomplete. • Preview Model Limitations: The
gemini-2.5-flash-preview-native-audio-dialog
model is still in preview, so there might be some quirks or limitations that aren’t fully documented yet, especially around audio synthesis and VAD. Here’s what you can try to troubleshoot: 1. Check if
allow_interruptions
is set to
True
. If it is, try switching it to
False
and see if that helps. 2. Turn off server-side turn detection by setting
automatic_activity_detection.disabled=True
in your
RealtimeModel
configuration. 3. Make sure your agent logic properly handles the
current_speech.interrupted
property to keep the conversation flowing smoothly. 4. Keep an eye on your server logs for any warnings about truncation—this can clue you in if interruption events are getting missed. If you want, I’m here to walk you through these steps or help out with anything else you need. Just let me know! Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Gemini Live API integration guide | LiveKit Docs
g
please help me with doing this step by step according to the trouble shoot suggestion
t
Alright, let’s walk through the troubleshooting steps together, one at a time: 1. Check and Update the
allow_interruptions
Parameter:
◦ First, find the configuration for your
AgentSession
. ◦ Look for the
allow_interruptions
parameter. If it’s set to
True
, try changing it to
False
. ◦ Then, restart the session and see if that helps with the issue. 1. Disable Server-Side Turn Detection: ◦ In your
RealtimeModel
configuration, set the
automatic_activity_detection.disabled
parameter to
True
. ◦ For example, update the
realtime_input_config
to include this setting. ◦ After that, restart the session and check if the agent’s speech gets better. 1. Verify Agent State Handling: ◦ Make sure your agent logic is properly handling the
current_speech.interrupted
property. ◦ Also, double-check that the conversation context stays intact even when interruptions happen. 1. Monitor Logs: ◦ Take a look at your server logs for any warnings like "truncate is not supported by the Google Realtime API." ◦ These messages can give clues if interruption truncation events are being ignored. If you want, I can provide more detailed instructions for any of these steps or help out if you run into any bumps along the way. Just let me know!