INNER CODE UNIT · Python
health
416rehman/DeepZero · src/deepzero/api/server.py:42
async def health(request: Request) -> JSONResponseType:
return JSONResponse({"status": "ok", "work_dir": str(work_dir)})
async def get_runs(request: Request) -> JSONResponseType:
run_state = await _run_sync(store.load_run)
if run_state is None:
return JSONResponse({"runs": []})
from dataclasses import asdict
return JSONResponse({"runs": [asdict(run_state)]})
async def get_run(request: Request) -> JSONResponseType:
run_state = await _run_sync(store.load_run)
if run_state is None:
return JSONResponse({"error": "no run found"}, status_code=404)
from dataclasses import asdict