petter2025 commited on
Commit
5447ba5
·
verified ·
1 Parent(s): be77688

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -481,23 +481,23 @@ class EnhancedReliabilityEngine:
481
  # Traditional detection (for compatibility)
482
  is_anomaly = anomaly_detector.detect_anomaly(event)
483
 
484
- # Enhanced severity classification using agent confidence
485
- agent_confidence = 0.0
486
- if "multi_agent_analysis" in locals() or "multi_agent_analysis" in globals():
487
- agent_confidence = agent_analysis.get('incident_summary', {}).get('anomaly_confidence', 0)
488
- else:
489
- # Fallback to basic anomaly detection confidence
490
- agent_confidence = 0.8 if is_anomaly else 0.1
491
 
492
- # Set severity based on confidence
493
- if agent_confidence > 0.8:
494
- event.severity = EventSeverity.CRITICAL
495
- elif agent_confidence > 0.6:
496
- event.severity = EventSeverity.HIGH
497
- elif agent_confidence > 0.4:
498
- event.severity = EventSeverity.MEDIUM
499
- else:
500
- event.severity = EventSeverity.LOW
501
 
502
  # Policy evaluation
503
  healing_actions = policy_engine.evaluate_policies(event)
 
481
  # Traditional detection (for compatibility)
482
  is_anomaly = anomaly_detector.detect_anomaly(event)
483
 
484
+ # Enhanced severity classification using agent confidence
485
+ agent_confidence = 0.0
486
+ if agent_analysis and 'incident_summary' in agent_analysis:
487
+ agent_confidence = agent_analysis.get('incident_summary', {}).get('anomaly_confidence', 0)
488
+ else:
489
+ # Fallback to basic anomaly detection confidence
490
+ agent_confidence = 0.8 if is_anomaly else 0.1
491
 
492
+ # Set severity based on confidence
493
+ if agent_confidence > 0.8:
494
+ event.severity = EventSeverity.CRITICAL
495
+ elif agent_confidence > 0.6:
496
+ event.severity = EventSeverity.HIGH
497
+ elif agent_confidence > 0.4:
498
+ event.severity = EventSeverity.MEDIUM
499
+ else:
500
+ event.severity = EventSeverity.LOW
501
 
502
  # Policy evaluation
503
  healing_actions = policy_engine.evaluate_policies(event)