News for hackers. Stuff that matters.
Re:Native JSON Output from GPT-4 by jacobsimon on Wednesday June 14, 2023 @10:43PM (#36335821)
Coincidentally, I just published this JS library[1] over the weekend that helps prompt LLMs to return typed JSON data and validates it for you. Would love feedback on it if this is something people here are interested in. Haven’t played around with the new API yet but I think this is super exciting stuff!

[1] https://github.com/jacobsimon/prompting

Re:Native JSON Output from GPT-4 by golergka on Thursday June 15, 2023 @07:43AM (#36339064)
Looks promising! Do you do retries when returned json is invalid? Personally, I used io-ts for parsing, and GPT seems to be able to correct itself easily when confronted with a well-formed error message.
Re:Native JSON Output from GPT-4 by jacobsimon on Thursday June 15, 2023 @09:05AM (#36339879)
Great idea, I was going to add basic retries but didn’t think to include the error.

Any other features you’d expect in a prompt builder like this? I’m tempted to add lots of other utility methods like classify(), summarize(), language(), etc