3 ms·
We first built Magic Loops with GPT-4, about a year ago, well before JSON mode was a thing. We had to a do a bunch of extra prompting to make it work, as GPT w
by jumploops 2y ago
We first built Magic Loops with GPT-4, about a year ago, well before JSON mode was a thing.
We had to a do a bunch of extra prompting to make it work, as GPT would often include backticks or broken JSON (most commonly extra commas). At the time, YAML was a much better approach.
Thankfully we've been able to remove most of these hacks, but we still use a best effort JSON parser[0] to help stream partial UI back to the client.
[0]https://www.npmjs.com/package/best-effort-json-parser https://www.npmjs.com/package/best-effort-json-parser