Call Function for time is not accurate

Title: Call Function for Checking Availability

Description: This feature allows customers to provide one or more time slots, enabling customer service representatives to check if they are available during those periods.

Request Parameter: “req_time”

Type: string
Description: Provide the complete time in the format “YYYY-MM-DD HH:mm”, for example: “2023-7-18 9:20, 2023-7-20 14:20, 2023-7-22 14:20”.
Issue:

Despite providing the current time as a reference using the {“role”: “system”, “content”: [current time]}, the system sometimes calculates the dates incorrectly. For instance, input like “next Sunday” or “next week Friday” and counting from now “2023/7/20” leads to erroneous calculations, such as resulting in “2023-7-31” instead of the expected “2023-7-24”.

have any solution can make sure the req_time is correct?

You have an interesting problem, one which we’d think would seem super-simple for a computer to perform, but it turns out since the AI is a language processor, it doesn’t really do a good at what to it are hard logic puzzles.

Time is also an interesting case to ponder - you keep on putting the current time into the system prompt, but then what follows that can be references to an earlier time when the user has asked “what time is it”. Pretty confusing for an AI, right? A “Session start time” that doesn’t change may what you want to infuse.

I think I would first establish a global knowledge of dates. Reference an earlier post of mine on similar topic:

Having that, you can clean the multiple examples of time from your function that are ripe for confusion, and just concentrate on specifying where the date should come from that it will put in the function, and its use.

And then comes the logic: "Do you have any appointments available two weeks from now? It has to have a calendar, understand the starting and ending days of the week, be able to calculate date ranges, etc – all from prediction of the most likely word that should be output.

Priming it with features it is lacking in mental abilities, a “print_calendar” function, a “days_between_dates” calculator, etc can both enhance and confuse the AI.

1 Like

Allow ChatGPT to send a human-readable absolute or relative date/time specification, so it does not have to do any math.

Use the dateparser package on your backend to parse the input.

Change the field description to: “Absolute or relative date-time in a format parseable by the Python dateparser package: dateparser.parse(...)

ChatGPT already knows about this old Python package, so it will know the format from just referring to it. You may be able to make the description even shorter.

Let me know whether it worked out.

I was facing similar issue. I did a work around providing the current day using the message with system role saying "… and currrent date is 01 August, 2023.
My understanding is that the engine was halluciating about current day to calculate next Friday.