How to make bot aware of the time?
# support
y
Bot needs to consider the time to follow correct flow (Business hours VS After hours) I already added these dynamic values to my bot and added business hours checking to the prompt. However, it's still not aware of the time no matter what I do. - Current date: {{ "now" | date: "%B %d, %Y", "Australia/Brisbane"}} - Current time: {{ "now" | date: "%I:%M %p", "Australia/Brisbane"}} - Day of week: {{ "now" | date: "%A", "Australia/Brisbane"}} - Timestamp: {{ "now" | date: "%s" | times: 1000 }} I don't want to use a custom tool just to check the time, as it causes more latency. What am I doing wrong?
v
Try placing your dynamic time variables directly in your system prompt and give the AI explicit routing instructions. For example:
Copy code
You are a customer service assistant.
Current time: {{ "now" | date: "%I:%M %p", "Australia/Brisbane"}}
Day: {{ "now" | date: "%A", "Australia/Brisbane"}}
IMPORTANT: If it's Mon-Fri 9AM-5PM, route to live agent. Otherwise, offer after-hours options.
This ensures the AI "sees" the current time and knows how to act on it, without needing a custom tool. (Reference: information found in the Variables documentation) Source: - [Variables documentation](https://docs.vapi.ai/assistants/dynamic-variables)
r
Hi have the same issue even after using your variable the ai chat bot gets the time wrong
c
Hi Yssa Mae Amper, If you need assistance with setting up or using the Vapi AI chat or voice capabilities, you can check out the relevant documentation links for a detailed guide: - For building a customer service chatbot using Vapi, refer to the [Chat quickstart guide](https://docs.vapi.ai/chat/quickstart). - To handle voice interaction setup with OpenAI's realtime models, explore the [OpenAI Realtime guide](https://docs.vapi.ai/openai-realtime). If you have more specific queries or issues, feel free to share, and I would be happy to help.
4 Views