4 ms·
OpenAI has this capability built in with functions[0], I believe! Building my own project[1] I have implemented functions in combination with guidance[2] and ha
by Ilasky 3y ago
OpenAI has this capability built in with functions[0], I believe! Building my own project[1] I have implemented functions in combination with guidance[2] and haven’t had a hiccup yet! I have a JSON parser function there, just in case, but it seems to be working reliably.
Here’s a bit more of a description of using the functions API for JSON returns: https://yonom.substack.com/p/native-json-output-from-gpt-4 https://yonom.substack.com/p/native-json-output-from-gpt-4
[0] https://openai.com/blog/function-calling-and-other-api-updates https://openai.com/blog/function-calling-and-other-api-updat...
[1] https://resgen.app https://resgen.app
[2] https://github.com/guidance-ai/guidance https://github.com/guidance-ai/guidance
- londons_explore 3y ago>OpenAI has this capability built in with functions From OpenAI's docs: > note: the model may generate invalid JSON I would guess they don't use your method - and perhaps they should!
- Ilasky 3y agoGood catch! It really is a combination of guidance guaranteeing JSON output and OpenAI getting it right a good majority of the time[0]. But yeah, I can see how it can be frustrating that the JSON output is not guaranteed by the docs. [0] >>99% in my experience
- Ilasky 3y agoThat said, I am definitely going to look into this library and compare its results to guidance, since they claim it blows it out of the water (which is very enticing!)
- remilouf 3y agoFigure 2 in our paper (https://arxiv.org/abs/2307.09702 https://arxiv.org/abs/2307.09702) shows the difference for a single regex.
- thomasfromcdnjs 3y agoI do the same, just tell Openai to call a parser at the end and wahal.