from __future__ import annotations import os from fastapi.responses import HTMLResponse from openenv.core.env_server.http_server import create_app from models import CareerPlanningAction, CareerPlanningObservation, CareerPlanningState from server.career_planning_environment import CareerPlanningEnvironment app = create_app( CareerPlanningEnvironment, CareerPlanningAction, CareerPlanningObservation, env_name="career_planning", max_concurrent_envs=4, ) @app.get("/", include_in_schema=False) def root() -> HTMLResponse: return HTMLResponse( """ AI Career Advisor

AI Career Advisor

Test the OpenEnv deployment directly from the browser. The API remains fully compatible with the automated checker, and this page gives you a simple way to explore it manually.

Run Reset

Example: {"user_skills": ["python", "sql"]}

About This Space

  • `POST /reset` returns `observation`, `reward`, and `done`.
  • `POST /step` accepts actions like `choose_career`, `learn_skill`, and `work`.
  • `GET /state` returns the current episode state.
  • The automated Phase 1 checks target these API endpoints.

Response

Click "POST /reset" to test the deployed environment.
""" ) def main(host: str = "0.0.0.0", port: int | None = None) -> None: import uvicorn uvicorn.run(app, host=host, port=port or int(os.environ.get("PORT", "7860"))) if __name__ == "__main__": main()