News for hackers. Stuff that matters.
Re:Show HN: LLMs can generate valid JSON 100% of the time by gyy52380 on Monday August 14, 2023 @07:02PM (#37127915)
You can determine which brackets you need in which order by parsing the incomplete json which was generated so far.
Re:Show HN: LLMs can generate valid JSON 100% of the time by dontreact on Monday August 14, 2023 @07:44PM (#37128278)
That won't do it, also need to close other stuf

{"this": "is valid json so farrrrrrrrrrrrrr

But yeah the general idea makes sense. Once you hit a timeout, change the mask to things that will close existing open things in a valid manner (}, ), ], ")