get_gpt5_agent(llm) creates an agent that uses ApplyPatchTool instead of the standard FileEditorTool, while leaving the default preset unchanged for everything else.
Ready-to-run Example
This example is available on GitHub: examples/04_llm_specific_tools/01_gpt5_apply_patch_preset.py
examples/04_llm_specific_tools/01_gpt5_apply_patch_preset.py
The model name should follow the LiteLLM convention:
provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.What this preset changes
- Replaces the standard
FileEditorToolwithApplyPatchTool - Keeps the GPT-5-specific configuration explicit via
get_gpt5_agent(llm) - Leaves the default preset unchanged unless you opt into this one
See Also
- LLM Reasoning - Learn more about newer OpenAI model behavior and the Responses API
- LLM Subscriptions - Use supported OpenAI subscription-backed models without API credits
- Custom Tools - Understand the standard SDK tool system and presets

