Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: OpenAI Structured Output response_format ADR #8656

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Sep 10, 2024

Motivation and Context

This PR introduces the design for supporting OpenAI's Structured Outputs response_format within the Semantic Kernel Python SDK. While OpenAI’s previous JSON mode improved model reliability, it still lacked strict schema adherence, which led to inefficiencies and the need for custom workarounds.

By integrating Structured Outputs, this ADR outlines a design that ensures generated AI outputs will conform to predefined JSON schemas, improving consistency, reducing errors, and eliminating the need for retries or custom tools. This design will provide a more streamlined and reliable approach for developers building schema-compliant AI-driven applications.

In the future we will have a separate ADR around OpenAI's structured outputs for function calling. That is out of scope for this ADR.

Contribution Checklist

@moonbox3 moonbox3 changed the title Python: OpenAI Structured Output ADR Python: OpenAI Structured Output response_format ADR Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants