Hey guys, wanted to brainstorm on one of the probl...
# agents
m
Hey guys, wanted to brainstorm on one of the problems im trying to crack. I want the the agent to not speak out urls out loud. But in the front end side it should appear. So its like a tts layer thingy where the llm layer can generate urls but it shouldnt be spoken out loud. If anyone worked on this, would love to hear out the approach.
• One thing that worked but inconsistent is using TTS providers with prompt instructions available. Like
gpt-4o-mini-tts
. Tried adding tts prompt like,
Copy code
'DONOT pronounce urls, but use words like 'given here', 'is here' etc filler words instead.
This is inconsistent but we also use ElevenLabs where they don't support tts prompt.
• Another thing is using the tts_node to use regex to get the url. But as everything is streaming. The logic is flicky. Or I would be storing all the stream chunks in a buffer, do the regex and then return it back to tts. This will lose the parallelism
s
have you tried to prompt the LLM to output a shorter "symbol" that represents the URL, e.g.
<URL>
and then you can quickly replace that in the tts node? that way you're not waiting for the LLM to output a full URL
m
Hmm so adding urllink/url tags during generation right. And the preprocess it in then tts node and also somewhere in the frontend to not show the tags but pure urls
s
actually, I was thinking if it works for your use case, you could also just not include the URL at all in the LLM's output. so it literally just emits a special character like <URL> or something that you parse. that would be like one token so you wouldn't hold up the rest of the TTS too much
j
look at using the tts node and a parser to remove the content. You can still pull transcript from the raw llm output. https://docs.livekit.io/agents/build/nodes/#tts_node