Hello @all I’ve created a custom plugin for my LLM...
# agents
a
Hello @all I’ve created a custom plugin for my LLM, and now I want to use
session.say()
while the LLM is still generating a response. The issue is that my custom LLM calls an external API that sometimes takes a while, so I want to play TTS messages during that waiting period. However, when I try this, I end up in a deadlock: the TTS waits for the LLM to finish, and the LLM waits for the TTS to finish. Is there a way to play TTS messages while the LLM is still running?
l
As an idea, can you try
session.say("blah", allow_interruptions=False)
?
a
its not working
s
I think the key is to not await the session.say. There's some example about what you want to do. Have you checked https://github.com/livekit/agents/blob/main/examples/voice_agents/fast-preresponse.py ? @ancient-pizza-45206
if you get it working, could you share what's your final solution? it's in my todo list but still haven't had time to work on this
FWIW, if the message in say is always the same, you could play the audio so avoiding the call to TTS service
✅ 1
🙌 1
a
the playing background sound is the nice idea
s
I meant an audio with the agent talking, not background music. But that's UX choice 😉
a
yep i understood backgrund sound like: wait while i check. 😀
👍 1