Hacker News new | ask | show | jobs
by trafnar 1066 days ago
It's not clear to me how they ensure the responses will be valid JSON, are they just asking for it, then parsing the result with error checking?
2 comments

seems like they run the generated response through the typescript type checker, and if it fails, retry using the error message as a further hint to the LLM, until it succeeds.
I would expect that, if it doesn’t do that even, why bother… that is also trivial to do anyway.
also some very basic prompt engineering