Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ By using the `clone()` method on an agent, you can duplicate an Agent, and optio
pirate_agent = Agent(
name="Pirate",
instructions="Write like a pirate",
model="gpt-5.4",
model="gpt-5.5",
)

robot_agent = pirate_agent.clone(
Expand Down
28 changes: 14 additions & 14 deletions docs/models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ Start with the simplest path that fits your setup:

For most OpenAI-only apps, the recommended path is to use string model names with the default OpenAI provider and stay on the Responses model path.

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`.
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.5`](https://developers.openai.com/api/docs/models/gpt-5.5) for higher quality while keeping explicit `model_settings`.

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.
If you want to switch to other models like [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5), there are two ways to configure your agents.

### Default model

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.

```bash
export OPENAI_DEFAULT_MODEL=gpt-5.4
export OPENAI_DEFAULT_MODEL=gpt-5.5
python3 my_awesome_agent.py
```

Expand All @@ -48,13 +48,13 @@ agent = Agent(
result = await Runner.run(
agent,
"Hello",
run_config=RunConfig(model="gpt-5.4"),
run_config=RunConfig(model="gpt-5.5"),
)
```

#### GPT-5 models

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`:
When you use any GPT-5 model such as [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) 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`:

```python
from openai.types.shared import Reasoning
Expand All @@ -63,20 +63,20 @@ from agents import Agent, ModelSettings
my_agent = Agent(
name="My Agent",
instructions="You're a helpful agent.",
# If OPENAI_DEFAULT_MODEL=gpt-5.4 is set, passing only model_settings works.
# If OPENAI_DEFAULT_MODEL=gpt-5.5 is set, passing only model_settings works.
# It's also fine to pass a GPT-5 model name explicitly:
model="gpt-5.4",
model="gpt-5.5",
model_settings=ModelSettings(reasoning=Reasoning(effort="high"), verbosity="low")
)
```

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.
For lower latency, using `reasoning.effort="none"` with `gpt-5.5` is recommended. The gpt-4.1 family (including mini and nano variants) also remains a solid choice for building interactive agent apps.

#### ComputerTool model selection

If an agent includes [`ComputerTool`][agents.tool.ComputerTool], the effective model on the actual Responses request determines which computer-tool payload the SDK sends. Explicit `gpt-5.4` requests use the GA built-in `computer` tool, while explicit `computer-use-preview` requests keep the older `computer_use_preview` payload.
If an agent includes [`ComputerTool`][agents.tool.ComputerTool], the effective model on the actual Responses request determines which computer-tool payload the SDK sends. Explicit `gpt-5.5` requests use the GA built-in `computer` tool, while explicit `computer-use-preview` requests keep the older `computer_use_preview` payload.

Prompt-managed calls are the main exception. If a prompt template owns the model and the SDK omits `model` from the request, the SDK defaults to the preview-compatible computer payload so it does not guess which model the prompt pins. To keep the GA path in that flow, either make `model="gpt-5.4"` explicit on the request or force the GA selector with `ModelSettings(tool_choice="computer")` or `ModelSettings(tool_choice="computer_use")`.
Prompt-managed calls are the main exception. If a prompt template owns the model and the SDK omits `model` from the request, the SDK defaults to the preview-compatible computer payload so it does not guess which model the prompt pins. To keep the GA path in that flow, either make `model="gpt-5.5"` explicit on the request or force the GA selector with `ModelSettings(tool_choice="computer")` or `ModelSettings(tool_choice="computer_use")`.

With a registered [`ComputerTool`][agents.tool.ComputerTool], `tool_choice="computer"`, `"computer_use"`, and `"computer_use_preview"` are normalized to the built-in selector that matches the effective request model. If no `ComputerTool` is registered, those strings continue to behave like ordinary function names.

Expand Down Expand Up @@ -108,7 +108,7 @@ from agents import set_default_openai_responses_transport
set_default_openai_responses_transport("websocket")
```

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

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.

Expand Down Expand Up @@ -275,7 +275,7 @@ triage_agent = Agent(
name="Triage agent",
instructions="Handoff to the appropriate agent based on the language of the request.",
handoffs=[spanish_agent, english_agent],
model="gpt-5.4",
model="gpt-5.5",
)

async def main():
Expand Down Expand Up @@ -320,7 +320,7 @@ from agents import Agent, ModelSettings

research_agent = Agent(
name="Research agent",
model="gpt-5.4",
model="gpt-5.5",
model_settings=ModelSettings(
parallel_tool_calls=False,
truncation="auto",
Expand Down Expand Up @@ -363,7 +363,7 @@ from agents import Agent, ModelRetrySettings, ModelSettings, retry_policies

agent = Agent(
name="Assistant",
model="gpt-5.4",
model="gpt-5.5",
model_settings=ModelSettings(
retry=ModelRetrySettings(
max_retries=4,
Expand Down
2 changes: 1 addition & 1 deletion docs/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ In practice:

Unlike the JavaScript SDK, Python does not expose a separate `output` property for the model-shaped delta only. Use `new_items` when you need SDK metadata, or inspect `raw_responses` when you need the raw model payloads.

Computer-tool replay follows the raw Responses payload shape. Preview-model `computer_call` items preserve a single `action`, while `gpt-5.4` computer calls can preserve batched `actions[]`. [`to_input_list()`][agents.result.RunResultBase.to_input_list] and [`RunState`][agents.run_state.RunState] keep whichever shape the model produced, so manual replay, pause/resume flows, and stored transcripts continue to work across both preview and GA computer-tool calls. Local execution results still appear as `computer_call_output` items in `new_items`.
Computer-tool replay follows the raw Responses payload shape. Preview-model `computer_call` items preserve a single `action`, while `gpt-5.5` computer calls can preserve batched `actions[]`. [`to_input_list()`][agents.result.RunResultBase.to_input_list] and [`RunState`][agents.run_state.RunState] keep whichever shape the model produced, so manual replay, pause/resume flows, and stored transcripts continue to work across both preview and GA computer-tool calls. Local execution results still appear as `computer_call_output` items in `new_items`.

### New items

Expand Down
2 changes: 1 addition & 1 deletion docs/sandbox/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ async def main(model: str, prompt: str) -> None:
if __name__ == "__main__":
asyncio.run(
main(
model="gpt-5.4",
model="gpt-5.5",
prompt=(
"Open `repo/task.md`, use the `$credit-note-fixer` skill, fix the bug, "
f"run `{TARGET_TEST_CMD}`, and summarize the change."
Expand Down
2 changes: 1 addition & 1 deletion docs/sandbox_agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def build_agent(model: str) -> SandboxAgent[None]:

async def main() -> None:
result = await Runner.run(
build_agent("gpt-5.4"),
build_agent("gpt-5.5"),
"Open `repo/task.md`, fix the issue, run the targeted test, and summarize the change.",
run_config=RunConfig(
sandbox=SandboxRunConfig(client=UnixLocalSandboxClient()),
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/translate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# logging.basicConfig(level=logging.INFO)
# logging.getLogger("openai").setLevel(logging.DEBUG)

OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "gpt-5.4")
OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "gpt-5.5")

ENABLE_CODE_SNIPPET_EXCLUSION = True
# gpt-4.5 needed this for better quality
Expand Down
2 changes: 1 addition & 1 deletion docs/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Keep consuming `result.stream_events()` until the async iterator finishes. A str

[`RawResponsesStreamEvent`][agents.stream_events.RawResponsesStreamEvent] are raw events passed directly from the LLM. They are in OpenAI Responses API format, which means each event has a type (like `response.created`, `response.output_text.delta`, etc) and data. These events are useful if you want to stream response messages to the user as soon as they are generated.

Computer-tool raw events keep the same preview-vs-GA distinction as stored results. Preview flows stream `computer_call` items with one `action`, while `gpt-5.4` can stream `computer_call` items with batched `actions[]`. The higher-level [`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent] surface does not add a special computer-only event name for this: both shapes still surface as `tool_called`, and the screenshot result comes back as `tool_output` wrapping a `computer_call_output` item.
Computer-tool raw events keep the same preview-vs-GA distinction as stored results. Preview flows stream `computer_call` items with one `action`, while `gpt-5.5` can stream `computer_call` items with batched `actions[]`. The higher-level [`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent] surface does not add a special computer-only event name for this: both shapes still surface as `tool_called`, and the screenshot result comes back as `tool_output` wrapping a `computer_call_output` item.

For example, this will output the text generated by the LLM token-by-token.

Expand Down
14 changes: 7 additions & 7 deletions docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ crm_tools = tool_namespace(

agent = Agent(
name="Operations assistant",
model="gpt-5.4",
model="gpt-5.5",
instructions="Load the crm namespace before using CRM tools.",
tools=[*crm_tools, ToolSearchTool()],
)
Expand Down Expand Up @@ -134,7 +134,7 @@ csv_skill: ShellToolSkillReference = {

agent = Agent(
name="Container shell agent",
model="gpt-5.4",
model="gpt-5.5",
instructions="Use the mounted skill when helpful.",
tools=[
ShellTool(
Expand Down Expand Up @@ -186,20 +186,20 @@ Local runtime tools require you to supply implementations:

`ComputerTool` is still a local harness: you provide a [`Computer`][agents.computer.Computer] or [`AsyncComputer`][agents.computer.AsyncComputer] implementation, and the SDK maps that harness onto the OpenAI Responses API computer surface.

For explicit [`gpt-5.4`](https://developers.openai.com/api/docs/models/gpt-5.4) requests, the SDK sends the GA built-in tool payload `{"type": "computer"}`. The older `computer-use-preview` model keeps the preview payload `{"type": "computer_use_preview", "environment": ..., "display_width": ..., "display_height": ...}`. This mirrors the platform migration described in OpenAI's [Computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use/):
For explicit [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) requests, the SDK sends the GA built-in tool payload `{"type": "computer"}`. The older `computer-use-preview` model keeps the preview payload `{"type": "computer_use_preview", "environment": ..., "display_width": ..., "display_height": ...}`. This mirrors the platform migration described in OpenAI's [Computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use/):

- Model: `computer-use-preview` -> `gpt-5.4`
- Model: `computer-use-preview` -> `gpt-5.5`
- Tool selector: `computer_use_preview` -> `computer`
- Computer call shape: one `action` per `computer_call` -> batched `actions[]` on `computer_call`
- Truncation: `ModelSettings(truncation="auto")` required on the preview path -> not required on the GA path

The SDK chooses that wire shape from the effective model on the actual Responses request. If you use a prompt template and the request omits `model` because the prompt owns it, the SDK keeps the preview-compatible computer payload unless you either keep `model="gpt-5.4"` explicit or force the GA selector with `ModelSettings(tool_choice="computer")` or `ModelSettings(tool_choice="computer_use")`.
The SDK chooses that wire shape from the effective model on the actual Responses request. If you use a prompt template and the request omits `model` because the prompt owns it, the SDK keeps the preview-compatible computer payload unless you either keep `model="gpt-5.5"` explicit or force the GA selector with `ModelSettings(tool_choice="computer")` or `ModelSettings(tool_choice="computer_use")`.

When a [`ComputerTool`][agents.tool.ComputerTool] is present, `tool_choice="computer"`, `"computer_use"`, and `"computer_use_preview"` are all accepted and normalized to the built-in selector that matches the effective request model. Without a `ComputerTool`, those strings still behave like ordinary function names.

This distinction matters when `ComputerTool` is backed by a [`ComputerProvider`][agents.tool.ComputerProvider] factory. The GA `computer` payload does not need `environment` or dimensions at serialization time, so unresolved factories are fine. Preview-compatible serialization still needs a resolved `Computer` or `AsyncComputer` instance so the SDK can send `environment`, `display_width`, and `display_height`.

At runtime, both paths still use the same local harness. Preview responses emit `computer_call` items with a single `action`; `gpt-5.4` can emit batched `actions[]`, and the SDK executes them in order before producing a `computer_call_output` screenshot item. See `examples/tools/computer_use.py` for a runnable Playwright-based harness.
At runtime, both paths still use the same local harness. Preview responses emit `computer_call` items with a single `action`; `gpt-5.5` can emit batched `actions[]`, and the SDK executes them in order before producing a `computer_call_output` screenshot item. See `examples/tools/computer_use.py` for a runnable Playwright-based harness.

```python
from agents import Agent, ApplyPatchTool, ShellTool
Expand Down Expand Up @@ -784,7 +784,7 @@ agent = Agent(
sandbox_mode="workspace-write",
working_directory="/path/to/repo",
default_thread_options=ThreadOptions(
model="gpt-5.4",
model="gpt-5.5",
model_reasoning_effort="low",
network_access_enabled=True,
web_search_mode="disabled",
Expand Down
8 changes: 4 additions & 4 deletions docs/voice/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ spanish_agent = Agent(
instructions=prompt_with_handoff_instructions(
"You're speaking to a human, so be polite and concise. Speak in Spanish.",
),
model="gpt-5.4",
model="gpt-5.5",
)

agent = Agent(
name="Assistant",
instructions=prompt_with_handoff_instructions(
"You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.",
),
model="gpt-5.4",
model="gpt-5.5",
handoffs=[spanish_agent],
tools=[get_weather],
)
Expand Down Expand Up @@ -156,15 +156,15 @@ spanish_agent = Agent(
instructions=prompt_with_handoff_instructions(
"You're speaking to a human, so be polite and concise. Speak in Spanish.",
),
model="gpt-5.4",
model="gpt-5.5",
)

agent = Agent(
name="Assistant",
instructions=prompt_with_handoff_instructions(
"You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.",
),
model="gpt-5.4",
model="gpt-5.5",
handoffs=[spanish_agent],
tools=[get_weather],
)
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/hello_world_gpt_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# from openai import AsyncOpenAI
# client = AsyncOpenAI()
# from agents import OpenAIChatCompletionsModel
# chat_completions_model = OpenAIChatCompletionsModel(model="gpt-5.4", openai_client=client)
# chat_completions_model = OpenAIChatCompletionsModel(model="gpt-5.5", openai_client=client)


async def main():
agent = Agent(
name="Knowledgable GPT-5 Assistant",
instructions="You're a knowledgable assistant. You always provide an interesting answer.",
model="gpt-5.4",
model="gpt-5.5",
model_settings=ModelSettings(
reasoning=Reasoning(effort="low"), # "none", "low", "medium", "high", "xhigh"
verbosity="low", # "low", "medium", "high"
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/stream_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- `OPENAI_API_KEY`

Optional environment variables:
- `OPENAI_MODEL` (defaults to `gpt-5.4`)
- `OPENAI_MODEL` (defaults to `gpt-5.5`)
- `OPENAI_BASE_URL`
- `OPENAI_WEBSOCKET_BASE_URL`
- `EXAMPLES_INTERACTIVE_MODE=auto` (auto-approve HITL prompts for scripted runs)
Expand Down Expand Up @@ -160,7 +160,7 @@ async def run_streamed_turn(


async def main() -> None:
model_name = os.getenv("OPENAI_MODEL", "gpt-5.4")
model_name = os.getenv("OPENAI_MODEL", "gpt-5.5")
policy_agent = Agent(
name="RefundPolicySpecialist",
instructions=(
Expand Down
2 changes: 1 addition & 1 deletion examples/financial_research_agent/agents/search_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

search_agent = Agent(
name="FinancialSearchAgent",
model="gpt-5.4",
model="gpt-5.5",
instructions=INSTRUCTIONS,
tools=[WebSearchTool()],
)
2 changes: 1 addition & 1 deletion examples/financial_research_agent/agents/verifier_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class VerificationResult(BaseModel):
verifier_agent = Agent(
name="VerificationAgent",
instructions=VERIFIER_PROMPT,
model="gpt-5.4",
model="gpt-5.5",
output_type=VerificationResult,
)
2 changes: 1 addition & 1 deletion examples/financial_research_agent/agents/writer_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ class FinancialReportData(BaseModel):
writer_agent = Agent(
name="FinancialWriterAgent",
instructions=WRITER_PROMPT,
model="gpt-5.4",
model="gpt-5.5",
output_type=FinancialReportData,
)
8 changes: 6 additions & 2 deletions examples/memory/hitl_session_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from pathlib import Path
from typing import Any

from openai.types.shared import Reasoning

from agents import Agent, Model, ModelSettings, OpenAIConversationsSession, Runner, function_tool
from agents.items import TResponseInputItem

Expand Down Expand Up @@ -80,7 +82,9 @@ async def run_scenario_step(
),
tools=[approval_echo, approval_note],
model=model,
model_settings=ModelSettings(tool_choice=step.tool_name),
model_settings=ModelSettings(
tool_choice=step.tool_name, reasoning=Reasoning(effort="none")
),
tool_use_behavior="stop_on_first_tool",
)

Expand Down Expand Up @@ -389,7 +393,7 @@ async def main() -> None:
print("OPENAI_API_KEY must be set to run the HITL session scenario.")
raise SystemExit(1)

model_override = os.environ.get("HITL_MODEL", "gpt-5.4")
model_override = os.environ.get("HITL_MODEL", "gpt-5.5")
if model_override:
print(f"Model: {model_override}")

Expand Down
Loading
Loading