quickest-silver
quickest-silver15mo ago

Issue with calling multiple tools in a call.

Hey, thank you for building this amazing tool. I'm encountring an issue and would appreciate if anyone would point me in right direction. I've 3 tools in Assistant, which are also visible when I make GET request to assistant. My prompt calls all 3 fucntions. But during a call, only one of them is being executed. If first tool is executed, other 2 wont even be called. I tested and stopped calling 1st tool from prompt, so 2nd tool was executed but not 3rd. Then didnt call first 2 tools and only 3rd tool worked. Could there be any reason why only 1 tool is being called during a call? Is it just prompt engineering? if so are there any good prompts that effectively calls all tools in an assistant?
14 Replies
Vapi
Vapi15mo ago
@Prabhu I'm glad to hear you're enjoying the tool! It sounds like you're experiencing an issue with executing multiple tools during a call. This could be due to a variety of reasons, including the way the prompt is structured or a limitation within the Assistant's configuration. To ensure that all three tools are called effectively, you might want to consider using a parallel execution strategy if the tools can operate independently of each other. This can be done using the multi_tool_use.parallel function, which allows multiple tools to be executed at the same time. Here's a general approach you can take: 1. Make sure that each tool can be called independently and doesn't rely on the output of another tool. 2. Structure your prompt to call the multi_tool_use.parallel function with the appropriate parameters for each tool. 3. Test the new prompt to ensure that all tools are being executed as expected. If you provide me with the names of the tools and the parameters they require, I can help you construct a prompt that uses the multi_tool_use.parallel function to call all three tools simultaneously. If the tools do depend on each other's outputs, we may need to consider a different approach. You can continue this conversation by mentioning me in the message.
quickest-silver
quickest-silverOP15mo ago
Here are 3 tools. 1st tool is pretty independent. it's just for updating Google Sheets. 3rd is bit dependent on 2nd tool as 2nd tool 'getAvailability' provides free tmeslots which are used while calling 3rd tool 'bookMeeting'
quickest-silver
quickest-silverOP15mo ago
Even if they are independent of each other, how would "multi_tool_use.parallel" work? Where should I add it in Assistant payload?
foreign-sapphire
foreign-sapphire15mo ago
change he server url. Of course it is going to call all 3 off the same tools if they are using the same server. so make a PATCH request to update the server as you can't do it via dashboard @Prabhu Also are those real urls? xxx/yyy/zzz?
quickest-silver
quickest-silverOP15mo ago
It's using different server URLs which are triggering 3 different automation. I just replaced actual webhook with xxx, yyy, zzz, since exposing them could lead anyone calling those servers
eastern-cyan
eastern-cyan15mo ago
call_id pls
quickest-silver
quickest-silverOP15mo ago
Have made lot of calls. But here are recent ID's 161c573b-2dee-40e5-ab01-d1a01435234c (triggered 2nd tool, but not 3rd) 20d85c16-c4d1-4c26-a06d-e032045ed2fb (directly triggered 3rd, as Id removed 1st & 2nd from prompt) Any update on this?
eastern-cyan
eastern-cyan15mo ago
Sorry about the delay. @Shubham Bajaj can you please help?
automatic-azure
automatic-azure15mo ago
@Prabhu your tool calls failed and returned the following, please check the tools response format. Error Message
Server Message Failed: https://hook.eu2.make.com/padvd88h4e2opn553wfitodji6tl65yb)

Error: {
"message": {
"message": "Request failed with status code 400",
"data": "Queue is full."
}

"AxiosError: Request failed with status code 400
Server Message Failed: https://hook.eu2.make.com/padvd88h4e2opn553wfitodji6tl65yb)

Error: {
"message": {
"message": "Request failed with status code 400",
"data": "Queue is full."
}

"AxiosError: Request failed with status code 400
automatic-azure
automatic-azure15mo ago
Expected Response Format, more https://docs.vapi.ai/tools-calling
{
"results": [
{
"toolCallId": "X",
"result": "Y"
}
]
}
{
"results": [
{
"toolCallId": "X",
"result": "Y"
}
]
}
Vapi
Tools Calling - Vapi
Learn how to create and configure Tools Calling with Vapi.
quickest-silver
quickest-silverOP15mo ago
@Shubham Bajaj thank you for responding. We'll be using Squads instead as they seem to be more efficient with mulitple tools. But when I make call with SquadID and use Assistant Overrides for variables names, they're not overriding the way they used to override while using assistantID in call. Is this not supported? CallID for reference: c024f50e-4b80-4986-aa0b-fced5a72f0ed Also why are tool calls failing? Its showing good response in N8N (server)
automatic-azure
automatic-azure15mo ago
Sorry for the dealyed resoonse allow me sometime I will check. Sorry I cross checked it again, it's not tool call. That's because of conversatioon-update server event. Hey you have to pass these assistantOverrides with the assocaite squad assistant as your making call using squad.
quickest-silver
quickest-silverOP15mo ago
Sorry but I dont get it. Asked VAPI AI & its just telling to use this payload { "customer": {"number": "<phone_number>"}, "squadId": "<your_squad_id>", "assistantOverrides": { "variableValues": { "name": "John", "product": "Widget X" } }, "phoneNumberId": "<your_phone_number_id>" } Is this not correct?
automatic-azure
automatic-azure15mo ago
Yes it's not working, you can use either member overrides or assistant overrides inside the squads such as
{
"squad": {
"members": [
{
"assistantId": "",
"assistantOverrides": {
"variableValues": {
"name": "Richie Rich"
}
}
}
],
"membersOverrides": {
"variableValues": {
"name": "Richie Rich"
}
}
},
"phoneNumberId": "",
"customer": {
"number": ""
}
}
{
"squad": {
"members": [
{
"assistantId": "",
"assistantOverrides": {
"variableValues": {
"name": "Richie Rich"
}
}
}
],
"membersOverrides": {
"variableValues": {
"name": "Richie Rich"
}
}
},
"phoneNumberId": "",
"customer": {
"number": ""
}
}
I will look into this and get back to you.

Did you find this page helpful?