Spaces:
Sleeping
Sleeping
Update app/api/routes_prediction.py
Browse files
app/api/routes_prediction.py
CHANGED
|
@@ -4,6 +4,7 @@ from app.services.prediction import predict_path
|
|
| 4 |
|
| 5 |
router = APIRouter(prefix="/api")
|
| 6 |
|
|
|
|
| 7 |
@router.get("/prediction", response_model=PredictionResponse)
|
| 8 |
def get_prediction(
|
| 9 |
ticker: str = Query(..., min_length=1),
|
|
@@ -18,8 +19,6 @@ def get_prediction(
|
|
| 18 |
print("🔥 BACKEND ERROR:", repr(e))
|
| 19 |
raise HTTPException(status_code=500, detail=str(e))
|
| 20 |
|
| 21 |
-
)
|
| 22 |
-
|
| 23 |
|
| 24 |
@router.get("/price/forecast", response_model=ChartForecastResponse)
|
| 25 |
def get_price_forecast(
|
|
@@ -31,10 +30,11 @@ def get_price_forecast(
|
|
| 31 |
return chart_payload
|
| 32 |
except HTTPException:
|
| 33 |
raise
|
| 34 |
-
except Exception:
|
|
|
|
| 35 |
raise HTTPException(
|
| 36 |
status_code=500,
|
| 37 |
-
detail=
|
| 38 |
)
|
| 39 |
|
| 40 |
|
|
@@ -51,8 +51,9 @@ def get_full_prediction(
|
|
| 51 |
}
|
| 52 |
except HTTPException:
|
| 53 |
raise
|
| 54 |
-
except Exception:
|
|
|
|
| 55 |
raise HTTPException(
|
| 56 |
status_code=500,
|
| 57 |
-
detail=
|
| 58 |
)
|
|
|
|
| 4 |
|
| 5 |
router = APIRouter(prefix="/api")
|
| 6 |
|
| 7 |
+
|
| 8 |
@router.get("/prediction", response_model=PredictionResponse)
|
| 9 |
def get_prediction(
|
| 10 |
ticker: str = Query(..., min_length=1),
|
|
|
|
| 19 |
print("🔥 BACKEND ERROR:", repr(e))
|
| 20 |
raise HTTPException(status_code=500, detail=str(e))
|
| 21 |
|
|
|
|
|
|
|
| 22 |
|
| 23 |
@router.get("/price/forecast", response_model=ChartForecastResponse)
|
| 24 |
def get_price_forecast(
|
|
|
|
| 30 |
return chart_payload
|
| 31 |
except HTTPException:
|
| 32 |
raise
|
| 33 |
+
except Exception as e:
|
| 34 |
+
print("🔥 BACKEND ERROR:", repr(e))
|
| 35 |
raise HTTPException(
|
| 36 |
status_code=500,
|
| 37 |
+
detail=str(e),
|
| 38 |
)
|
| 39 |
|
| 40 |
|
|
|
|
| 51 |
}
|
| 52 |
except HTTPException:
|
| 53 |
raise
|
| 54 |
+
except Exception as e:
|
| 55 |
+
print("🔥 BACKEND ERROR:", repr(e))
|
| 56 |
raise HTTPException(
|
| 57 |
status_code=500,
|
| 58 |
+
detail=str(e),
|
| 59 |
)
|