Custom Messages
# support
n
hi, I am trying to implement vapi on web in way that it says the sentences I provide it via an api call, the problem I am facing is that, while the api call is going on, vapi on itself speaks a few words and then continue with the word came from api call. How can I get rid of the this, can I pause the vapi for that moment in some way? or may be I can prevent vapi from saying "modal-output"? Do let me know if its possible to do something like this.
v
@NTMR Hello! It sounds like you're experiencing an issue where VAPI starts speaking before the API call is complete, resulting in an interruption of the speech output. To address this, you can consider implementing a mechanism to control when VAPI starts speaking. Here are a couple of approaches you could take: 1. **Pause VAPI's speech**: If VAPI has a method to pause or stop speaking, you can call this method before making the API call and then resume or start a new speech output once the API call is complete with the desired sentence. 2. **Queue Management**: Implement a queue system where you enqueue sentences to be spoken. VAPI only speaks when a sentence is dequeued, which happens only after your API call is complete and the sentence is ready. 3. **Event Handling**: Use event handlers to better manage when VAPI starts speaking. For example, you can have an event that triggers VAPI to speak only after the API call has successfully returned the sentence. If VAPI has a specific function to pause or prevent speech, you can call that function. Otherwise, you may need to implement custom logic to manage the timing of speech output. If you need more specific guidance or if there's a particular function you'd like to call, please provide more details or the function name, and I'll be happy to assist you further!
You can continue this conversation by mentioning me in the message.
s
looks like Vapi speaks the tool request messages can you please share the call id along with explanation expected vs actual output.
n
I am using the web sdk, I am fetch my own data from backend that I want the vapi to say, but once the conversation starts and the api call happen to my backend in the meanwhile vapi speaks some of the words related to the conversation till my data fetching is completed, after that it start speaking the data of the api call. Actual output is a mix of vapi's output and my api call, expected output is that the vapi speaks the api call data and then continue with the conversation, then at some point an api call will happen again and it should say those words without mixing with its own.
s
call id please.
4 Views