INNER CODE UNIT · Python

get_runs

416rehman/DeepZero · src/deepzero/api/server.py:45

    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

        return JSONResponse(asdict(run_state))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…