When using `generate_reply` within a `function_t...
# ask-ai
f
When using
generate_reply
within a
function_tool
, it interrupts the ongoing
function_tool
. Is this supported in realtime models?
t
Thanks for reaching out, Marcelo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Just so you know, when you use
generate_reply
inside a
function_tool
with realtime models, it won’t interrupt what the function tool is currently doing. Instead, it queues up a new speech generation task, letting the current function finish smoothly without any hiccups. Sometimes, if a reply needs to be generated and it’s not handled automatically, the system might gently pause the current generation to start a new reply task. This helps keep the conversation flowing naturally, and it’s totally normal—not something unexpected from calling
generate_reply
inside the tool. If you’ve got a particular situation or behavior you want to dive into, just give me a shout—I’m here to help! Sources: livekit-agents/livekit/agents/voice/agent_activity.py | agents/src/voice/agent_activity.ts
p
And how do I interrupt the function_tool - so that the agent don't say one sentence right after the other
t
Thanks for reaching out! Just to make sure I understand correctly, are you hoping to completely stop the
function_tool
from running, or are you looking to add a little pause between sentences to slow down the agent's response? Also, it would be great to know if you're using any particular settings or configurations in your project. I'm here to help you through this!
p
I'd like the function tool to execute; but as soon as a generate_reply is executed, the function_tool should wait for it to execute, and only then continue...
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!