""" nl2sql-bench/server/app.py ============================ FastAPI application entry point for the NL2SQL-Bench OpenEnv server. create_fastapi_app() auto-creates all required OpenEnv endpoints: POST /reset — start a new episode POST /step — submit an action GET /state — retrieve episode state GET /health — health check GET /web — interactive web UI (if ENABLE_WEB_INTERFACE=true) GET /docs — Swagger UI """ import sys from pathlib import Path from openenv.core.env_server import create_fastapi_app from environment import NL2SQLEnvironment # Ensure models can be imported from the parent directory _HERE = Path(__file__).parent sys.path.insert(0, str(_HERE.parent)) from models import NL2SQLAction, NL2SQLObservation # Pass the explicitly required action and observation classes app = create_fastapi_app( NL2SQLEnvironment, action_cls=NL2SQLAction, observation_cls=NL2SQLObservation )