petter2025 commited on
Commit
89d1ac0
·
verified ·
1 Parent(s): 0b3ce9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -38,6 +38,7 @@ from models import (
38
  ReliabilityEvent, EventSeverity, AnomalyResult,
39
  HealingAction, ForecastResult, PolicyCondition
40
  )
 
41
  from healing_policies import PolicyEngine, DEFAULT_HEALING_POLICIES
42
 
43
  # === Logging Configuration ===
@@ -46,6 +47,8 @@ logging.basicConfig(
46
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
47
  )
48
  logger = logging.getLogger(__name__)
 
 
49
 
50
 
51
  # === CONSTANTS (FIXED: Extracted all magic numbers) ===
@@ -1534,7 +1537,14 @@ class EnhancedReliabilityEngine:
1534
 
1535
  logger.info(f"Event processed: {result['status']} with {result['severity']} severity")
1536
 
1537
- return result
 
 
 
 
 
 
 
1538
 
1539
 
1540
  # === Initialize Engine (with dependency injection) ===
 
38
  ReliabilityEvent, EventSeverity, AnomalyResult,
39
  HealingAction, ForecastResult, PolicyCondition
40
  )
41
+ from claude_adapter import get_claude_adapter
42
  from healing_policies import PolicyEngine, DEFAULT_HEALING_POLICIES
43
 
44
  # === Logging Configuration ===
 
47
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
48
  )
49
  logger = logging.getLogger(__name__)
50
+ # Initialize Claude adapter for AI reasoning
51
+ claude_adapter = get_claude_adapter()EnhancedReliabilityEngine
52
 
53
 
54
  # === CONSTANTS (FIXED: Extracted all magic numbers) ===
 
1537
 
1538
  logger.info(f"Event processed: {result['status']} with {result['severity']} severity")
1539
 
1540
+ # Enhance with Claude AI reasoning (optional layer)
1541
+ try:
1542
+ result = await self.enhance_with_claude(event, result)
1543
+ except Exception as e:
1544
+ logger.error(f"Failed to enhance with Claude: {e}")
1545
+ # Continue without enhancement
1546
+
1547
+ return result # ← Same return, but now with Claude enhancement
1548
 
1549
 
1550
  # === Initialize Engine (with dependency injection) ===