Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions sdk/guides/gpt5-preset.mdx
Original file line number Diff line number Diff line change
@@ -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.
---

<Note>
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)
</Note>

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.