Skip to content
Merged
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
12 changes: 10 additions & 2 deletions docs/sessions/sqlalchemy_session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

## Installation

SQLAlchemy sessions require the `sqlalchemy` optional-dependency extra from the `openai-agents` package:
SQLAlchemy sessions require the `sqlalchemy` optional-dependency extra and an async database driver that matches your database URL.

For the SQLite examples below (`sqlite+aiosqlite://`), install `aiosqlite` alongside the extra:

```bash
pip install 'openai-agents[sqlalchemy]' aiosqlite
```

The extra already includes `asyncpg` for PostgreSQL URLs that start with `postgresql+asyncpg://`. For MySQL URLs that start with `mysql+aiomysql://`, install `aiomysql` alongside the extra. The driver's `rsa` extra supplies dependencies for MySQL's SHA-256 authentication methods:

```bash
pip install openai-agents[sqlalchemy]
pip install 'openai-agents[sqlalchemy]' 'aiomysql[rsa]'
Comment thread
seratch marked this conversation as resolved.
```

## Quick start
Expand Down