"""FastAPI application for the SimLab HR OpenEnv environment.""" from pathlib import Path from fastapi import FastAPI from fastapi.responses import HTMLResponse from openenv.core.env_server import create_app from simlab_hr.models import HRAction, HRObservation from simlab_hr.server.environment import HREnvironment _openenv_app = create_app(HREnvironment, HRAction, HRObservation, env_name="simlab-hr") app = FastAPI(title="SimLab HR") _landing_html = None _landing_path = Path(__file__).resolve().parent.parent / "landing.py" if _landing_path.exists(): _ns = {} exec(compile(_landing_path.read_text(), _landing_path, "exec"), _ns) _landing_html = _ns.get("LANDING_HTML") @app.get("/", response_class=HTMLResponse, include_in_schema=False) async def landing_page(): if _landing_html: return _landing_html return '

SimLab HR

API Docs

' app.mount("/api", _openenv_app)