Tools current time
# support
b
Hello, I am currently stuck and need some help. I have created a function in Tools that is supposed to determine the current time and date through Make using a webhook. I named the function 'getdate' as a string and included it in the prompt. In Make, I have a flow that triggers the webhook and a webhook response that provides the current time and date. In the call, it works when I ask for the time; the voicebot triggers the webhook and it runs successfully. However, the voice agent does not take the time and date from Make (webhook response) and instead tells me that an error has occurred or gives me a hallucinated time. Can you help me with this?
v
@brkxix I'm glad you reached out for assistance. It sounds like you've set up a webhook to fetch the current time and date, but you're encountering issues with the voice agent not properly handling the response from Make. To help you effectively, I'll need a bit more information about how your function 'getdate' is implemented and how it's supposed to interact with the voice agent. Specifically, it would be helpful to know: 1. The exact error message you're receiving from the voice agent. 2. The expected format of the time and date response from the webhook. 3. How the 'getdate' function is supposed to process the webhook's response. Once I have this information, I can provide more targeted assistance. If you have any logs or additional details about the function's implementation, please share them as well. If the issue is complex and requires a deeper investigation, it might be best to ask support for more info on this.
You can continue this conversation by mentioning me in the message.
b
they have a built in function for this. Just tell your assistant in the system prompt that the current date and time is {{now}}
b
Thanks. where can I read this in the docs? I need a different time zone, but this was very helpful.
The error is probably due to vapi tools. I just tested another make flow. It runs smoothly, but the webhook response is not received by vapi and played back by the agent...
b
Yes, tools are all messed up. I just reverted to functions today to get things working again. Major problem trying to get the Free/Busy response from my Google calendar. See my support ticket "Assistant ignores Free/Busy..." https://discord.com/channels/1211482211119796234/1262153106964222045
Use formatDate() in Make everywhere you are using a date or you'll get some weird results. I told my assistant in Vapi that it (the system) is in the Eastern time zone and to ask the user which time zone they are in and adjust accordingly. Works great, but again, that's using a function, not tools.
b
Hmm.. good to know. For me the functions are grayed out and can no longer be used. So is there no alternative method to get it working?
b
you have to use the api
s
@brkxix can you please share the callids.
b
Hi, for example: e10a08ba-35e5-4c33-88b9-d10cfaaab04f The Tool: GetAvailableSlots
8b22aa4b-88f0-4074-acf0-953c38412ed7
d522bdd0-ca58-4c8b-9b85-c68b4b1386c3 newest test
s
@brkxix please return the result in correct format.
Copy code
json
🔵 10:00:52:423 Tool Calls Finished. Results: [
  {
    "toolWithToolCall": {
      "type": "make",
      "function": {
        "name": "GetAvailableSlots",
        "async": false,
        "parameters": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "description": "Das Datum zum prüfen der verfügbaren Zeitfenster"
            },
            "GetAvailableSlots": {
              "type": "string",
              "description": "Checkt ob die Zeiten im Kalender verfügbar sind"
            }
          }
        },
        "description": "Überprüft belegte Zeit Fenster zwischen 9 Uhr und 17 Uhr an einem bestimmten Datum."
      },
      "async": false,
      "server": {
        "url": "https://hook.eu2.make.com/tr42eubpk5jmo6eusf07j7wk7esyzoyf"
      },
      "messages": [],
      "toolCall": {
        "id": "call_qacnOvz95K9Zlc9DDHrkyssZ",
        "type": "function",
        "function": {
          "name": "GetAvailableSlots",
          "arguments": {"date": "2024-07-18"}
        }
      }
    },
    "toolCallResult": {
      "name": "GetAvailableSlots",
      "toolCallId": "call_qacnOvz95K9Zlc9DDHrkyssZ",
      "error": "No result returned."
    }
  }
]
b
I don't understand what is meant. I created the function via the gui in vapi as a tool and received a webhook response from make. I don't see any errors? what exactly should I do?
s
Your returning tool result in wrong format. It has to be in this format:
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
See your tool call results say no result returned, because of this assistant is unable to use your response.
Copy code
"toolCallResult": {
      "name": "GetAvailableSlots",
      "toolCallId": "call_qacnOvz95K9Zlc9DDHrkyssZ",
      "error": "No result returned."
    }
Check type here, components > schema > ServerMessageResponseToolCalls
Also because of no response i am closing this ticket.
12 Views