share_log

OpenAI Introduces Structured Outputs In The API - Model Outputs Now Reliably Adhere To Developer-Supplied JSON Schemas

OpenAI Introduces Structured Outputs In The API - Model Outputs Now Reliably Adhere To Developer-Supplied JSON Schemas

OpenAI API现在推出了结构化输出功能——模型输出现在可靠地遵循开发人员提供的JSON模式。
Benzinga ·  13:35

Last year at DevDay, we introduced JSON mode—a useful building block for developers looking to build reliable applications with our models. While JSON mode improves model reliability for generating valid JSON outputs, it does not guarantee that the model's response will conform to a particular schema. Today we're introducing Structured Outputs in the API, a new feature designed to ensure model-generated outputs will exactly match JSON Schemas provided by developers.

去年的DevDay上,我们介绍了JSON模式,这是一个有用的构建块,开发人员可以使用它来构建可靠的应用程序。JSON模式可以提高模型生成有效JSON输出的可靠性,但并不保证模型的响应符合特定的模式。今天,我们在API中引入了结构化输出,这是一个新功能,旨在确保模型生成的输出将完全符合开发人员提供的JSON模式。

Generating structured data from unstructured inputs is one of the core use cases for AI in today's applications. Developers use the OpenAI API to build powerful assistants that have the ability to fetch data and answer questions via function calling(opens in a new window), extract structured data for data entry, and build multi-step agentic workflows that allow LLMs to take actions. Developers have long been working around the limitations of LLMs in this area via open source tooling, prompting, and retrying requests repeatedly to ensure that model outputs match the formats needed to interoperate with their systems. Structured Outputs solves this problem by constraining OpenAI models to match developer-supplied schemas and by training our models to better understand complicated schemas.

从非结构化输入中生成结构化数据是当今应用程序中AI的核心用例之一。开发者使用OpenAI API构建功能强大的助手,有能力通过函数调用获取数据和回答问题,为数据输入提取结构化数据,并构建多步代理工作流,让LLMs执行操作。开发人员长期以来一直在用开源工具来解决LLMs在这一领域的限制,通过提示和重试请求多次,确保模型输出与其系统互用所需的格式相匹配。结构化输出通过限制OpenAI模型以匹配开发人员提供的模式,并训练我们的模型更好地理解复杂的模式来解决这个问题。

On our evals of complex JSON schema following, our new model gpt-4o-2024-08-06 with Structured Outputs scores a perfect 100%. In comparison, gpt-4-0613 scores less than 40%.

在我们针对复杂JSON模式的评估中,我们的新模型gpt-4o-2024-08-06与结构化输出得分完美的100%。相比之下,gpt-4-0613的得分不到40%。

声明:本内容仅用作提供资讯及教育之目的,不构成对任何特定投资或投资策略的推荐或认可。 更多信息
    抢沙发