https://retellai.com/?utm_source=discord&utm_medium=seo logo
Function to get date without having to use Cal.com...
# ❓・bug-report
t
Hi, I'm creating a Voice Agent that reminds a user about his/her outstanding invoice. the user can also ask the AI agent to But, I'm having trouble when the user speaks something like "Please remind me again on Friday two weeks from now". I hope the AI can extract what date is "Friday two weeks from now" What's the best approach for this? Using ChatGPT, it seems like they use Code Interpreter to evaluate the date, but I don't see code interpreter tool in Retell functions. Currently we're using the built-in Retell Cal.com only to parse date, but tbh what we want to achieve has nothing to do with booking on Cal.com so it seems a bit too much. Any thoughts?
r
Is this what you're looking for?
t
@rish404 Sometimes the LLM gives wrong answer on my end
so I think it needs to do a code-interpreter-like approach (just like ChatGPT) to make sure it's correct all the time
t
We are using a Lambda function to solve this problem. We are calling it at the start of the call to get the current date time in EST
n
You can also use dynamic variables to populate current date if you're using the API
h
Hello @NJ Seems like passing the current date as a dynamic variable doesnt solve this problem. For example, In my prompt 1. Ask user for the exact date of the accident by saying ... - If the accident date is more than 730 days ago from {{today_date}}, immediately transition to ... (tried with 2 years as well, instead of days, but all same result). I have tried setting today_date in various formats - 24/11/2024, November 26, 2024.. On this call for example (call_77ef3a67d7c747df2e87cc7ba42), i responded with '05/07/2022' as the date, but it did not make the transition. Could this be a prompt issue? Having a function call for checking if a date is 2 years ago just seems redundant, and introduces an unnecessary latency at a cruicial point in our calls.