openai-agents-python/examples/classic/tools
Mark Stuart ba3fbbf400
docs: organize SDK guides around developer tasks (#5920)
* docs: organize SDK guides and clarify examples

* fix: correct native SDK type declarations

* test: update native SDK contract fixtures

* fix: normalize persisted agent profile transport settings

* test: reconcile inherited model settings API snapshot

* test: preserve executor coverage on Windows

---------

Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
2026-11-12 21:00:58 -08:00
..
skills/csv-workbench chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
apply_patch.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
code_interpreter.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
codex.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
codex_same_thread.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
computer_use.py docs: organize SDK guides around developer tasks (#5920) 2026-11-12 21:00:58 -08:00
container_shell_inline_skill.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
container_shell_skill_reference.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
file_search.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
image_generator.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
local_shell_skill.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
programmatic_tool_calling.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
README.md docs: organize SDK guides around developer tasks (#5920) 2026-11-12 21:00:58 -08:00
shell.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
shell_human_in_the_loop.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
tool_search.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
web_search.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
web_search_filters.py chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00

Classic tool examples

These scripts demonstrate hosted tools, application-owned tool execution, and the experimental Codex CLI wrapper. Complete Classic example setup, configure OPENAI_API_KEY, and run a module from the repository root:

python -m examples.classic.tools.web_search
Task Examples Additional setup or effects
Search the web web_search.py, web_search_filters.py Web-search access.
Index and search a file file_search.py The script creates a temporary uploaded file and vector store, then attempts cleanup.
Run hosted code code_interpreter.py Hosted Code Interpreter access.
Generate an image image_generator.py Image-generation access.
Run hosted shell commands with an inline skill container_shell_inline_skill.py Hosted shell access; bundled skills/csv-workbench/ files.
Run hosted shell commands with a saved skill container_shell_skill_reference.py Hosted shell access and a skill owned by your project. Set OPENAI_SHELL_SKILL_ID and, optionally, OPENAI_SHELL_SKILL_VERSION; the embedded default ID does not grant project access.
Execute local shell commands shell.py, shell_human_in_the_loop.py, local_shell_skill.py Trusted local execution or external isolation. The approval variant requests a decision before execution.
Apply a patch apply_patch.py A temporary workspace created by the script.
Drive a browser computer_use.py Playwright and Chromium, as shown below.
Call the standalone Codex CLI codex.py, codex_same_thread.py A separately installed and configured Codex CLI; see Classic Codex integration.
Search and call tools dynamically tool_search.py, programmatic_tool_calling.py Access to the configured model and hosted capabilities.

Browser setup

The computer-use example imports Playwright, which the Classic extra does not install. From an activated SDK environment:

python -m pip install playwright
python -m playwright install chromium
python -m examples.classic.tools.computer_use

By default, the example uses a local demo page and a headless Chromium browser. COMPUTER_USE_HEADLESS=0 selects a visible browser. COMPUTER_USE_START_URL overrides the starting page.

The hosted examples make paid API calls. The local shell examples run with host process permissions; a tool declaration alone does not provide OS isolation.