Skip to content

Commit 8d1094d

Browse files
authored
docs: refresh docs and examples to gpt-5.4 (#2615)
1 parent bd5a9a9 commit 8d1094d

24 files changed

Lines changed: 48 additions & 48 deletions

docs/agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ By using the `clone()` method on an agent, you can duplicate an Agent, and optio
293293
pirate_agent = Agent(
294294
name="Pirate",
295295
instructions="Write like a pirate",
296-
model="gpt-5.2",
296+
model="gpt-5.4",
297297
)
298298

299299
robot_agent = pirate_agent.clone(

docs/models/index.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ Use this page in the following order depending on your setup:
1919

2020
## OpenAI models
2121

22-
When you don't specify a model when initializing an `Agent`, the default model will be used. The default is currently [`gpt-4.1`](https://platform.openai.com/docs/models/gpt-4.1) for compatibility and low latency. If you have access, we recommend setting your agents to [`gpt-5.2`](https://platform.openai.com/docs/models/gpt-5.2) for higher quality while keeping explicit `model_settings`.
22+
When you don't specify a model when initializing an `Agent`, the default model will be used. The default is currently [`gpt-4.1`](https://developers.openai.com/api/docs/models/gpt-4.1) for compatibility and low latency. If you have access, we recommend setting your agents to [`gpt-5.4`](https://developers.openai.com/api/docs/models/gpt-5.4) for higher quality while keeping explicit `model_settings`.
2323

24-
If you want to switch to other models like [`gpt-5.2`](https://platform.openai.com/docs/models/gpt-5.2), there are two ways to configure your agents.
24+
If you want to switch to other models like [`gpt-5.4`](https://developers.openai.com/api/docs/models/gpt-5.4), there are two ways to configure your agents.
2525

2626
### Default model
2727

2828
First, if you want to consistently use a specific model for all agents that do not set a custom model, set the `OPENAI_DEFAULT_MODEL` environment variable before running your agents.
2929

3030
```bash
31-
export OPENAI_DEFAULT_MODEL=gpt-5.2
31+
export OPENAI_DEFAULT_MODEL=gpt-5.4
3232
python3 my_awesome_agent.py
3333
```
3434

@@ -45,13 +45,13 @@ agent = Agent(
4545
result = await Runner.run(
4646
agent,
4747
"Hello",
48-
run_config=RunConfig(model="gpt-5.2"),
48+
run_config=RunConfig(model="gpt-5.4"),
4949
)
5050
```
5151

52-
#### GPT-5.x models
52+
#### GPT-5 models
5353

54-
When you use any GPT-5.x model such as [`gpt-5.2`](https://platform.openai.com/docs/models/gpt-5.2) in this way, the SDK applies default `ModelSettings`. It sets the ones that work the best for most use cases. To adjust the reasoning effort for the default model, pass your own `ModelSettings`:
54+
When you use any GPT-5 model such as [`gpt-5.4`](https://developers.openai.com/api/docs/models/gpt-5.4) in this way, the SDK applies default `ModelSettings`. It sets the ones that work the best for most use cases. To adjust the reasoning effort for the default model, pass your own `ModelSettings`:
5555

5656
```python
5757
from openai.types.shared import Reasoning
@@ -60,14 +60,14 @@ from agents import Agent, ModelSettings
6060
my_agent = Agent(
6161
name="My Agent",
6262
instructions="You're a helpful agent.",
63-
# If OPENAI_DEFAULT_MODEL=gpt-5.2 is set, passing only model_settings works.
64-
# It's also fine to pass a GPT-5.x model name explicitly:
65-
model="gpt-5.2",
63+
# If OPENAI_DEFAULT_MODEL=gpt-5.4 is set, passing only model_settings works.
64+
# It's also fine to pass a GPT-5 model name explicitly:
65+
model="gpt-5.4",
6666
model_settings=ModelSettings(reasoning=Reasoning(effort="high"), verbosity="low")
6767
)
6868
```
6969

70-
For lower latency, using `reasoning.effort="none"` with `gpt-5.2` is recommended. The gpt-4.1 family (including mini and nano variants) also remains a solid choice for building interactive agent apps.
70+
For lower latency, using `reasoning.effort="none"` with `gpt-5.4` is recommended. The gpt-4.1 family (including mini and nano variants) also remains a solid choice for building interactive agent apps.
7171

7272
#### Non-GPT-5 models
7373

@@ -83,7 +83,7 @@ from agents import set_default_openai_responses_transport
8383
set_default_openai_responses_transport("websocket")
8484
```
8585

86-
This affects OpenAI Responses models resolved by the default OpenAI provider (including string model names such as `"gpt-5.2"`).
86+
This affects OpenAI Responses models resolved by the default OpenAI provider (including string model names such as `"gpt-5.4"`).
8787

8888
Transport selection happens when the SDK resolves a model name into a model instance. If you pass a concrete [`Model`][agents.models.interface.Model] object, its transport is already fixed: [`OpenAIResponsesWSModel`][agents.models.openai_responses.OpenAIResponsesWSModel] uses websocket, [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] uses HTTP, and [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] stays on Chat Completions. If you pass `RunConfig(model_provider=...)`, that provider controls transport selection instead of the global default.
8989

@@ -213,7 +213,7 @@ triage_agent = Agent(
213213
name="Triage agent",
214214
instructions="Handoff to the appropriate agent based on the language of the request.",
215215
handoffs=[spanish_agent, english_agent],
216-
model="gpt-5",
216+
model="gpt-5.4",
217217
)
218218

219219
async def main():
@@ -254,7 +254,7 @@ from agents import Agent, ModelSettings
254254

255255
research_agent = Agent(
256256
name="Research agent",
257-
model="gpt-5.2",
257+
model="gpt-5.4",
258258
model_settings=ModelSettings(
259259
parallel_tool_calls=False,
260260
truncation="auto",

docs/tools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ csv_skill: ShellToolSkillReference = {
6969

7070
agent = Agent(
7171
name="Container shell agent",
72-
model="gpt-5.2",
72+
model="gpt-5.4",
7373
instructions="Use the mounted skill when helpful.",
7474
tools=[
7575
ShellTool(
@@ -698,7 +698,7 @@ agent = Agent(
698698
sandbox_mode="workspace-write",
699699
working_directory="/path/to/repo",
700700
default_thread_options=ThreadOptions(
701-
model="gpt-5.2-codex",
701+
model="gpt-5.4",
702702
model_reasoning_effort="low",
703703
network_access_enabled=True,
704704
web_search_mode="disabled",

docs/voice/quickstart.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ spanish_agent = Agent(
7272
instructions=prompt_with_handoff_instructions(
7373
"You're speaking to a human, so be polite and concise. Speak in Spanish.",
7474
),
75-
model="gpt-5.2",
75+
model="gpt-5.4",
7676
)
7777

7878
agent = Agent(
7979
name="Assistant",
8080
instructions=prompt_with_handoff_instructions(
8181
"You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.",
8282
),
83-
model="gpt-5.2",
83+
model="gpt-5.4",
8484
handoffs=[spanish_agent],
8585
tools=[get_weather],
8686
)
@@ -156,15 +156,15 @@ spanish_agent = Agent(
156156
instructions=prompt_with_handoff_instructions(
157157
"You're speaking to a human, so be polite and concise. Speak in Spanish.",
158158
),
159-
model="gpt-5.2",
159+
model="gpt-5.4",
160160
)
161161

162162
agent = Agent(
163163
name="Assistant",
164164
instructions=prompt_with_handoff_instructions(
165165
"You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.",
166166
),
167-
model="gpt-5.2",
167+
model="gpt-5.4",
168168
handoffs=[spanish_agent],
169169
tools=[get_weather],
170170
)

examples/basic/hello_world_gpt_5.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
# from openai import AsyncOpenAI
1010
# client = AsyncOpenAI()
1111
# from agents import OpenAIChatCompletionsModel
12-
# chat_completions_model = OpenAIChatCompletionsModel(model="gpt-5", openai_client=client)
12+
# chat_completions_model = OpenAIChatCompletionsModel(model="gpt-5.4", openai_client=client)
1313

1414

1515
async def main():
1616
agent = Agent(
1717
name="Knowledgable GPT-5 Assistant",
1818
instructions="You're a knowledgable assistant. You always provide an interesting answer.",
19-
model="gpt-5",
19+
model="gpt-5.4",
2020
model_settings=ModelSettings(
21-
reasoning=Reasoning(effort="minimal"), # "minimal", "low", "medium", "high"
21+
reasoning=Reasoning(effort="low"), # "none", "low", "medium", "high", "xhigh"
2222
verbosity="low", # "low", "medium", "high"
2323
),
2424
)

examples/basic/stream_ws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- `OPENAI_API_KEY`
1313
1414
Optional environment variables:
15-
- `OPENAI_MODEL` (defaults to `gpt-5.2`)
15+
- `OPENAI_MODEL` (defaults to `gpt-5.4`)
1616
- `OPENAI_BASE_URL`
1717
- `OPENAI_WEBSOCKET_BASE_URL`
1818
- `EXAMPLES_INTERACTIVE_MODE=auto` (auto-approve HITL prompts for scripted runs)
@@ -160,7 +160,7 @@ async def run_streamed_turn(
160160

161161

162162
async def main() -> None:
163-
model_name = os.getenv("OPENAI_MODEL", "gpt-5.2-codex")
163+
model_name = os.getenv("OPENAI_MODEL", "gpt-5.4")
164164
policy_agent = Agent(
165165
name="RefundPolicySpecialist",
166166
instructions=(

examples/financial_research_agent/agents/search_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
search_agent = Agent(
1313
name="FinancialSearchAgent",
14-
model="gpt-5.2",
14+
model="gpt-5.4",
1515
instructions=INSTRUCTIONS,
1616
tools=[WebSearchTool()],
1717
)

examples/financial_research_agent/agents/verifier_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ class VerificationResult(BaseModel):
2222
verifier_agent = Agent(
2323
name="VerificationAgent",
2424
instructions=VERIFIER_PROMPT,
25-
model="gpt-5.2",
25+
model="gpt-5.4",
2626
output_type=VerificationResult,
2727
)

examples/financial_research_agent/agents/writer_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ class FinancialReportData(BaseModel):
2929
writer_agent = Agent(
3030
name="FinancialWriterAgent",
3131
instructions=WRITER_PROMPT,
32-
model="gpt-5.2",
32+
model="gpt-5.4",
3333
output_type=FinancialReportData,
3434
)

examples/memory/hitl_session_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ async def main() -> None:
389389
print("OPENAI_API_KEY must be set to run the HITL session scenario.")
390390
raise SystemExit(1)
391391

392-
model_override = os.environ.get("HITL_MODEL", "gpt-5.2")
392+
model_override = os.environ.get("HITL_MODEL", "gpt-5.4")
393393
if model_override:
394394
print(f"Model: {model_override}")
395395

0 commit comments

Comments
 (0)