https://retellai.com/?utm_source=discord&utm_medium=seo logo
can AI prompt have different options to mention ba...
# ❓・ai-evy-support
j
@AI Evy can AI prompt have different options to mention based on time. Such as offer after hours options only after hours
a
Thanks for tagging me @Joey. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] 5 Useful Prompts for AI Agent Builders | Retell AI](https://www.retellai.com/blog/5-useful-prompts-for-building-ai-voice-agents-on-retell-ai) [[2] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) [[3] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[4] AI for After-Hours Call Answering Services | Retell AI](https://www.retellai.com/blog/transforming-after-hours-call-answering-services-with-ai-phone-agents) ​
The dynamic variables approach combined with conditional prompting or a custom function gives you flexibility to offer different options based on time of day. [(4) ]() , [(1) ]()
### Answer Yes, you can achieve time-based behavior in your AI agent. Here are two approaches: 1. Use Dynamic Variables You can pass the current time as a dynamic variable when initiating the call, then reference it in your prompt with conditional logic. [(1) ]() For example, in your prompt:
Copy code
If {{current_time}} is after 5pm or before 9am:
- Inform the caller that the office is closed
- Offer to take a message or schedule a callback

If {{current_time}} is between 9am and 5pm:
- Proceed with normal business hours options
[(2) ]() 2. Use a Custom Function Create a custom function that checks the current time on your server and returns whether it's business hours or after hours. The agent can then adjust its behavior based on the response. [(3) ]() This approach is useful because you can: - Dynamically determine time zone - Account for holidays - Return specific after-hours options from your backend 3. Write Task as Steps with Conditional Logic You can structure your prompt with conditional steps: [(2) ]()
Copy code
## Task
1. Check if it is after business hours using the check_business_hours function
   - if after hours, inform caller of business hours and offer voicemail or callback scheduling
   - if during business hours, proceed with standard greeting
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy so I can say. If current time is after 5 please mention after hours options if before 5 do not mention or transfer
a
Thanks for the follow-up, @Joey. I'll get back to you soon.
### Answer Yes, you can use the system default variable
{{current_time}}
directly in your prompt to create time-based conditional logic. [(1) ]() Retell automatically provides
{{current_time}}
which returns the current time in
America/Los_Angeles
format (e.g., "Thursday, March 28, 2024 at 11:46:04 PM PST") . You can also use
{{current_time_[timezone]}}
for a specific timezone, like
{{current_time_America/New_York}}
. In your prompt, you could write something like:
Copy code
If {{current_time}} indicates it is after 5:00 PM or before 9:00 AM:
- Mention after-hours options
- Do not offer to transfer

If {{current_time}} indicates it is between 9:00 AM and 5:00 PM:
- Proceed with normal options
- Transfer calls as needed
The LLM will interpret the time value and follow your conditional instructions accordingly.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.