current date time day of the week is referrening 2...
# support
j
I'm using the below prompt to make sure that the agent knows about the current date and time. current date time is (`{{formatDate(now; "YYYY-MM-DD HH:mm:ss"; 23.
Desired Timezone
)}} `) and today is {{formatDate(now; "dddd")}}. Use this as reference when dealing with dates and appointments" Everything works fine except when ai agent has to talk about the day of the week. It is still referencing 2024 calendar. If I ask what day is Jan 7th, it says it is a Sunday (which is true for Jan 7th 2024 but for 2025 its Tue). I've tested with other dates too. Most of the time it is referring to 2024 calendar.. How can this be solved?
This is a transient assistant created via webhook response. Just in case you want to know
v
@jithins It seems like there might be an issue with the dynamic variable that is supposed to fetch the current day of the week. To ensure that the AI agent references the correct year when talking about dates and days of the week, you should make sure that the dynamic variable
now
is always set to the current date and time, including the correct year. If the dynamic variable is not updating correctly, you may need to check the implementation to ensure that it is fetching the current date and time based on the system clock or a reliable time source, rather than using a hardcoded or cached value from a previous year. If you're using a specific service or API for date and time information, you should also verify that it is configured correctly to provide the current year's data. If the issue persists and you're unable to resolve it on your own, please ask support for more info on this. They may need to look into the system or code that generates the dynamic variables to identify and fix the problem.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
j
Any update on this pls?
@Shubham Bajaj
c
This is a dashboard assistant or?
j
transient
c
And your using an automation platform?
j
Yes, this is an inbound transient agent I’m creating from a webhook response via Make
c
You can hop on a like a screen share real quick.
c
You always say it 2 times? (even though that should not give it the error anyway.
j
nah, the second is Day of the week, like Today is Tuesday
c
Interesting. Where do you live?
Timezone?
j
gmt+11
@Shubham Bajaj
s
Hey @jithins To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) This would really help me figure out what went wrong!
j
@User 5e1ce3c8-2b77-485c-8216-3a1b9b841b41 01:53
c
Use the full variable and not just {{now}}
j
what is the full variable?
c
{{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}}
j
thank you. But this is transient, remember?
I'm using the full format in Make
c
It does not matter.
j
What do you mean it doesn't matter? I'm using Make's corresponding full current variable inside my prompt"
c
You can use the variable in your system prompt regardless if transient or not. I don't doubt that you can use it the same way here. VAPI explains this in the docs for variables.
j
Are you able to share a scrennshot of how this can be added into a transient assistant ? @User
c
It is the same as you have above. The current day and time is {{variable}}
j
@Shubham Bajaj Any updates Call ID : 5e1ce3c8-2b77-485c-8216-3a1b9b841b41 Time : 01:53
Updated time to ISO format and model to 4o and it sorted out the issue
t
hi @jithins , actually , im facing same problem like yours can you help me guide it?
Initially it shown 2023 , but i already changeg to gpt 4o, and it shows 2024. What should i do