Files
strands_agent/agent_demo/persistence/__init__.py
T
2026-09-11 15:45:13 +08:00

24 lines
583 B
Python

from .base import Session, SessionStore
from .json_store import JSONSessionStore
from .sqlite_store import SQLiteSessionStore
__all__ = [
"Session",
"SessionStore",
"JSONSessionStore",
"SQLiteSessionStore",
"get_session_store",
]
def get_session_store() -> SessionStore:
from .. import config
backend = config.SESSION_BACKEND
if backend == "sqlite":
return SQLiteSessionStore(config.SQLITE_PATH)
if backend == "json":
return JSONSessionStore(config.SESSION_DIR)
raise ValueError(f"Unsupported SESSION_BACKEND: {backend}")