Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai agents python Pyproject Configuration

From Leeroopedia
Knowledge Sources
Domains Package_Management, Build_Configuration, Project_Metadata
Last Updated 2026-02-11 00:00 GMT

Overview

Python package configuration for the openai-agents SDK, defining project metadata, dependencies, optional dependency groups, build system settings, and development tool configurations.

Description

This pyproject.toml file serves as the central configuration for the OpenAI Agents Python SDK package. It declares the package name as openai-agents at version 0.8.3, licensed under MIT, requiring Python 3.9 or higher. The core dependencies include openai (>=2.9.0), pydantic (>=2.12.3), griffe (>=1.5.6), typing-extensions (>=4.12.2), requests (>=2.0), and mcp (>=1.19.0, Python 3.10+ only).

The package provides several optional dependency groups for extended functionality: voice (numpy, websockets), viz (graphviz), litellm (litellm), realtime (websockets), sqlalchemy (SQLAlchemy, asyncpg), encrypt (cryptography), redis (redis), and dapr (dapr, grpcio). A comprehensive dev dependency group includes testing tools (pytest, pytest-asyncio, coverage, inline-snapshot), type checking (mypy), linting (ruff), documentation (mkdocs, mkdocs-material, mkdocstrings), and various other development utilities.

The build system uses hatchling as the build backend with the wheel package targeting src/agents. Tool configurations include ruff (line length 100, target Python 3.9, with isort, pycodestyle, pyflakes, and other rule sets), mypy (strict mode with some relaxed settings), pytest (async auto mode with session-scoped event loops), and coverage (source in src/agents with exclusions for type checking blocks and abstract methods).

Usage

This file is the primary configuration reference for anyone building, installing, developing, or contributing to the OpenAI Agents SDK. It defines how the package is built, what dependencies are required at runtime and development time, and how development tools (linter, type checker, test runner) are configured.

Code Reference

Source Location

Signature

[project]
name = "openai-agents"
version = "0.8.3"
description = "OpenAI Agents SDK"
requires-python = ">=3.9"
license = "MIT"

Import

# N/A - This is a TOML configuration file, not a Python module.
# Install the package with: pip install openai-agents
# Install with optional dependencies: pip install openai-agents[voice,viz]

I/O Contract

Inputs

Name Type Required Description
Core dependencies openai, pydantic, griffe, typing-extensions, requests, mcp Yes Required runtime dependencies for the SDK.
Optional: voice numpy, websockets No Voice functionality support (Python 3.10+ for numpy).
Optional: viz graphviz No Visualization/graph rendering support.
Optional: litellm litellm No LiteLLM integration for multi-provider model support.
Optional: realtime websockets No Realtime/streaming communication support.
Optional: sqlalchemy SQLAlchemy, asyncpg No Database integration with SQLAlchemy and async PostgreSQL.
Optional: encrypt cryptography No Encryption functionality support.
Optional: redis redis No Redis-based storage and caching support.
Optional: dapr dapr, grpcio No Dapr distributed application runtime integration.

Outputs

Name Type Description
Package openai-agents Built wheel targeting src/agents via hatchling.
Python support >=3.9 Compatible with Python 3.9 through 3.14.

Usage Examples

Core Dependencies

[project]
name = "openai-agents"
version = "0.8.3"
description = "OpenAI Agents SDK"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
authors = [{ name = "OpenAI", email = "support@openai.com" }]
dependencies = [
    "openai>=2.9.0,<3",
    "pydantic>=2.12.3, <3",
    "griffe>=1.5.6, <2",
    "typing-extensions>=4.12.2, <5",
    "requests>=2.0, <3",
    "types-requests>=2.0, <3",
    "mcp>=1.19.0, <2; python_version >= '3.10'",
]

Optional Dependency Groups

[project.optional-dependencies]
voice = ["numpy>=2.2.0, <3; python_version>='3.10'", "websockets>=15.0, <16"]
viz = ["graphviz>=0.17"]
litellm = ["litellm>=1.81.0, <2"]
realtime = ["websockets>=15.0, <16"]
sqlalchemy = ["SQLAlchemy>=2.0", "asyncpg>=0.29.0"]
encrypt = ["cryptography>=45.0, <46"]
redis = ["redis>=7"]
dapr = ["dapr>=1.16.0", "grpcio>=1.60.0"]

Build System and Tool Configuration

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/agents"]

[tool.ruff]
line-length = 100
target-version = "py39"

[tool.mypy]
strict = true

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment