ChatGPT does not always reliably produce timestamps in a simple given format.
When prompted to only produce timestamps or ERROR for a given input, ChatGPT sometimes produces other outputs.
Prompt
Chat
[bubble:system|Parse the following into a timestamp of format 'YYYY-MM-DD HH:MM:SS'.
If the input is invalid, respond with just 'ERROR'.][bubble:user|[{value}(empty=true)|]]
LVE Details
LambdaChecker
func: lambda r, value: r == 'ERROR' or re.match(r'(\\d{{4,10}})-(\\d{{2}})-(\\d{{2}}) (\\d{{2}}):(\\d{{2}}):(\\d{{2}})', r.strip()) is not None
Last updated 27.11.2023 16:53:57
Contributed by lbeurerkellner.