TypeChat icon indicating copy to clipboard operation
TypeChat copied to clipboard

Date type works but returns validate error

Open rgstephens opened this issue 2 years ago • 2 comments

With this interface

export interface DateTime {
    type: 'dateTime',
    dateTime?: Date;
};

The json results look good but validate fails:

JSON validation failed: Cannot find name 'Date'.
{
  "entities": [
    {
      "type": "dateTime",
      "dateTime": "2022-08-20T08:30:00.000Z"
    }
  ]
}

rgstephens avatar Aug 20 '23 04:08 rgstephens

Hi I had the same issue, try changing dateTime to a string.

SimonSchroffner avatar Aug 30 '23 08:08 SimonSchroffner

At the moment, this is not possible since the output of the LLM is a JSON string, and there are no hooks to control the parsing of that json. I suspect that we might ended up having some sort of macro system that might allow you to translate the json into the actual plan (sequence of actions).

Another challenge here is the fact that TypeChat lib for standard types is very very limited because on the current form, it doesn't need anything else. The good news is that such part is just needed for validation, which does not need to ever go into the LLM prompt context, which makes it easier to perhaps change this to support macros and supporting expansion of the actions.

caridy avatar Sep 14 '23 23:09 caridy