strong-lamp-18251
02/28/2025, 5:06 PMgray-monkey-83525
02/28/2025, 5:06 PMagent_stopped_speaking
event. This event can be used to delay the execution of a tool call until the agent has finished its current speech. You can register a callback for this event and place your tool call logic within that callback.
Here's a basic example:
@assistant.on("agent_stopped_speaking")
def on_agent_stopped_speaking():
# Place your tool call logic here
print("Agent has stopped speaking, now triggering tool call.")
# trigger_tool_call()
This approach ensures that the tool call is only executed after the agent has completed its speech, preventing any interruptions or race conditions.
Would you like more details on implementing this in a specific context or with additional features?
Sources:
- https://livekit-users.slack.com/archives/C07FY8WHGPM/p1729780486.717989
- https://livekit-users.slack.com/archives/C07FY8WHGPM/p1728987953.956549 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.