TypeChat icon indicating copy to clipboard operation
TypeChat copied to clipboard

How does typechat output time for searching

Open mengbo-ji opened this issue 2 years ago • 2 comments
trafficstars

The model I use is gpt-3.5-turbo. I asked him to return the data of the last seven days. I used it for searching. I expected him to return my current time, but what he gave me seemed to be in 2021. This is my low Problem with version model ?

GPT-Response: image

image

Schema.ts image

mengbo-ji avatar Aug 08 '23 02:08 mengbo-ji

I haven't tried this, but instead of using number and constructing it with new Date(), I would make it a date string that can be parsed out by Date.parse(). Try adding a comment like

/** A date string of the format YYYY-MM-DDTHH:mm:ss.sssZ */
time: string;

Instead of Z, you can select a specific timezone offset like +08:00.

DanielRosenwasser avatar Aug 08 '23 21:08 DanielRosenwasser

@mengbo-ji you need to tell the model what the current date is as it's stuck in 2021... An easy way to do that is to simply add it to the message text using something like this ${message}\n\ncontext:\ntoday is ${new Date()}. You can append as many context variables as you'd like.

Stevenic avatar Aug 09 '23 19:08 Stevenic