Ted Slocum

Absurdity, gambling, mindfulness, programming, golf, well-being, and my opinions.

07 Aug 2024

Structured Output

Yesterday, OpenAI released a developer feature called Structured Output that I believe will have a major impact on software development. I want to quickly share my thoughts on how this is a transformative feature… and then go buy some Microsoft stock! But first, here’s a little explainer using a simplified function I developed today. It uses OpenAI’s API to categorize emails.

The Old Way: Unstructured Responses

Before this release, when you called the API, its response was a string of text.

unstructured-output

The New Way: Structured Responses

Now, when you call the API and provide specifications on the desired structure of the output, its response is structured.

structured-output

The Power of Structured Data

The advantage of structured data lies in its usability. You can build upon it in ways that aren’t feasible with unstructured data. Here’s a basic example:

structured-output

Because we can predict the structure of the output, we can reliably extend upon the result.

Looking Ahead

My prediction is that Structured Output will soon be so widely used and relied upon that it won’t even be considered a special feature. We will soon forget that it was the feature that gave developers the tools they needed to build applications with language models deeply embedded in them.

I am definitely going to use this feature in applications I build in the future. And I’m super excited to see what products this enables developers to create!

Read OpenAI’s post introducing this feature here.