Spaces:
Build error
Build error
| 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 | |
| ) |