petter2025 commited on
Commit
5c30134
·
verified ·
1 Parent(s): 49293a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -145,8 +145,10 @@ def get_inactive_agent_html(agent_name: str, description: str):
145
  </div>
146
  """
147
 
 
 
148
  # ===========================================
149
- # REAL ARF ORCHESTRATOR (Replaces FixedDemoOrchestrator)
150
  # ===========================================
151
  class RealARFOrchestrator:
152
  """
@@ -159,6 +161,13 @@ class RealARFOrchestrator:
159
  self.real_arf_available = False
160
  self.arf_integration = None
161
 
 
 
 
 
 
 
 
162
  # Try to initialize real ARF integration
163
  try:
164
  # Check if our real ARF integration is available
@@ -180,13 +189,15 @@ class RealARFOrchestrator:
180
 
181
  def _init_mock_fallback(self):
182
  """Initialize mock fallback functions with scenario-aware metrics"""
183
- # We'll use the enhanced mock ARF functions
184
- # These will be loaded lazily when needed
185
  self._mock_functions_loaded = False
186
  self._simulate_arf_analysis = None
187
  self._run_rag_similarity_search = None
188
  self._create_mock_healing_intent = None
189
  self._calculate_pattern_confidence = None
 
 
 
190
 
191
  def _load_mock_functions(self):
192
  """Lazy load enhanced mock ARF functions with scenario-aware metrics"""
@@ -482,10 +493,11 @@ class RealARFOrchestrator:
482
  """Fallback mock analysis with scenario-aware metrics"""
483
  logger.info(f"Using scenario-aware mock analysis for: {scenario_name}")
484
 
485
- # Load mock functions if not loaded
486
- self._load_mock_functions()
487
-
488
  try:
 
 
 
 
489
  # Add scenario name to data
490
  scenario_data_with_name = scenario_data.copy()
491
  scenario_data_with_name["name"] = scenario_name
 
145
  </div>
146
  """
147
 
148
+ # Replace the RealARFOrchestrator class in app.py with this fixed version:
149
+
150
  # ===========================================
151
+ # REAL ARF ORCHESTRATOR (FIXED VERSION)
152
  # ===========================================
153
  class RealARFOrchestrator:
154
  """
 
161
  self.real_arf_available = False
162
  self.arf_integration = None
163
 
164
+ # Initialize mock function attributes FIRST
165
+ self._mock_functions_loaded = False
166
+ self._simulate_arf_analysis = None
167
+ self._run_rag_similarity_search = None
168
+ self._create_mock_healing_intent = None
169
+ self._calculate_pattern_confidence = None
170
+
171
  # Try to initialize real ARF integration
172
  try:
173
  # Check if our real ARF integration is available
 
189
 
190
  def _init_mock_fallback(self):
191
  """Initialize mock fallback functions with scenario-aware metrics"""
192
+ # Initialize the mock function attributes
 
193
  self._mock_functions_loaded = False
194
  self._simulate_arf_analysis = None
195
  self._run_rag_similarity_search = None
196
  self._create_mock_healing_intent = None
197
  self._calculate_pattern_confidence = None
198
+
199
+ # We'll load the functions lazily when needed
200
+ logger.info("Mock fallback initialized - functions will load on demand")
201
 
202
  def _load_mock_functions(self):
203
  """Lazy load enhanced mock ARF functions with scenario-aware metrics"""
 
493
  """Fallback mock analysis with scenario-aware metrics"""
494
  logger.info(f"Using scenario-aware mock analysis for: {scenario_name}")
495
 
 
 
 
496
  try:
497
+ # Load mock functions if not loaded
498
+ if not self._mock_functions_loaded:
499
+ self._load_mock_functions()
500
+
501
  # Add scenario name to data
502
  scenario_data_with_name = scenario_data.copy()
503
  scenario_data_with_name["name"] = scenario_name