From c397f18b20b0ab83911236d1e3d2990059816e54 Mon Sep 17 00:00:00 2001 From: enyst Date: Sat, 20 Dec 2025 04:47:10 +0000 Subject: [PATCH] docs(sdk): add GPT-5 preset example page linking to code - Mirrors Gemini preset style (opt-in, expandable snippet) - Links to examples/01_standalone_sdk/35_gpt5_apply_patch_preset.py Co-authored-by: openhands --- sdk/guides/gpt5-preset.mdx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sdk/guides/gpt5-preset.mdx diff --git a/sdk/guides/gpt5-preset.mdx b/sdk/guides/gpt5-preset.mdx new file mode 100644 index 00000000..0a933737 --- /dev/null +++ b/sdk/guides/gpt5-preset.mdx @@ -0,0 +1,35 @@ +--- +title: GPT-5 Preset (ApplyPatchTool) +description: Use the GPT-5 preset to enable ApplyPatchTool-based file editing as an opt-in alternative, mirroring the Gemini preset approach. +--- + + +This example is available on GitHub: [examples/01_standalone_sdk/35_gpt5_apply_patch_preset.py](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/35_gpt5_apply_patch_preset.py) + + +The GPT-5 preset provides an optional tool bundle that replaces the standard claude-style FileEditorTool with ApplyPatchTool, following the same pattern as the Gemini preset. This allows you to explicitly opt into ApplyPatch-based editing without changing any global defaults. + +```python icon="python" expandable examples/01_standalone_sdk/35_gpt5_apply_patch_preset.py +# See linked file for the full example. +``` + +## Running the Example + +```bash +export OPENAI_API_KEY="your-api-key" # or set LLM_API_KEY +# Optionally select a model, e.g. a mini variant if available +# export LLM_MODEL="openai/gpt-5.2-mini" # fallback: openai/gpt-5.1-mini or openai/gpt-5.1 +cd agent-sdk +uv run python examples/01_standalone_sdk/35_gpt5_apply_patch_preset.py +``` + +## Why this preset? + +- Mirrors the Gemini preset approach (opt-in, not default) +- Uses ApplyPatchTool for unified, patch-based edits preferred for GPT-5 +- Works with existing SDK agent flow (get_gpt5_agent) + +## Related + +- **Gemini preset** approach is documented in its PR; you can adopt it similarly by calling `get_gemini_agent`. +- **Default preset**: unchanged; continues to use FileEditorTool unless you opt into this preset.