freezing-zoo-14850
08/29/2025, 7:54 PMLivekit-plugins-langchain and experiencing an issue where the Livekit agent's speech gets interrupted when a Langgraph tool is executed. So, for example:
Human:
what is the weather in sf?
AI:
Let me check the current weather in San Francisco for you.
check_weather call_123
{
"location": "San Francisco"
}
You will hear something like:
Let m.... [gap until the check_weather is executed] ...e check the current weather in San Francisco for you. [And immediately] The weather is 70 .....
I have checked the Langgraph streaming, and I am sure that 'Let me check the current weather in San Francisco for you' is streamed back to Livekit before the tool call, and LiveKit has it. I have tried different TTS model configurations (both ElevenLabs and Cartesia), including tokenizer, auto_mode, and text_pacing, but nothing seems to help.
The problem (to me) appears to be caused by a process getting blocked when the tool starts executing (you can feel it by the sudden and rough cutoff in the speech, Let m...).
Here is my code to replicate the issue. I will really appreciate your thoughts.
cc: @refined-appointment-81829