Add Responses API structured outputs, function calling, and Conversations API#203
Open
naga-k wants to merge 1 commit intoandrewyng:mainfrom
Open
Add Responses API structured outputs, function calling, and Conversations API#203naga-k wants to merge 1 commit intoandrewyng:mainfrom
naga-k wants to merge 1 commit intoandrewyng:mainfrom
Conversation
…ions API to OpenAI docs - Python, JavaScript, Go: added responses.parse() with structured outputs as primary method - Python, JavaScript, Go: added Responses API function calling as primary method - Python, JavaScript, Go: added Conversations API section - package/python: fixed incorrect claim that structured outputs only work with Chat Completions - Python, JavaScript: moved legacy Chat Completions examples and additional APIs to references/ files to stay under 500-line guideline - All existing Chat Completions examples preserved as "Legacy" with links to reference files - Verified Python and JS examples against official OpenAI SDK docs - Verified Go examples against openai-go v3 SDK via Codex review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OpenAI docs currently only show Chat Completions for structured outputs and function calling, despite recommending the Responses API as primary. This PR adds the missing Responses API equivalents and the Conversations API across Python, JavaScript, and Go.
Note on diff size: The large number of additions/deletions is mostly from moving legacy Chat Completions examples and additional API sections (audio, files, embeddings, etc.) out of the main DOC.md files into
references/additional-apis.mdfiles to comply with the 500-line guideline. The actual new content added is the Responses API structured outputs, function calling, and Conversations API sections.Changes
New content added (all three languages — Python, JS, Go):
responses.parse()/responses.create()as primary method for structured outputsRefactored (Python & JavaScript):
references/additional-apis.mdreferences/additional-apis.mdFix (package/python):
responses.parse()withtext_formatexists nowExisting content preserved:
Verification
openai-gov3 SDKchub build content/ --validate-onlyRelated
openai/chatsince it now covers the full API (Responses, Conversations, etc.), not just Chat Completions