Spaces:
Runtime error
Runtime error
Commit ·
a0e2f2d
1
Parent(s): 8e1f4ff
Fixed endpoints
Browse files- app.py +3 -3
- dashboard_analytics.py +2 -2
- enterprise_ra.py +2 -2
- threat_ra.py +2 -2
app.py
CHANGED
|
@@ -14,9 +14,9 @@ from dashboard_analytics import dashboard_router
|
|
| 14 |
app = FastAPI(title="EY Catalyst Risk Analysis API", version="1.0.0")
|
| 15 |
|
| 16 |
# Include the routers
|
| 17 |
-
app.
|
| 18 |
-
app.
|
| 19 |
-
app.
|
| 20 |
|
| 21 |
# Environment Variables
|
| 22 |
GROQ_API_KEY = os.environ.get("GROQ_API_KEY").strip()
|
|
|
|
| 14 |
app = FastAPI(title="EY Catalyst Risk Analysis API", version="1.0.0")
|
| 15 |
|
| 16 |
# Include the routers
|
| 17 |
+
app.include_router(enterprise_ra_router, prefix="/enterprise")
|
| 18 |
+
app.include_router(threat_ra_router, prefix="/threat")
|
| 19 |
+
app.include_router(dashboard_router, prefix="/dashboard")
|
| 20 |
|
| 21 |
# Environment Variables
|
| 22 |
GROQ_API_KEY = os.environ.get("GROQ_API_KEY").strip()
|
dashboard_analytics.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# dashboard_analytics.py
|
| 2 |
-
from fastapi import
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional, Dict, Any
|
| 5 |
import os
|
|
@@ -73,7 +73,7 @@ class RecentActivitiesResponse(BaseModel):
|
|
| 73 |
message: str
|
| 74 |
|
| 75 |
# Dashboard Analytics Router
|
| 76 |
-
dashboard_router =
|
| 77 |
|
| 78 |
@dashboard_router.post("/api/dashboard/generate-kpis", response_model=DashboardKPIResponse)
|
| 79 |
def generate_dashboard_kpis(request: DashboardAnalyticsRequest):
|
|
|
|
| 1 |
# dashboard_analytics.py
|
| 2 |
+
from fastapi import APIRouter, HTTPException
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional, Dict, Any
|
| 5 |
import os
|
|
|
|
| 73 |
message: str
|
| 74 |
|
| 75 |
# Dashboard Analytics Router
|
| 76 |
+
dashboard_router = APIRouter()
|
| 77 |
|
| 78 |
@dashboard_router.post("/api/dashboard/generate-kpis", response_model=DashboardKPIResponse)
|
| 79 |
def generate_dashboard_kpis(request: DashboardAnalyticsRequest):
|
enterprise_ra.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# enterprise_ra.py
|
| 2 |
-
from fastapi import
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional
|
| 5 |
import os
|
|
@@ -68,7 +68,7 @@ class ThreatGenerationResponse(BaseModel):
|
|
| 68 |
message: str
|
| 69 |
|
| 70 |
# Enterprise RA Router
|
| 71 |
-
enterprise_ra_router =
|
| 72 |
|
| 73 |
@enterprise_ra_router.post("/api/enterprise-ra/generate-risks", response_model=RiskGenerationResponse)
|
| 74 |
def generate_enterprise_risks(request: RiskGenerationRequest):
|
|
|
|
| 1 |
# enterprise_ra.py
|
| 2 |
+
from fastapi import APIRouter, HTTPException
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional
|
| 5 |
import os
|
|
|
|
| 68 |
message: str
|
| 69 |
|
| 70 |
# Enterprise RA Router
|
| 71 |
+
enterprise_ra_router = APIRouter()
|
| 72 |
|
| 73 |
@enterprise_ra_router.post("/api/enterprise-ra/generate-risks", response_model=RiskGenerationResponse)
|
| 74 |
def generate_enterprise_risks(request: RiskGenerationRequest):
|
threat_ra.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# threat_ra.py
|
| 2 |
-
from fastapi import
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional
|
| 5 |
import os
|
|
@@ -66,7 +66,7 @@ class ThreatRiskAnalysisResponse(BaseModel):
|
|
| 66 |
message: str
|
| 67 |
|
| 68 |
# Threat RA Router
|
| 69 |
-
threat_ra_router =
|
| 70 |
|
| 71 |
@threat_ra_router.post("/api/threat-ra/generate-threat-risks", response_model=ThreatRiskGenerationResponse)
|
| 72 |
def generate_threat_risks(request: ThreatRiskGenerationRequest):
|
|
|
|
| 1 |
# threat_ra.py
|
| 2 |
+
from fastapi import APIRouter, HTTPException
|
| 3 |
from pydantic import BaseModel
|
| 4 |
from typing import List, Optional
|
| 5 |
import os
|
|
|
|
| 66 |
message: str
|
| 67 |
|
| 68 |
# Threat RA Router
|
| 69 |
+
threat_ra_router = APIRouter()
|
| 70 |
|
| 71 |
@threat_ra_router.post("/api/threat-ra/generate-threat-risks", response_model=ThreatRiskGenerationResponse)
|
| 72 |
def generate_threat_risks(request: ThreatRiskGenerationRequest):
|