Function calling super buggy
# support
t
I'm having almost no luck with function calling. It only works about 1 out of 20 tries and even then its buggy. Very consistently (over 90% of the time) the voice agent stops responding completely and then times out. It almost always, again over 90% of the time, starts making weird noises like it's hiccuping or going "uuuhhhh, uh, uh" and then stops responding. I've tried reducing my prompt to only 3 sentences that are only about calling the function, but it only works about 5% of the time. Check out the call logs for the following call IDs: 3f42306f-97b7-42a0-be08-2793520d29aa 82c899b1-5884-4a22-9f63-12d5f224011b c168fbb7-6858-4644-8564-ac43365e8e9c I simply can't get function calling to work for me. Any help is appreciated. https://cdn.discordapp.com/attachments/1246251392838926376/1246251393300566058/Screenshot_2024-05-31_at_6.15.51_PM.png?ex=665bb58e&is=665a640e&hm=5f0185284e2fd1e7ba03d88a509dc63cb0a905c656edbb5b2be93211d6774823&
v
Hi @The Reverend, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Function Calling]() * [Outbound Sales Example]() * [Create Phone Call]() * [Call Ended Reason]() -----------------------------
### Answer It sounds like you're encountering significant issues with the function calling feature in Vapi, which should operate more reliably than you've described. Here's how we can start addressing this: 1. **Analyzing Call Logs**: I cannot directly access or analyze specific call logs like those you've provided. However, you can review the logs in your Vapi dashboard to check for any recurring error messages or unusual patterns around the times the issues were experienced. 2. **Review Error Codes**: If the agent is timing out or behaving unexpectedly, check for any specific error codes or messages in the logs, which might indicate what's going wrong. Common issues might relate to server connectivity, API limits, or misconfigurations in your function setup. 3. **Function Configuration Review**: Ensure your function definitions and server configurations adhere to the guidelines detailed in the Vapi documentation. The definitions need to be correctly formatted and the server URL must be responsive. You can refer to the function calling configuration guide for more details [(1)]() . 4. **Test with Simplified Scenarios**: If the issues persist, try simplifying your function calling scenario further or create a minimal setup that replicates the issue. This might help isolate whether the problem is with specific parameters or the overall setup. 5. **Consult Documentation and Community**: Sometimes, community discussions or updated documentation might provide insights or solutions to similar problems. Consider checking recent forums or community posts for any related discussions. If these steps do not resolve the issues, it might indicate a deeper technical problem that would require a detailed review by the support or technical team at Vapi. For immediate troubleshooting, always ensure your function configuration
s, server response specifications, and assistant settings are aligned with the latest Vapi documentation standards and recommendations.
Got it. Tagging @User for additional help.
t
I've dug all through the call logs and I don't see any errors at all.
This call log recording shows the worst example so far. It hiccups a lot and just can't do it no matter what. ab6b7c06-132c-41f5-b5a7-b1e4904c718a
Another attempt: 87e34490-c86c-4bb3-98bb-f13f47d74c0e
s
I just checked the logs and function call was made.
Just make sure not to use Tools Calling and Function Calling options simultaneously.
t
OK well I'm not seeing the function being called. It ony worked a few times and now it doesn't work at all. The agent stops responding almost every time. I'm only calling one function, nothing else. How do I proceed? I'm paying for this but it doesn't work.
s
Your have defined both function and custom tool. Just use function and create new assistant if possible and it will fix the issue.
OK I got it to work more reliably by shutting off the "Dial Keypad" functionality. So how do I get a voicebot to dial the keypad and execute a function call? I need both.
Is there a way to chain agents together so each agent can execute a function call?
Or can I call a new agent into existing phone call without hanging up?
Ok success was shortlived. It worked back to back 3-4 times and now the agent has returned to not responding at all once the tool/function is called. I tried removing the function and made it into a tool instead. I also removed all the server messages except end of call report and tool calling. I shut off the Backchanneling because it keeps interrupting with weird noises like it has Tourette's syndrome. I've ran hundreds of tests with various models, prompts, etc. Nothing works reliably to call tools or functions.
Doesn’t even work on gpt4o now. The agent usually just stops responding and never calls the tool.
The new prompt is 3 sentences only about using the tool and nothing else and still doesn't call the tool.
OK now the agent refuses to respond at all. It will only answer with the First Message text and then does NOTHING after that. Three calls in a row. Here are the IDs:
Copy code
84773ac6-989c-4cc4-9dcb-a8146a37b1ef
Copy code
5e88f1c2-6463-4e2e-a82c-f4790cb00dc8
Copy code
e379e4b9-391a-4192-ade2-b9b8054e5fc1
Something is really wrong with my Vapi account or something. I can't get it to do anything at all now. Agent answers with First Message text and won't respond after that no matter what's in the prompt. It would at least have a conversation before and just not call the tool/function. Now it won't even do that.
I finally am seeing the agent respond and calling the tool. But its really not reliable. Only works about half the time. And to get there I had to strip out all other functionality. - Shut off Dial Keypad function (even though I really need it as well) - Shut off Backchanneling because it interrupts the conversation when doing a tool call and glitches - Set temperature to .1 - Strip down system prompt to remove any other tasks or features - Set voice Style Guidance to zero so it doesn't get emotional and glitch while its trying to call tool function (I witnessed it doing this dozens of times) - Shutting off Detect emotion seems to help but I can't confirm I'll be happy when this is all more stable so it’s actually usable in production.
s
I don't think that is the case. I used the function call just now, and I am not facing any issues. I sent you a meeting link. Let's have a meeting and see what the issue is
2 Views