Date/Time (today)
# support
e
I'm having difficulty pulling current date and time, when i call the agent and specify date time and year, then it works, but that isn't what I want, I want to be able to say, "today" and get back the calendar date from my google calendar, everything else works, just the today and tomorrow dilemma with vapi
v
To have your Vapi assistant return the current date when a user says "today," use the dynamic variable
{{now}}
in your prompt or tool configuration. For example:
Copy code
The date today is {{now | date: "%Y-%m-%d"}}.
This will automatically insert the current date in the desired format. Make sure your assistant's logic maps the word "today" to this variable for seamless user experience. Reference: See [Vapi dynamic variables documentation](https://docs.vapi.ai/assistants/dynamic-variables). Source: - [Variables Vapi Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
v
Message marked as helpful by @Ermo150! 🎉
c
Hi Ermo150, Google Calendar integration documentation, when handling relative date terms like "today" or "tomorrow", you should: 1. Configure your assistant's system prompt to include the current date context:
Copy code
Current date: {{now}}
2. Use the Google Calendar Check Availability Tool with proper date handling: - The tool expects ISO 8601 formatted dates - For "today" references, use the current date from the system context - For "tomorrow", add 24 hours to the current date Example configuration for the calendar tool:
Copy code
{
  "type": "google.calendar.availability.check",
  "name": "checkAvailability",
  "description": "Use this tool to check calendar availability. Convert relative dates (today/tomorrow) using the current date: {{now}}"
}
The system should automatically handle the conversion from relative dates (today/tomorrow) to actual dates when making calendar queries. If this isn't working, verify that: 1. Your system prompt includes the {{now}} variable 2. The Google Calendar integration is properly configured 3. The tool has permissions to access the calendar
e
Hey, thank you so much, iwas able to make the date work correctly, i am now having some issues with the google calendar get availibility node, it seems to run the flow and create booking events, but it does not recognize already booked events within that time slot, it will still book them, my idea is to only allow 36 booked events within a time slot, even if that time bleeds into another, if the user says 6:30 but 35 events are booked for 6:30 and one more event still continues from 5:30 into 7:30, then 6:30 isnt sufficient, but it has trouble even recognizing one event at themomenbt
c
Hello, You may be experiencing an issue with the Google Calendar availability checking and booking system. The documentation doesn't explicitly address the capacity limit feature you're trying to implement (36 events per time slot), which suggests this might need to be handled through custom logic. For proper availability and booking handling, here are some suggestions: 1. Use the Google Calendar Check Availability tool before creating any events to properly verify slot availability. 2. Consider implementing a custom tool that can: - Count existing events in a time range - Check for overlapping events - Enforce your 36-event capacity limit - Validate time slots before booking 3. In your assistant's configuration, ensure you're using the proper sequence: - First check availability - Validate against capacity limits - Only then create the booking If you need to implement this specific capacity limit functionality, you may need to create a custom tool that wraps the Google Calendar API to add this additional validation logic, since the default Google Calendar integration doesn't handle capacity limits directly.
2 Views