GHL check availability tool is checking for 2023 a...
# support
r
Call id example - e04004ce-074b-4240-9165-1b860cc7d0f7 -- Issue 1 - Check availability tool I'm trying to book an appointment and every time it tries to check the calendar for availability, it says that we don't have an available time. I checked the messages log and it's trying to check for 2023 dates. In this case, it checked: "name": "get_free_slots", "arguments": "{\n \"startDate\": 1697726400000,\n \"endDate\": 1697899200000\n}" Which converts to October 19th, 2023 and October 21st, 2023. If that matters, my assistant is using the model GPT 4o cluster. Can you please help me fix this? I've tried talking to the Vapi AI chat on the docs website but I haven't been able to solve this yet. -------- -- Issue 2 - get contact tool On top of that, you'll notice that my get contact tool also failed even though it should have found a contact using the phone number that it searched. { "role": "tool_calls", "time": 1747438157199, "message": "", "toolCalls": [ { "id": "call_PjTEnxlAHXqRYHe9NyZwzfGU", "type": "function", "function": { "name": "get_duplicate_contact", "arguments": "{\"phone\": \"6477051165\"}" } } ], "secondsFromStart": 55.081 } It should have found a contact with this phone number /\ but the response was: { "name": "get_duplicate_contact", "role": "tool_call_result", "time": 1747438158482, "result": "[\n {\n \"type\": \"text\",\n \"text\": \"Error: API Error: 422 Request failed with status code 422\"\n }\n]", "toolCallId": "call_PjTEnxlAHXqRYHe9NyZwzfGU", "secondsFromStart": 56.364 } So it ended up using the create contact function. This worked, but it just updated the contact inside GHL because a contact already existed with that number. So it kind of worked in the end since it ended up on the same contact, but not as intended. Thanks a lot!
g
are you telling your assistant todays date & time using the dynamic variables so it understands in the prompt ?
k
Hey, Could you please schedule a brief call at your convenience so we can discuss this matter in detail? Kindly use the following link to book a suitable time: .
l
As @Genesai have said, you should give this context to your agent. I would recommend you to add this to your System Prompt: `` # Date and Time Management Current Date and Time Variables: Current date: {{ "now" | date: "%B %d, %Y", "Australia/Sydney"}} Current time: {{ "now" | date: "%I:%M %p", "Australia/Sydney"}} Day of the week: {{ "now" | date: "%A", "Australia/Sydney"}} `` If you keep having issues, try to remember the date at the moment of the process like: `` ## Introduction Before starting the conversation, establish context and the current date: {{"now" | date: "%A, %B %d, %Y, %I:%M %p", "Australia/Sydney"}} `` Or ``When the user uses relative time references ("today", "tomorrow", "next week"), convert them to absolute dates using the current date: {{now | date: "%A, %B %d, %Y, %I:%M %p", "Australia/Sydney"}}``
k
For the first issue, I would also recommend setting the current time and date in your system prompt to give time context to your assistant. For the second issue, I would add the country code to the number in a E165 format (eg. +1XXXXXXXXXX) and format the result so that it is only one line without newlines /n. Let us know if these changes resolve your issues
r
Hey everyone, sorry for the delay here. Thank you so much for all your replies. After the recent bug fixes published on Tuesday, I basically just deleted everything I wrote inside the "description" box inside the tools and that seemed to fix everything. Super weird but it worked for me!
k
Marking this ticket as Solved ✅