Add: Responses API Overview notebook -> migrated from deprecated Assistants API#2469
Add: Responses API Overview notebook -> migrated from deprecated Assistants API#2469DhruvTilva wants to merge 4 commits intoopenai:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3b55d5f69
ℹ️ 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".
| " if previous_response_id:\n", | ||
| " kwargs[\"previous_response_id\"] = previous_response_id\n", | ||
| " else:\n", | ||
| " kwargs[\"input\"] = messages\n", |
There was a problem hiding this comment.
Include tool outputs in follow-up response call
When previous_response_id is set, this branch omits input, so the function_call_output items collected in messages are never sent back to the API. In the function-calling path, that means the model never receives tool results for the pending call IDs, so the loop can stall, repeat calls, or error instead of producing a final answer.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks for the review @chatgpt-codex-connector!
- Function calling loop — Fixed.
inputnow always carries the current
turn's content (user message or tool outputs), andprevious_response_id
is set separately to maintain context. Tool results are no longer omitted.
There was a problem hiding this comment.
Note
To use Codex here, create a Codex account and connect to github.
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# Responses API Overview (Python SDK)\n", |
There was a problem hiding this comment.
Register new notebook in registry metadata
This commit adds a new cookbook notebook, but there is no corresponding registry.yaml entry for examples/Responses_API_overview_python.ipynb; only the Assistants overview is currently registered. Without adding the new path/date/tags to registry.yaml, this notebook will not be indexed for publication on cookbook.openai.com.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks for the review @chatgpt-codex-connector!
2. registry.yaml — Added entry for the new notebook with path, date,
authors, tags, title, and description.
There was a problem hiding this comment.
Note
To use Codex here, create a Codex account and connect to github.
Responses API notebook (replaces deprecated Assistants API)
Add Responses API Overview for Python SDK
|
both suggested Codex changes has been done & PR updated ! |
|
Hello @salil-oai @cguo-oai @annikab-oai @aiden-oai @kathylau-oai @minh-hoque @ayushalag-oai @anurag-openai |
Summary
Adds a new notebook
examples/Responses_API_overview_python.ipynbthat coversthe same use cases as
Assistants_API_overview_python.ipynb, fully migratedto the new Responses API.
Root Cause
The existing
Assistants_API_overview_python.ipynbuses deprecatedclient.beta.*endpoints. Every cell generates a
DeprecationWarningand the entire notebookwill stop working on August 26, 2026.
There is currently no Responses API equivalent in the cookbook.
Changes
New file:
examples/Responses_API_overview_python.ipynbclient.beta.assistants.create()instructions=param onresponses.create()client.beta.threads.create()client.conversations.create()client.beta.threads.messages.create()input=param onresponses.create()client.beta.threads.runs.create_and_poll()client.responses.create()runs.submit_tool_outputs()function_call_outputininput=Sections in the new notebook
previous_response_idandConversationobject)##Sample image of notebook

Before vs After