https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> custom function works in Te...
# ❓・ai-evy-support
s
@AI Evy custom function works in Test LLM, but gives an error in a Voice Call
a
Thanks for tagging me @shahretell. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Integrate Function Calling]() * [LLM WebSocket]() * [Custom Function]() * [LLM Playground]() -----------------------------
### Answer When implementing custom functions, there are a few key things to verify: Verify Request Signature Make sure to verify that requests are coming from Retell by checking the X-Retell-Signature header [(1)]() . This is important for security and proper function execution. Test Function Implementation The LLM Playground allows you to test your AI agents without making actual calls [(2)]() . However, in real voice calls, there may be additional considerations: 1. Function response timing - Voice calls require proper handling of streaming responses [(3)]() 2. Request verification - Verify the request signature in your endpoint implementation [(1)]() Example verification code:
Copy code
javascript
import { Retell } from "retell-sdk";

this.app.post("/check-weather", async (req: Request, res: Response) => {
  if (
    !Retell.verify(
      JSON.stringify(req.body),
      process.env.RETELL_API_KEY,
      req.headers["x-retell-signature"] as string,
    )
  ) {
    console.error("Invalid signature");
    return;
  }
Troubleshooting Steps 1. Check that your endpoint URL is valid and accessible 2. Verify the parameters are defined correctly using JSON schema format 3. Ensure your function implementation handles streaming responses appropriately for voice calls [(3)]() Based on community experiences, some users have reported that while functions work in the Test LLM environment, actual phone calls may handle requests differently [(4)]() . If issues persist, you may want to test the function using a 'Test Audio' web call to verify the behavior .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.