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
25 changes: 0 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,28 +122,3 @@ jobs:
- name: Skip docs build
if: steps.changes.outputs.run != 'true'
run: echo "Skipping docs build for non-docs changes."

old_version_tests:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41
with:
enable-cache: true
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Run tests
if: steps.changes.outputs.run == 'true'
run: make old_version_tests
- name: Skip old version tests
if: steps.changes.outputs.run != 'true'
run: echo "Skipping old version tests for non-code changes."
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The OpenAI Agents Python repository provides the Python Agents SDK, examples, an

### Prerequisites

- Python 3.9+.
- Python 3.10+.
- `uv` installed for dependency management (`uv sync`) and `uv run` for Python commands.
- `make` available to run repository tasks.

Expand Down Expand Up @@ -172,9 +172,10 @@ make tests
```bash
make sync
```
- Run tests against Python 3.9 in an isolated environment:
- Run tests against the oldest supported version (Python 3.10) in an isolated environment:
```bash
make old_version_tests
UV_PROJECT_ENVIRONMENT=.venv_310 uv sync --python 3.10 --all-extras --all-packages --group dev
UV_PROJECT_ENVIRONMENT=.venv_310 uv run --python 3.10 -m pytest
```
- Documentation workflows:
```bash
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ snapshots-fix:
snapshots-create:
uv run pytest --inline-snapshot=create

.PHONY: old_version_tests
old_version_tests:
UV_PROJECT_ENVIRONMENT=.venv_39 uv sync --python 3.9 --all-extras --all-packages --group dev
UV_PROJECT_ENVIRONMENT=.venv_39 uv run --python 3.9 -m pytest

.PHONY: build-docs
build-docs:
uv run docs/scripts/generate_ref_files.py
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Explore the [examples](examples) directory to see the SDK in action, and read ou

## Get started

To get started, set up your Python environment (Python 3.9 or newer required), and then install OpenAI Agents SDK package.
To get started, set up your Python environment (Python 3.10 or newer required), and then install OpenAI Agents SDK package.

### venv

Expand Down
2 changes: 1 addition & 1 deletion docs/realtime/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Realtime agents are in beta. Expect some breaking changes as we improve the impl

## Prerequisites

- Python 3.9 or higher
- Python 3.10 or higher
- OpenAI API key
- Basic familiarity with the OpenAI Agents SDK

Expand Down
2 changes: 1 addition & 1 deletion examples/realtime/twilio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example demonstrates how to connect the OpenAI Realtime API to a phone call

## Prerequisites

- Python 3.9+
- Python 3.10+
- OpenAI API key with [Realtime API](https://platform.openai.com/docs/guides/realtime) access
- [Twilio](https://www.twilio.com/docs/voice) account with a phone number
- A tunneling service like [ngrok](https://ngrok.com/) to expose your local server
Expand Down
2 changes: 1 addition & 1 deletion examples/realtime/twilio_sip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example shows how to handle OpenAI Realtime SIP calls with the Agents SDK.

## Prerequisites

- Python 3.9+
- Python 3.10+
- An OpenAI API key with Realtime API access
- A configured webhook secret for your OpenAI project
- A Twilio account with a phone number and Elastic SIP Trunking enabled
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openai-agents"
version = "0.8.4"
description = "OpenAI Agents SDK"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = "MIT"
authors = [{ name = "OpenAI", email = "support@openai.com" }]
dependencies = [
Expand All @@ -19,7 +19,6 @@ classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down
5 changes: 0 additions & 5 deletions src/agents/realtime/openai_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ async def _build_model_settings_from_agent(
return updated_settings


# Note: Avoid a module-level union alias for Python 3.9 compatibility.
# Using a union at runtime (e.g., A | B) in a type alias triggers evaluation
# during import on 3.9. We instead inline the union in annotations below.


class TransportConfig(TypedDict):
"""Low-level network transport configuration."""

Expand Down
2 changes: 1 addition & 1 deletion src/agents/realtime/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ async def on_event(self, event: RealtimeModelEvent) -> None:
for idx, entry in enumerate(incoming_item.content):
# Only attempt to preserve for audio-like content
if entry.type in ("audio", "input_audio"):
# Use tuple form for Python 3.9 compatibility
# Use tuple form when checking against multiple classes.
assert isinstance(entry, (InputAudio, AssistantAudio))
# Determine if transcript is missing/empty on the incoming entry
entry_transcript = entry.transcript
Expand Down
11 changes: 0 additions & 11 deletions tests/mcp/conftest.py

This file was deleted.

11 changes: 0 additions & 11 deletions tests/models/conftest.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_agent_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def test_tool_use_behavior_dict_validation(self):
with pytest.raises(TypeError, match="Agent tool_use_behavior must be"):
Agent(name="test", tool_use_behavior=123) # type: ignore

def test_hooks_validation_python39_compatibility(self):
"""Test hooks validation works with Python 3.9 - fixes generic type issues"""
def test_hooks_validation_type_compatibility(self):
"""Test hooks validation works with generic type validation."""

class MockHooks(AgentHooksBase):
pass
Expand Down
11 changes: 0 additions & 11 deletions tests/voice/conftest.py

This file was deleted.

Loading