Spaces:
Sleeping
Sleeping
File size: 814 Bytes
05a686e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """
coenv OpenEnv Application
Uses OpenEnv's create_app factory.
"""
from typing import Dict
import uvicorn
from openenv.core.env_server import create_app
try:
from ..models import CoenvAction, CoenvObservation
except ImportError:
from models import CoenvAction, CoenvObservation
try:
from .simulation_service import CoenvEnvironment
except ImportError:
from simulation_service import CoenvEnvironment
app = create_app(CoenvEnvironment, CoenvAction, CoenvObservation, env_name="coenv")
@app.get("/health")
async def health() -> Dict[str, str]:
"""Health endpoint used by Docker health checks."""
return {"status": "ok"}
def main() -> None:
"""Application entrypoint for local execution."""
uvicorn.run(app, host="0.0.0.0", port=8000)
if __name__ == "__main__":
main() |