"""FastAPI wrapper for ClaimsEnvProEnvironment. Used when the package is imported as ``server.app``. The HF Space deploys ``space_app.py`` instead, which adds an HTML dashboard on top. """ from __future__ import annotations try: from openenv.core.env_server.http_server import create_app # type: ignore[attr-defined] except Exception: from openenv.core.env_server import create_fastapi_app as create_app # fallback try: from ..models import ClaimsAction, ClaimsObservation from .claims_environment import ClaimsEnvProEnvironment except (ImportError, ModuleNotFoundError): from models import ClaimsAction, ClaimsObservation # type: ignore[no-redef] from server.claims_environment import ClaimsEnvProEnvironment # type: ignore[no-redef] app = create_app( ClaimsEnvProEnvironment, ClaimsAction, ClaimsObservation, ) @app.get("/info") async def get_info() -> dict[str, object]: return { "name": "ClaimSense Pro Adjudication Gym", "version": "2.0.0", "description": ( "Multi-step RL environment for insurance adjudication with " "12-verb action surface, 5 difficulty tasks, 18-field " "observation, 6-component graded score, and Plaid bank-feed " "verification." ), "problem_statement": "3.1 - Professional Tasks (World Modeling)", "valid_actions": list(ClaimsEnvProEnvironment.VALID_ACTIONS), "dense_costs": dict(ClaimsEnvProEnvironment.DENSE_COSTS), } def main(host: str = "0.0.0.0", port: int = 8000) -> None: import uvicorn uvicorn.run(app, host=host, port=port) if __name__ == "__main__": main()