On August 6, 2024, OpenAI introduced something new called structured outputs for their API.
Normal software can’t easily take a long piece of text and find specific information in it. For example, let’s say we have a paragraph like this:
“Elena Marquez is a 34-year-old urban planner from San Diego. She grew up appreciating diverse cultures and earned a degree in Environmental Design. Now, she focuses on transforming neglected urban spaces into community hubs.”
If we wanted to use this paragraph to make a profile of Elena Marquez, a normal computer program wouldn’t know which part of the paragraph tells us her name or her age. It doesn’t understand the meaning of the words like we do.
But if the information was put into a format like this, the computer could understand it better:
{ “fullName”: “Elena Marquez”, “age”: 34, “profession”: “Urban Planner”, “location”: “San Diego”, “background”: “Grew up appreciating diverse cultures and earned a degree in Environmental Design.”, “careerFocus”: “Transforms neglected urban spaces into community hubs.” }
In this format, each piece of information has a label. For example, “fullName” is labeled as “Elena Marquez,” and “age” is labeled as 34. Now, the computer can easily pick out Elena’s name, age, job, and other details.
This helps us make a complete profile of Elena that can be stored in a database. We could use that profile to show information about Elena on a website or to find just one part of her profile, like her age or job.
So, structured outputs allow us to take any text and turn it into a format that software can understand and use.
We can also use this idea with conversations. For example, if a person talks to an AI chatbot, we can use structured outputs to take the information from the conversation and put it into a format that can be added to a database automatically.
This is helpful because sometimes we want information to be easy for humans to read (like a paragraph), and other times we want it to be organized so that a software can easily work with it. Structured outputs let us change between these formats so we can use the information in different ways.
Leave a Reply