Spaces:
Build error
Build error
Download models/response.py from patharanor/qccamapi: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/patharanor/qccamapi/resolve/main/models/response.py
- Command line
-
hf download hf://spaces/patharanor/qccamapi/models/response.py
-
curl -L -o response.py https://huggingface.co/spaces/patharanor/qccamapi/resolve/main/models/response.py
434 Bytes
| from typing import Any | |
| from fastapi.responses import JSONResponse | |
| from pydantic import BaseModel | |
| class Response(BaseModel): | |
| status: int = 500 | |
| data: Any = None | |
| error: Any = None | |
| def json(self): | |
| return JSONResponse( | |
| content={ | |
| "status": self.status, | |
| "data": self.data, | |
| "error": self.error, | |
| }, | |
| status_code=self.status | |
| ) |