Skip to content

Commit 2b49c0f

Browse files
Implementation of AdvancedSQLAlchemy + tests
1 parent d659a73 commit 2b49c0f

File tree

3 files changed

+2063
-0
lines changed

3 files changed

+2063
-0
lines changed

src/agents/extensions/memory/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"RedisSession",
1616
"SQLAlchemySession",
1717
"AdvancedSQLiteSession",
18+
"AdvancedSQLAlchemySession",
1819
]
1920

2021

@@ -60,4 +61,15 @@ def __getattr__(name: str) -> Any:
6061
except ModuleNotFoundError as e:
6162
raise ImportError(f"Failed to import AdvancedSQLiteSession: {e}") from e
6263

64+
if name == "AdvancedSQLAlchemySession":
65+
try:
66+
from .advanced_sqlalchemy_session import AdvancedSQLAlchemySession # noqa: F401
67+
68+
return AdvancedSQLAlchemySession
69+
except ModuleNotFoundError as e:
70+
raise ImportError(
71+
"AdvancedSQLAlchemySession requires the 'sqlalchemy' extra. "
72+
"Install it with: pip install openai-agents[sqlalchemy]"
73+
) from e
74+
6375
raise AttributeError(f"module {__name__} has no attribute {name}")

0 commit comments

Comments
 (0)