chilly-motorcycle-32290
08/07/2025, 10:39 AMtall-airline-16756
08/07/2025, 10:39 AMtall-airline-16756
08/07/2025, 10:40 AM.say method was successfully executed on the agent's side, you can use the SpeechHandle object. Here's how:
1. Capture the SpeechHandle object when calling session.say().
2. Use SpeechHandle.wait_for_playout() to wait until the speech completes or is interrupted.
3. Check the interrupted property to see if the speech was interrupted or completed successfully.
Example:
handle = session.say("Your message here")
await handle.wait_for_playout()
if not handle.interrupted:
print("The message was successfully delivered without interruption.")
else:
print("The message was interrupted.")
This method allows you to track the success of the .say method accurately.