MartyNattakit commited on
Commit
a3a8f3a
·
1 Parent(s): 67e4545

api/main.py

Browse files
Files changed (1) hide show
  1. api/main.py +7 -2
api/main.py CHANGED
@@ -74,7 +74,7 @@ class ClassifyRequest(BaseModel):
74
 
75
  class CWEPrediction(BaseModel):
76
  cwe_id: str
77
- cwe_name: str
78
  severity: str
79
  confidence: float
80
 
@@ -171,7 +171,12 @@ async def classify(request: ClassifyRequest):
171
 
172
  # Build alternatives list
173
  alternatives = [
174
- CWEPrediction(**alt) for alt in result.get("alternatives", [])
 
 
 
 
 
175
  ]
176
 
177
  # Build ATLAS match if present
 
74
 
75
  class CWEPrediction(BaseModel):
76
  cwe_id: str
77
+ description: str
78
  severity: str
79
  confidence: float
80
 
 
171
 
172
  # Build alternatives list
173
  alternatives = [
174
+ CWEPrediction(
175
+ cwe_id=alt["cwe_id"],
176
+ description=alt["description"],
177
+ severity=alt["severity"],
178
+ confidence=alt["confidence"],
179
+ ) for alt in result.get("alternatives", [])
180
  ]
181
 
182
  # Build ATLAS match if present