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%。

声明:本內容僅用作提供資訊及教育之目的,不構成對任何特定投資或投資策略的推薦或認可。 更多信息
    搶先評論