Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not for even the simplest schemas.

Eg, given even the type:

    {"aLongerKey": "value"}
The generation prefix:

    {"a
would by your algorithm produce the following invalid output:

    {"a}


That's why I mentioned you check the JSON validity first. You'd obviously need to continue letting it generate tokens until you can parse the JSON to check if the type is partial. You could of course close even the quotes but then you'd get "not valid" signals from TS when the AI is like "just let me finish!" :-)


But that isn’t valid JSON


Right, it would fail even before hitting the typing check.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: