Multiple function call even though it's not needed...
# support
n
I have a custom function setup to my server and it works okay. The problem I got is that the function sometime is called multiple times (in a crazy amount) even though it's already succeed before, call id: 019bbed8-b8ea-711a-b719-1aae0107c0bf . The other scenario is that the function also being called even though it's not needed, call id: 019bb5d6-574b-7bbd-b551-079817936069 please advise on how I should approach this? the function is set to
async: true
. https://cdn.discordapp.com/attachments/1461143606998863932/1461143607284334675/image.png?ex=698b19c6&is=6989c846&hm=642043dc58cc13393742a0ed59a14e4fac919c8a4500b667b45c1422baaa6780&
c
Hi nafis, Please change async: false for the tool to not make multiple calls. Regards, Vapi Support
n
I have set async: false as requested, but the issue persists. Please see call ID: 019bc3a2-2c6c-7ff1-a318-1062c2cbb6ae. Additionally, in call ID: 019bc021-917d-711a-b320-3506310447b2, I used the apiRequest tool instead of a custom function, and the problem still occurred. This suggests the issue may not be related to the tool calls themselves. Could you also explain the reasoning behind removing "Set @bookingLinkSent = true" from the system prompt and how that might resolve this issue?
c
Hi there, Please update the prompt where the guardrails are enforced explicitly add these to the prompt: ## CRITICAL: Booking Link Rules ONE LINK PER CALL MAXIMUM: - NEVER send more than ONE booking link per call - Before calling send-booking-link, check: Is @bookingLinkSent already true? - If @bookingLinkSent = true, DO NOT send another link - If customer asks for link again, confirm: "I've already sent that to your phone" After sending ANY link: - Immediately set @bookingLinkSent = true - Do NOT send again for any reason - Move to call closing ## Call Closing BEFORE closing: 1. Check if @bookingLinkSent = true OR @callbackRequested = true 2. If yes → Call send-email-summary (NOT send-booking-link!) 3. Then proceed to closing statement If link already sent: - Do NOT send again - Just say goodbye and end call Regards Vapi Support
3 Views