i am using llm gemini 2.0 flash in my tts-llm-tts ...
# ask-ai
g
i am using llm gemini 2.0 flash in my tts-llm-tts voice agent. however sometime the llm tool call gets leaked in the tts plugin. how to avoid this ?
t
Thanks for reaching out, Vrishabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I’m here to help you keep your TTS plugin running smoothly without any unexpected LLM tool call leaks when using LLM Gemini 2.0 Flash in your TTS-LLM-TTS voice agent. Let’s walk through some friendly steps together: 1. Suppress Tool Call Chunks: Think of this as gently filtering the output from the LLM node—catch those tool call events (like
chunk.delta.toolCalls
) and only let the plain text content (
chunk.delta.content
) flow through to your TTS plugin. 2. Control Tool Behavior: You can easily manage when tool calls happen by using the
tool_choice
parameter. For instance, setting
tool_choice="none"
will gracefully prevent tool calls when they aren’t needed. 3. Override LLM Node Logic: Customize your
llmNode
so it quietly handles tool calls without passing them on to the TTS pipeline. This way, only natural language responses reach your TTS, keeping things clear and smooth. 4. Stream Separation: If you’re working with the Gemini Live API, connect just the
text_ch
(text channel) to your TTS pipeline, and manage tool calls separately through
function_ch
. This separation helps keep everything neat and tidy. By following these steps, you’ll ensure that tool call data stays behind the scenes and doesn’t get turned into audible speech, giving your users a seamless and pleasant experience. If you need any more guidance, I’m here to support you! Sources: Google Gemini integration guide | LiveKit Docs | agents/src/voice/generation.ts | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | agent.py