Assistant ignores Free/Busy result from Make.com f...
# support
b
I created a tool to get my Google Calendar Free/Busy times using Make.com google calendar widget "Get Free Busy Information". The Make Scenario successfully passes back the array of busy times to the assistant but the assistant ignores some or all of the busy times and reports busy times as available. Is there a way to get the assistant to recognize the array and reliably note the busy times?
v
@BrentPope Absolutely, it's important that the assistant accurately reflects your availability based on the data it receives. To ensure the assistant recognizes the array of busy times from your Google Calendar and reports them correctly, you'll need to make sure of a few things: 1. The data format from Make.com's widget should be correctly parsed by the assistant. Ensure that the data structure of the busy times array is well-understood and properly handled in the assistant's code. 2. The assistant's logic should correctly interpret the busy times. It should compare the current or requested time slots against the busy times array and determine availability accordingly. 3. If there's a time zone difference between the server where the assistant is running and the time zone of your Google Calendar, make sure to handle the conversion so that the times are compared correctly. 4. If the assistant has any caching mechanisms, ensure that it refreshes its data at appropriate intervals or upon each request to avoid working with outdated information. If you're still encountering issues, it might be necessary to debug the assistant's code to see where the discrepancy is occurring. If the assistant is not recognizing the array correctly, you may need to adjust the parsing logic or the way the assistant accesses the array elements. If you need further assistance with the implementation or debugging, please provide more details about how the assistant is currently handling the data, and I'll do my best to guide you through the process. If the issue persists and is specific to the assistant's internal workings, you may need to ask support for more info on this.
You can continue this conversation by mentioning me in the message.
b
how would i know if the assistant has any caching mechanisms?
v
@BrentPope To determine if the assistant has any caching mechanisms, you would typically need to review the documentation or configuration settings of the assistant. Here are a few steps you can take to check for caching: 1. **Documentation Review**: Look through the assistant's user guide or developer documentation to see if there's any mention of caching behavior or settings. 2. **Configuration Settings**: Check the assistant's settings or configuration files for any options related to caching, such as cache duration, cache storage, or cache invalidation triggers. 3. **Code Inspection**: If you have access to the source code of the assistant, you can inspect it for any caching logic or libraries that handle caching. 4. **Testing**: Perform tests by making repeated requests to the assistant and observing if the responses are faster after the initial request, which might indicate caching. Also, change the data at the source (e.g., Google Calendar) and see if the assistant reflects these changes immediately or with a delay. 5. **Support Inquiry**: If you're using a third-party assistant or a service with support, you can reach out to their customer support to ask about caching mechanisms. If you're unsure or cannot find the information you need, you can always ask for more details from the support team of the assistant service you're using. They should be able to provide you with the necessary information regarding caching.
s
@BrentPope please share the call id with timestamp.
b
2eb42083-d39c-4cd6-93e9-6f497e251d2a July 14, 4:24 pm. Note that I was able to finally coax out all of the busy times but it took 4 minutes and I had to ask over and over about which times were busy.
s
@BrentPope your not returning busy slot, because of this it's not working as expected. Check the reques-response below, also if everyhting seems correct to you then try refactoring prompt as per the guide.
Copy code
json
🔵 20:25:00:583 Tool Calls Finished. Results: [
  {
    "toolWithToolCall": {
      "type": "function",
      "function": {
        "name": "Get_FreeBusy",
        "description": "Use this function to get a list of calendar times already busy."
      },
      "async": true,
      "server": {
        "url": "https://hook.us1.make.com/3526u5f969eunlydgiaq3pwovgdejyf3"
      },
      "messages": [
        {
          "type": "request-start",
          "content": "One moment please"
        },
        {
          "type": "request-failed",
          "content": "I can't open the calendar."
        },
        {
          "type": "request-response-delayed",
          "content": "It appears there is some delay in communication with the time API",
          "timingMilliseconds": 4000
        }
      ],
      "toolCall": {
        "id": "call_yl2lZls6G5slI48SD4EQusAO",
        "type": "function",
        "function": {"name": "Get_FreeBusy", "arguments": {}}
      }
    },
    "toolCallResult": {
      "result": "Success.",
      "name": "Get_FreeBusy",
      "toolCallId": "call_yl2lZls6G5slI48SD4EQusAO"
    }
  }
]
b
I don't understand. What is this? I've never seen "Tools Calls Finished". What does "your not returning busy slot" mean? What request-response? do i need to add that to my tool?
Could you explain exactly how I would return the busy slot?
s
Your returning a simple message success instead your were supposed to return busy slots as per your logic. Because of this your assistant is not working as expected.
Instead of success return the value.
You don't need to any request-response I was showing you the response of your tool call.
b
ok, I've been working on that. Here is the json I just returned and it still does not work: { "results": [ { "result": { "end": "2024-07-16T11:30:00.000Z", "start": "2024-07-16T11:00:00.000Z" }, "toolCallId": "call_sms56jnzZvikm7S93MRSL4EN" } ] }
That is what Make is returning in my Webhook response. Do you see a problem?
At this point I'm just trying to get it to check a single time
s
Response has to be in string format only, so if you return object it has to be strignified. https://docs.vapi.ai/tools-calling#server-response-format-providing-results-and-context
b
That documentation says it needs to be in json format: When your Vapi assistant calls a tool (via the server URL you configured), your server will receive an HTTP request containing information about the tool call. Upon processing the request and executing the desired function, your server needs to send back a response in the following JSON format:
s
yes but the result has to be in string format.
Stringify your result object and then send it. Over the assistant, instruct the assistant on how to use the result and then it has to work.
b
Ok, I just added tostring(json) to my webhook response. What do i tell the assistant to do with it?
I added this and not working: You will receive a list of start and end times for slots already booked and not available.
Here is another call id 7/15 at 3:13 81078389-3698-451f-8b62-0cd815b21449 Clearly the assistant has the info but is not using it.
s
@BrentPope your response to tool call is:
Copy code
json
    "toolCallResult": {
      "result": "Success.",
      "name": "Get_FreeBusy",
      "toolCallId": "call_raATf9YbUD3qQ4tpN7R1UX9D"
    }
