helpful-purple•3mo 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"}}
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"}}

4 Replies
helpful-purpleOP•3mo ago
bumping this ^
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.
helpful-purpleOP•3mo 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?
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: