News for hackers. Stuff that matters.
Re:Native JSON Output from GPT-4 by bradly on Wednesday June 14, 2023 @07:35PM (#36334378)
Yep. I even gave it a JSON schema file to use. It just wouldn't stop added extra verbage.
Re:Native JSON Output from GPT-4 by NicoJuicy on Wednesday June 14, 2023 @07:49PM (#36334514)
Say it's a json API and may only reply with valid json without explanation.
Re:Native JSON Output from GPT-4 by bradly on Wednesday June 14, 2023 @08:24PM (#36334818)
Lol yes of course I tried that.
Re:Native JSON Output from GPT-4 by dror on Wednesday June 14, 2023 @08:47PM (#36334981)
I've had good luck with both:

https://github.com/drorm/gish/blob/main/tasks/coding.txt

and

https://github.com/drorm/gish/blob/main/tasks/webapp.txt

With the second one, I reliably generated half a dozen apps with one command.

Not to say that it won't fail sometimes.

Re:Native JSON Output from GPT-4 by NicoJuicy on Thursday June 15, 2023 @05:35PM (#36346844)
Combine both ? :)
Re:Native JSON Output from GPT-4 by taylorfinley on Wednesday June 14, 2023 @08:02PM (#36334640)
I just use a regex to select everything between the first and last curly bracket, reliable fixes the “sure, here’s your object” problem.