wait for function response
# support
a
How do I make VAPI assistant call a tool only once and wait for the response before proceeding? The assistant that I have continously calls the function before waiting. I am using the UI to create the tool. I am using NGROK to use my local system as a server and FastAPI to catch the requests. Assistant ID - d5f66527-a011-4835-bcdc-bd6725df5c6f Call ID - 289b431a-248b-4d16-b02f-2dbb30fdc61b
v
message has been deleted
@anishkasi To ensure that your VAPI assistant calls a tool only once and waits for the response before proceeding, you need to make sure that your tool configuration in the UI is set up correctly to avoid multiple calls. Here are some steps you can follow: 1. Check the tool configuration in the UI to ensure that it's not set up to retry on failure or to call the tool multiple times. 2. Verify that your FastAPI server is correctly handling the request and sending a response back in the expected JSON format. If the server takes too long to respond or doesn't respond at all, VAPI might attempt to call the tool again. 3. Ensure that your NGROK setup is stable and that the connection between VAPI and your local server is not being interrupted, as this could also cause multiple calls if VAPI doesn't receive a response. If you've checked these points and the issue persists, it might be a good idea to look into the logs or debug information provided by VAPI, NGROK, and FastAPI to identify where the problem might be occurring. If you need further assistance with the configuration or troubleshooting, please provide more specific details about your setup or the behavior you're observing, and I'll do my best to assist you. If the issue is beyond the scope of the information provided, you may need to ask support for more info on this.
You can continue this conversation by mentioning me in the message.
c
You create a tool and specify
n
use "async": false
s
🔵 03:42:39:496 Server Message Failed. (https://explicitly-secure-monarch.ngrok-free.app/test_check_availability). Error: { "message": { "message": "Request failed with status code 502", It is because your server failed to respond back
a
Hi @Sahil I received 3 more successful calls after that failed one in back to back succession
In the UI there is no option to specify async = False or True
I asked the AI assistant and it said that all tools are set to False by default
The three calls were within a second
I performed a PATCH request to update the tool and added the async option along with the messages but it still does not wait for the response. There is no deterministic action that happens
During some calls it will work as expected but sometimes the assistant makes 5 calls back to back and just errors out. Sometimes the assistant does not even interepret the result that gets sent back from the tool @Sahil
@Chowderr
c
The only thing I can think of is that you do not have the response set like Sahil said. Hard for me to explain becuase I have no idea what you are using and how it works. On this page at the bottom https://docs.vapi.ai/tools-calling
s
Sent you a appointment link.
a
Yeah it would be ideal if we could meet!
I can explain the problem
Hi @Sahil Havent received any appointment link yet!
n
I'm interested in this discussion trying to get apis working in vapi
c
inside of Vapi?
t
Zapier has stopped working when it was...
s
That's weird.
Sent you another link
s
<wait for 'bookSlotCodes' tool result>
even when async: false. Because sometimes for me it moved to saying next message w/o completing the response post receiving it. This Works for Me
4 Views