VapiAI/example-client-javascript-react

How to wait for user input before speech starts

Closed this issue · 1 comments

Hi, I am currently building a voice assistant with vapi, I am making a ringtone feature to reach out to the user and want them to respond before I start the voice assistant

I know that I can simply start the vapi api, after the user responds but that introduces like a 3s freeze in between (from calling vapi.start), which is awkward for the user

Is there a way to start the call first, then i can add a callback in between to reach out to the user then start the conversation right away? Similar to how vapi works on the phone

I found a workaround. For anyone insterested, set the agent's first message to none, reach out to the user, when the user responds, use the vapi.send function to let the agent know that the user has replied