Function calling – sorry a few more seconds
# support
I keep having an issue where a function call leads the bot to enter a frozen state where it says "Sorry. A few more seconds". The function has
set to
and the server URL function returns a successful message of the form
{"result": "message"}
as directed by the documentation. I'm not sure if this is an issue on my side or on the VAPI side. Is there some way to figure out what is going on and debug this?
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Server Events]() * [Function Calling]() * [Outbound Sales Example]() * [Prompting Guide]() -----------------------------
Hi @wlu07, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
### Answer It seems like you're encountering an issue with the asynchronous function call in Vapi where the assistant enters a state of waiting without proceeding further, despite the server URL function successfully returning a message. This behavior indicates that there might be a disconnect between the expectation from the asynchronous function and the assistant's handling of its response. When setting
async: true
for a function, it indicates to Vapi that it shouldn't wait for a response from your server before proceeding with the conversation [(1)]() . However, the assistant saying "Sorry. A few more seconds" suggests it might be awaiting a response or there's an issue in how the response is being handled or interpreted by Vapi. To debug this situation, ensure the following: - The function call is correctly configured according to the Vapi documentation, with all required fields correctly set. - Verify your server's response structure matches what Vapi expects. For asynchronous calls, even though a direct response isn't required, ensuring your server responds correctly might help in debugging. - Review the call logs and function call specifics in your Vapi dashboard or through the API to check if there are any errors or warnings that might indicate what's going wrong. If these steps don't reveal the issue, consider testing with a simplified version of your function call (possibly synchronous) to see if the behavior persists. If the simplified test works as expected, gradually reintroduce elements of the original function call to pinpoint the cause. Given the symptoms you've described, it's possible that the issue could be on either side. Without direct insight into the internal workings of Vapi during these calls, it can be challenging to determine the precise cause. However, starting with these debugging steps might
help isolate the problem. If you've gone through these steps and the issue persists, it could be beneficial to examine discussions or reports from the Vapi community for similar experiences. Sometimes, insights from other developers encountering similar challenges can provide clues or workarounds that are not immediately evident from the documentation alone.
put async = false then it will work.
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.