Native JSON Output from GPT-4
yonom.substack.com
Native JSON Output from GPT-4
1–10 of 258 posts
Re: Native JSON Output from GPT-4
#2Re: Native JSON Output from GPT-4
#3As this post notes, you don't even need to the full flow of passing a function result back to the model: getting structured data from ChatGPT in itself has a lot of fun and practical use cases. You could coax previous versions of ChatGPT to "output results as JSON" with a system prompt but in practice results are mixed, although even with this finetuned model the docs warn that there still could be parsing errors.
OpenAI's demo for function calling is not a Hello World, to put it mildly: https://github.com/openai/openai-cookbook/blob/main/examples...
Re: Native JSON Output from GPT-4
#4The JSON schema not counting toward token usage is huge, that will really help reduce costs.
Re: Native JSON Output from GPT-4
#5The JSON schema not counting toward token usage is huge, that will really help reduce costs.
At the least for ChatGPT, input token costs were cut by 25% so it evens out.
Re: Native JSON Output from GPT-4
#6I could be confused but I'm interpreting this function calling as "a way to define structured input and selection of function and then structured output" but not the actual ability to send it arbitrary code to execute.
Still amazing, just wanting to see if I'm wrong on this.
Re: Native JSON Output from GPT-4
#7After reading the docs for the new ChatGPT function calling yesterday, it's structured and/or typed data for GPT input or output that's the key feature of these new models. The ReAct flow of tool selection that it provides is secondary. As this post notes, you don't even need to the full flow of passing a function result back to the model: getting structured data from ChatGPT in itself has a lot of fun and practical…
Re: Native JSON Output from GPT-4
#8Re: Native JSON Output from GPT-4
#9Re: Native JSON Output from GPT-4
#10Can I use this to make it reliably output code (say JavaScript)? I haven't managed to do it with just prompt engineering as it will still add explanations, apologies and do other unwanted things like splitting the code into two files as markdown.
https://github.com/williamcotton/transynthetical-engine
The key is the addition of few-shot exemplars.