Today’s date is: 2023-05-02
Here’s a JSON summary of the previous resident order:
{
"preferences": [
{
"preference": "Full Kitchen",
"count": 2,
"start_date": "2021-10-20",
"end_date": "2021-10-21"
}
],
"service_type": "Dine In"
}
this is service based conversation, where user was asked to give date to avail that service,
user : today and tomorrow
for the user's response while generating json, it is not correct, it should display todays date and tomorrows right. can anyone help me to resolve this.
Have you included today’s date in the system message?
Something like:
{
'role':'system',
'content':"""You are friendly chatbot. Today's date is 2023/05/02 (yyyy/mm/dd)."""
}
No, I have not added date like you mentioned above in content.
If I mention like above it won’t be dynamic right, for each day I need to update the date.
let us consider the input form customer is like this,
customer : “delivery of this product can be between day after tomorrow and next four days.”
then bot should know that the starting date is 5/5/2023 to 9/5/2023. This is what I am actually expecting.
bot is now giving wrong year month and date.
like this (just an example)
“start_date”: “2021-10-20”,
“end_date”: “2021-10-24”
Thanks for your time, please help me to resolve.
Of course, you are in a Python context. You can obtain the date dynamically:
from datetime import datetime
date=datetime.today().strftime('%Y/%m/%d')
messages = []
messages.append({
'role':'system',
'content':f"You are friendly chatbot. Today's date is {date} (yyyy/mm/dd)."
})
print(messages)
thanks for reminder, this works thank you.