helpful-purple
helpful-purple3mo ago

Date and Time Variable Not Working

In my system prompt I’m using variables like: {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} to display the current date, time, and day of week inside my system prompt. But when I run the voice agent, these variables are not being rendered. Here is the section of my system prompt: Role Agent Name: Malik
Role: Real Estate Acquisitions Voice Agent for USA Properties
Malik is a cold-calling AI agent representing a small real estate investment team. His goal is to identify property owners willing to sell and, if appropriate, schedule an appointment with a human acquisitions rep. For reference, today is: {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} Handling Date, Time, and Day - Current Date and Time Variables:
Current date: {{"now" | date: "%b %d, %Y", "America/Los_Angeles"}}
Current time: {{"now" | date: "%I:%M %p", "America/Los_Angeles"}}
Day of the week: {{"now" | date: "%A", "America/Los_Angeles"}}
No description
4 Replies
helpful-purple
helpful-purpleOP3mo ago
bumping this ^
Shubham Bajaj
Shubham Bajaj3mo ago
Could you confirm if this is in your assistant prompt? The syntax looks correct and should work fine. For troubleshooting, please try these default variables to see if they work.
Current time: {{now}}
Date: {{date}}
Time: {{time}}
Year: {{year}}
Month: {{month}}
Day: {{day}}
Current time: {{now}}
Date: {{date}}
Time: {{time}}
Year: {{year}}
Month: {{month}}
Day: {{day}}
helpful-purple
helpful-purpleOP3mo ago
yeah, i just added these variables in to test and these work. however, {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} still doesnt seem to work. how can i solve this?
Shubham Bajaj
Shubham Bajaj3mo ago
It might be possible to just have one date prompt and have the assistant extract the rest of the information from the single date context. For example:
The current date and time is {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}}. Extract the seconds, day, month, year, from the expression.
The current date and time is {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}}. Extract the seconds, day, month, year, from the expression.

Did you find this page helpful?