all AI news
How to Make OpenAI API to Return JSON
During OpenAI's dev day, one of the major announcements was the ability to receive a JSON from the chat completion API. However, there aren't a few clear examples of how to do this as most examples focus on function calls.
Our objective is straightforward: given a query, we want to receive an answer in JSON format.
How can we achieve this?
There are three crucial steps.
Modify your prompt
Your prompt must explicitly specify that the response should be in …