Tool / function calling works in web application, ...
# support
p
Tool / function calling works in web application, not when using API calls with the exact same settings. Is there a difference between the two on how to set up?
v
@Peppelerd It's great to hear that the tool and function calling works well in your web application. When it comes to API calls, the setup should generally be the same, but there are a few things you might want to check: 1. **Authentication**: Ensure that the API calls include the correct authentication headers or tokens that might not be required within the web application context. 2. **CORS (Cross-Origin Resource Sharing)**: If you're making the API calls from a different domain, make sure that CORS is properly configured on the server to accept requests from your web application's domain. 3. **Request Format**: Verify that the request payload is correctly formatted as JSON and that the content type is set appropriately (usually
application/json
). 4. **Endpoint URL**: Double-check the endpoint URL used for the API calls. It should match the one that the web application uses. 5. **HTTP Method**: Confirm that the HTTP method (GET, POST, PUT, DELETE, etc.) matches the one expected by the API. 6. **Error Handling**: Look at the error responses from the API to get clues about what might be going wrong. 7. **API Version**: If the API has different versions, make sure you're calling the correct version that supports the tool/function. 8. **Network Issues**: Ensure there are no network issues that could be blocking the API calls. If you've checked all these and the issue persists, it might be helpful to see the exact error message or response code you're getting from the API. This can provide more insight into what might be going wrong. If you need further assistance, please provide more details or ask support for more info on this.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
p
Yes all of that is done
@User @User In general the agent is so much slower when creating a call througn API vs dashboard
s
call id please.
p
This is with API call, where tool call 'notification' is not working: b1b69afe-d645-4345-ba3b-a7e67cf7b894 This is in dashboard, with as far as I can tell everything the same, but it IS working: 0f7c6536-c0d3-472f-a3ec-c8ea1872f17b
What we are trying to do: every time a person picks up a call (so not a voicemail), a webhook should be triggered. This webhook notifies an application that someone picked up @User
s
hey it's mostly related to prompting luckily it's working for webcall but not for phone call.
p
We are using the same prompt tho
For both
s
checkout vapi guide and for example you can use this https://gist.github.com/bajajcodes/ff0bc6e126d4956fb422d47a397abeff
p
Is there maybe a different way of triggering a webhook when a user picks up?
s
yes i just checked but for sure it's related to prompt.
p
We have this now: - If response indicates it is Robert: proceed to step 2 and always run the 'notification' tool.
Maybe there is a better way
s
i suggest check this https://docs.vapi.ai/prompting-guide and follow flat nesting in prompt.
p
So API call VS dashboard respond differently to the same prompt?
s
no it's just that it's working for you one in one case and not in another.
happned with me over yes and yeah as well.
p
I see thanks
s
try mimcing same words over both calls you will notice the difference.
p
So flat nesting?
I don't see that in the doc
s
my recommendation, forget about it use vapi guide it's enough
p
cool thanks
2 Views