Add example and docs for reasoning-message pairing constraint (#1791)#1808
Add example and docs for reasoning-message pairing constraint (#1791)#1808iammannu wants to merge 1 commit intoopenai:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab8a7306c6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| input: 'Are semicolons optional in JavaScript?', | ||
| }); | ||
|
|
||
| ### Multi-turn conversations and reasoning items |
There was a problem hiding this comment.
Close the TypeScript code block before new README section
The ### Multi-turn conversations and reasoning items heading is currently inside the preceding ```ts block, so Markdown renders the new guidance as code and makes the example snippet invalid when copied. This defeats the purpose of the documentation update because users won’t see it as prose and may paste broken sample code; insert a closing code fence before this heading.
Useful? React with 👍 / 👎.
|
Opened PR with docs + example for this: #1808 |
Fixes #1791
This PR adds guidance and an example for handling reasoning-message pairing
in multi-turn conversations using the Responses API.
Problem:
The API requires reasoning and message items to be passed as consecutive pairs,
but this is not clearly documented. A common pattern of filtering response.output
to only include messages leads to orphan messages and 400 errors.
Solution:
This improves developer experience and helps prevent common multi-turn failures.