-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Description:
When installing the latest release of the SDK (or pulling the main branch), from agents import SQLiteSession fails with:
ImportError: cannot import name 'SQLiteSession' from 'agents'It appears that although the Sessions feature (PR #752, July 10 2025) landed on main, the top‑level re‑export of SQLiteSession hasn’t been merged (or isn’t yet published to PyPI).
Steps to Reproduce:
-
Create and activate a clean virtual environment.
-
pip install openai-agents -
In a Python REPL or script:
from agents import SQLiteSession
-
Observe the
ImportError.
Expected Behavior:
The import should succeed, as documented in the Sessions guide:
from agents import Agent, Runner, SQLiteSessionActual Behavior:
Import fails. The class exists in agents/sessions/session.py, but is not re‑exported in agents/__init__.py.
Workarounds:
-
Install directly from GitHub main:
pip install git+https://github.com/openai/openai-agents-python@main
-
Or import from its module path:
from agents.sessions.session import SQLiteSession
These are suboptimal until the next PyPI release or until __init__.py is updated.
Suggested Fix:
- Add
from .sessions.session import SQLiteSession(and any other new sessions classes) toagents/__init__.pyunder the existing exports. - Cut a patch release of
openai-agentson PyPI that includes this change.