function call not being not triggered at all or tr...
# support
d
I use VAPI API to create a call with described function call to my backend. I'm trying to solve it for few days with proper prompts, but it looks like it is problem with VAPI. call id no function call:
a9a2c044-f9fc-4884-8c2a-d2bb88480a6c
After couple of other tries, my function got called by VAPI successfuly, but it takes a lot of time for VAPI to trigger it. call id with function call, super long delay:
a8c91fbe-62ef-452e-baa0-fedb9371b8c0
In logs I also see multiple of entries:
"Model called tool: sendSMS()"
, but only in last call, my backend got actually called. What could be the reason for this? Thank you for help 👍
v
@DoubleA I'm glad to hear that you were able to successfully trigger your function with VAPI, even though it took longer than expected. There could be several reasons for the delay and the multiple log entries you're seeing: 1. Network Latency: Delays can occur due to network latency between VAPI and your backend. This can be intermittent and vary from one call to another. 2. Server Load: If your backend or VAPI's servers are experiencing high traffic, it could result in slower processing times. 3. Retry Logic: VAPI might have a retry mechanism for function calls that fail initially. This could explain the multiple log entries for
sendSMS()
. 4. Throttling: If there's a rate limit on your backend or within VAPI, and it's being exceeded, subsequent calls might be queued and delayed. 5. Caching Issues: Sometimes, caching mechanisms can cause delays if they're not properly invalidated or updated. 6. VAPI Internal Queuing: VAPI might be queuing requests internally if it's processing a high volume of calls, leading to delays. To further investigate and resolve this issue, I would recommend checking the following: - Review your backend server logs to see if there are any noticeable patterns or errors that correspond with the delays. - Check the network latency between VAPI and your backend. - Ensure that your backend is optimized to handle requests efficiently and can scale to meet demand. - Contact VAPI support to inquire if there were any known issues or maintenance activities during the times you experienced delays. - If possible, monitor the API calls in real-time to see if the delay is consistent or varies. If you need further assistance or if the problem persists, please don't hesitate to reach out to VAPI support for more detailed analysis and support.
You can continue this conversation by mentioning me in the message.
d
I'm testing it for couple of days and I couldn't get my backend triggered at all and it doesn't look like any of backend or network issues, it seems like VAPI is not triggering function call at all, or very slowly.
v
Got it. Tagging @User for additional help.
d
Could anyone take a look at it? This is the only thing which is currently stopping me and my client from starting full scale project.
@User ?
s
check vapi prompting guide and it will work.
d
Hi @Shubham Bajaj , I don't think this is issue with prompts, since in both cases in logs I see multiple lines of
"Model called tool: sendSMS()"
, it looks like Model does recognize to call
sendSMS
(multiple times), so my understanding is that VAPI gets this information from OpenAI but does not call provided
server.url
@User
j
yeah this isn't a prompting issue. This one is hard 😄
d
@Shubham Bajaj @User Thanks to great help of @John George and important advice I did another test. So same tool (and same prompts) does work when it is defined through VAPI dashboard + it's id is added to
toolIds
array. In that case it works very fast, as it should! It doesn't work when I add same information as transient tool into create call request. Another very important thing to note is that, when using toolIds, instead of transient tool, AI works much much better, like night and day - in terms of quality of asnwers. As a side note I remember that I used
gpt-4o-mini
with
toolIds
(but I was asked by VAPI to switch to transient tool), and when I started to use transient tool, AI started to talk in different languages and behaved like crazy - so I had to switch to
gpt-4o
, but still it wasn't perfect. Now when using
gpt-4o
and
toolIds
it works perfectly. I might need to use transient tool at some point in future for some very specific cases. I would appreciate VAPI team to take a look at it and fix it 👍 .
s
> "I'm testing it for couple of days and I couldn't get my backend triggered at all and it doesn't look like any of backend or network issues, it seems like VAPI is not triggering function call at all, or very slowly."
@DoubleA i suggest comparing current assistant + tools config with transient tools + assistant config, you will get to know what's the difference.
FYI: transient assistant works.
d
Those are exactly same I use transient assistant, but when I add tools definition there is a problem, my backend is not called at all. When I use toolIds then backend is called.
In both cases function names, properties and descriptions are same
Same assistant in both cases - transient
s
do let me know if happens again for you.