Skip to content

Add: Responses API Overview notebook -> migrated from deprecated Assistants API#2469

Open
DhruvTilva wants to merge 4 commits intoopenai:mainfrom
DhruvTilva:add-responses-api-notebook
Open

Add: Responses API Overview notebook -> migrated from deprecated Assistants API#2469
DhruvTilva wants to merge 4 commits intoopenai:mainfrom
DhruvTilva:add-responses-api-notebook

Conversation

@DhruvTilva
Copy link

Summary

Adds a new notebook examples/Responses_API_overview_python.ipynb that covers
the same use cases as Assistants_API_overview_python.ipynb, fully migrated
to the new Responses API.

Root Cause

The existing Assistants_API_overview_python.ipynb uses deprecated client.beta.*
endpoints. Every cell generates a DeprecationWarning and the entire notebook
will stop working on August 26, 2026.

There is currently no Responses API equivalent in the cookbook.

Changes

New file: examples/Responses_API_overview_python.ipynb

Assistants API (deprecated) Responses API (new)
client.beta.assistants.create() instructions= param on responses.create()
client.beta.threads.create() client.conversations.create()
client.beta.threads.messages.create() input= param on responses.create()
client.beta.threads.runs.create_and_poll() client.responses.create()
runs.submit_tool_outputs() Pass function_call_output in input=

Sections in the new notebook

  1. Setup
  2. Basic text conversation
  3. Multi-turn conversation (previous_response_id and Conversation object)
  4. Built-in tools: Code Interpreter
  5. Built-in tools: File Search
  6. Function calling (full agentic loop)
  7. Streaming
  8. Cleanup + summary table

##Sample image of notebook
image

Before vs After

Assistants API Responses API
Objects to manage Assistant + Thread + Run Just a Response
Polling loop needed Yes No
Deprecation warnings ⚠️ Yes (every cell) ✅ None
Works after Aug 2026 ❌ No ✅ Yes

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +366 to +369
" if previous_response_id:\n",
" kwargs[\"previous_response_id\"] = previous_response_id\n",
" else:\n",
" kwargs[\"input\"] = messages\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @chatgpt-codex-connector!

  1. Function calling loop — Fixed. input now always carries the current
    turn's content (user message or tool outputs), and previous_response_id
    is set separately to maintain context. Tool results are no longer omitted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"cell_type": "markdown",
"metadata": {},
"source": [
"# Responses API Overview (Python SDK)\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @chatgpt-codex-connector!
2. registry.yaml — Added entry for the new notebook with path, date,
authors, tags, title, and description.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DhruvTilva
Copy link
Author

both suggested Codex changes has been done & PR updated !

@DhruvTilva
Copy link
Author

DhruvTilva commented Mar 1, 2026

Hello @salil-oai @cguo-oai @annikab-oai @aiden-oai @kathylau-oai @minh-hoque @ayushalag-oai @anurag-openai
This PR migrates the outdated Assistants API Overview notebook to the current Responses API Overview (Python) so the content stays functional and up-to-date. It fixes deprecation issues and keeps the cookbook aligned with the latest API standards.
could you please take a quick look when available? Happy to address comments!
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant