Assistant not calling tools or functions.
# support
a
It was working fairly ok while I was still messing around with the code trying to get the right formats & responses but now my assistant is simply not calling my tool. I've removed it as a tool and added it as a function but it just doesn't call it at all. I've even started asking it to try again or change the parameters in the call to try again but nada. Here's the callID: 7cc2164f-a8cb-484e-92f1-4ee6ca1690d7
v
@arbstate I'm sorry to hear that you're experiencing issues with your assistant not calling your tool. It sounds like there might be a configuration problem or an issue with how the tool is being invoked. To assist you better, could you please provide me with more details about the tool or function you are trying to call? Specifically, I need to know the name of the function and the parameters you are passing to it. This will help me understand the situation better and guide you towards a resolution.
You can continue this conversation by mentioning me in the message.
a
@User The tool is called "checkSlot" and I pass the date & time to a preferredDateTime parameter.
@User . I changed my approach and loaded the tool using the API and not the GUI. Here's the new call ID: de9b311c-215e-4dc0-8d1f-da561ae841ac. It seems to trigger the tool every time now but the assistant is not recognising the response. The response is: {"statusCode": 200, "body": "{\"results\": [{\"toolCallId\": \"call_Q9OmH6CEgazy0kvNJk3xhvfh\", \"result\": \"The slot is available.\"}]}"}. ----- yet the assistant replies "I couldn't check the calendar", which is one of the messages in the tool.
h
same issue
a
@Sahil - Any chance of assisting with the above. Using the call ID above, the timestamp for the when the tool was called is 08:02:43:805. Thank you.
s
Please use gpt-4o/gpt-4, and it will work for you. After that let me know, what's the result/
Hey please create the issue.
h
@Shubham Bajaj I call, I say run the function, it doesn’t pass anything in result then it just says gimme a sec
s
@howwy please create a issue and share call id and if possible timestamp as well.
@arbstate did you checked it using gpt-4?
h
@Shubham Bajaj 30975637-3dde-4c85-aa86-c25e14c37248
s
I've got the same issue, sometimes the function is not called. Here is the call ID: 0d514cfd-4d59-438d-8735-736e6f634f02
a
Hey @Shubham Bajaj - Yes I've tried them all, here's the latest using gpt4 cluster for call if 20dabe8b-325e-4148-afbe-45e20765d7c9. Response body: {'results': [{'toolCallId': 'call_UoQDmQvTgVlEXShhv2uDLIMU', 'result': 'The slot is available.'}]}
@Solv, have you installed the tool using the API? My tool call didn't work with the tool loaded in the GUI but since I installed it using the API, it's called every time now. I'm just having issues now with getting the assistant to recognise the response. If you didn't use the API, check the vid at the end of this page for very clear instructions on how to do it: https://docs.vapi.ai/tools-calling
s
@arbstate no, just created a function in the GUI - I'll look into using the API instead, thanks for the tip!
s
@Solv / @howwy please create a separate issue it will be really helpful.
I will get back to you on this by today as tool call was successful, but still resulted into tool call failed. Please allow me sometime.
a
THanks @Shubham Bajaj , I've created a new assistant with very basic instructions just to call the tool and relay the results and it's still not working. Here's the new call ID if you want to look at that too: e8ea28ee-d8ce-45c6-8c5f-5ace966b0131
s
Hey I get back to you on this, allow me sometime for the confirmation.
a
That would be appreciated. I can't do much with Vapi without working functions. I would love to get it working before the new week starts tomorrow or look for an alternative
s
@arbstate I have created issue for it will be resolved shortly.
a
Fantastic news, thank you
s
@arbstate your sending response in stringfied format, please send as record or object.
a
Hi there, changed it to an object but it's still not working. Also tried bool instead of a string as the response. Here's a new call ID: b42fa44c-4390-4f80-8cfc-ced8ef0b2c79. And the response: { "statusCode": 200, "body": { "results": [ { "toolCallId": "call_Q9OmH6CEgazy0kvNJk3xhvfh", "result": true } ] } }
I also tried changing it back to string and still not accepting the function's response.
I also need to mention that waiting 24h for a reply every time with almost no information is very frustrating. It took 5 days to tell me to use JSON object and not stringified and even that didn't work as a solution.
s
I am really sorry for this, it's my mistake and won't be repeated again. FYI: it was because of tmz.
What do you meant by this, did you tried changing the response type of
results[0].result
to string? Because the expected of
resutl[0].result
is
string
.
a
Hi Shubham, what I mean is that I tried a bool but then changed it back to string. Neither of them worked even though it was a json object. Do you have any other ideas?
Im at a loss for words. I've created a new vapi account to see if my account was perhaps the problem but it's still exactly the same. My function response is in the exact format as per your docs but the assistant is simply not responding to it. Is there no way we can setup a better way to troubleshoot this issue? We're obviously in different time zones and I'm happy to slot in with a time that works for you (or a support team member) but the way we're communicating now is infuriatingly slow. Here's my function response calling it in Postman: { "statusCode": 200, "body": { "results": [ { "toolCallId": "call_Q9OmH6CEgazy0kvNJk3xhvfh", "result": "The slot is available." } ] } } And here's the latest call ID (on the new Vapi account): 0e3409fd-fc5a-40e0-9187-f1ec3565e841
@Shubham Bajaj - Ok I think I found the problem. My function still returned the status code for the API call (status 200) and then the body with results -> toolCallId & result. When I removed the status code and only returned the body it seems to work. I've dumbed down the assistant to only check the slot and respond on it so need to backtrack all the way to get the booking function to work but it's a step forward. I'll do some more tests and resolve this ticket once I can confirm it's all working. TLDR: don't send the status code from the function, only the body: { "results": [ { "toolCallId": "call_Q9OmH6CEgazy0kvNJk3xhvfh", "result": "The slot is not available." } ] }
s
JTC: your not sending status code inside body? because your tool call result response strucutre is as following.
Copy code
json
{
  "statusCode": 200,
  "body": {
    "results": [
      {
        "toolCallId": "call_1CI2f5fRyYVRaJVzJxrtzrWo",
        "result": "The slot is available."
      }
    ]
  }
}
Check the schema for the server base response message: components.schemas.ServerMessageResponse. Then, review the schema for the server message response tool call result: components.schemas.ServerMessageResponse. Find these schemas at [Vapi API JSON documentation](https://api.vapi.ai/api-json).
@arbstate check DM.
3 Views