petter2025 commited on
Commit
1c2c217
·
verified ·
1 Parent(s): 7f15bf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -383,6 +383,24 @@ class EnhancedReliabilityEngine:
383
 
384
  # Traditional detection (for compatibility)
385
  is_anomaly = anomaly_detector.detect_anomaly(event)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
 
387
  # Policy evaluation
388
  healing_actions = policy_engine.evaluate_policies(event)
 
383
 
384
  # Traditional detection (for compatibility)
385
  is_anomaly = anomaly_detector.detect_anomaly(event)
386
+
387
+ # Enhanced severity classification using agent confidence
388
+ agent_confidence = 0.0
389
+ if "multi_agent_analysis" in locals() or "multi_agent_analysis" in globals():
390
+ agent_confidence = agent_analysis.get('incident_summary', {}).get('anomaly_confidence', 0)
391
+ else:
392
+ # Fallback to basic anomaly detection confidence
393
+ agent_confidence = 0.8 if is_anomaly else 0.1
394
+
395
+ # Set severity based on confidence
396
+ if agent_confidence > 0.8:
397
+ event.severity = EventSeverity.CRITICAL
398
+ elif agent_confidence > 0.6:
399
+ event.severity = EventSeverity.HIGH
400
+ elif agent_confidence > 0.4:
401
+ event.severity = EventSeverity.MEDIUM
402
+ else:
403
+ event.severity = EventSeverity.LOW
404
 
405
  # Policy evaluation
406
  healing_actions = policy_engine.evaluate_policies(event)