End Realtime conversation

I’m building Realtime API AI assistant for short dialogs and I tired to add tool to end conversation, but it always stops mid speech. Also I’ve tried to mute microphone and close the connection after 30 seconds, but I don’t think that it is the proper solution. How can I fix that? I’m using react with relay

1 Like

Monitor the audio. If the volume threshold is below a certain value for 3 seconds after the tool has been called, the AI is probably done talking - we can now end the conversation without the audio cutting off.

Cheers. :hugs:

1 Like

Thanks, I’ll try this out

After tool is called add listener for event “input_audio_buffer.speech_stopped”
On this event termiinate