Then how can it work, please return response according to your assistant such as
Copy code
json
    "toolCallResult": {
      "result": "{start: datetime, end: datetime}",
      "name": "Get_FreeBusy",
      "toolCallId": "call_raATf9YbUD3qQ4tpN7R1UX9D"
    }
Obviously result is just approximation of what you can return.
b
so the structure is NOT Results Result, toolCallID? did this just change?
s
Strucutre is that only.
Copy code
json
"results": [
{
"result": "<result>",
"toolCallId: "<toolCallId>"
}
]
Your returning success then how can your assistant will understand.
b
I'm not returning Success, i don't know where that is coming from
wasn't there a request-complete section before? That seems to be missing
s
oh!!, one question did you update the messages array or added request-complete before?
b
I had it in there before, yes. and i just added it back with a blank response
I followed the video you have to create a tool (get the time) exactly. That video has you create a tool inside an assistant which does NOT create the tool in the dashboard to be used on another assistant. That is the subject of my other support query "Why use a tool?" Creating a tool in the dashboard doesn't work so I created this one and a couple of others using the API AND the structure from the video which included the request-complete. So, do I need to delete all of these tools and start over?
s
No no you don't need to delete the tools.
after the recently shared call id if yes then please re run the test with empty request-complete message, else ping me.
b
I did re-run it. Still not working
s
call id
b
just ran it agin, still returning "success" call id 7748df75-5146-48c3-9c3d-eca0729bd67e
s
allow me sometiime ito get back you, because its look like somrthing is wrong with tools.
b
This is an enormous waste of time. I spent all day yesterday trying to figure this out just to find out that tools are not working on your end. I see there are a bunch of other tickets about tools. I'm just going to put this back into my assistant as a function for now, let me know when you get tools figured out.
s
sure I will let you know and if possible will put on the updates channel.
@BrentPope your assistant doesn't have transfer tool enabled. 7748df75-5146-48c3-9c3d-eca0729bd67e
b
You are right. I disabled it and deleted all the tools from that assistant. Put back the functions and it’s working fine.