Riy777 commited on
Commit
d1e5af1
ยท
1 Parent(s): 7999d39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -1,4 +1,4 @@
1
- # app.py (V14.2 - Final Production Version - FULL CODE)
2
  import os
3
  import sys
4
  import traceback
@@ -57,7 +57,7 @@ async def initialize_system():
57
  if sys_state.ready:
58
  return
59
 
60
- print("\n๐Ÿ”Œ [System V14.2] Starting Full Initialization Sequence...")
61
 
62
  try:
63
  # 1. ุงู„ุจู†ูŠุฉ ุงู„ุชุญุชูŠุฉ ูˆุงู„ุจูŠุงู†ุงุช (Infrastructure Layer)
@@ -318,8 +318,17 @@ async def _run_explorer_mode_full():
318
  # LAYER 3: Omniscient Brain Validation (LLM)
319
  # ----------------------------------------------------------------------
320
  print("\n--- ๐Ÿง  Layer 3: Omniscient Brain Validation ---")
321
- approved_targets = []
322
 
 
 
 
 
 
 
 
 
 
 
323
  for cand in layer3_input_candidates:
324
  symbol = cand['symbol']
325
  print(f" โš–๏ธ Submitting {symbol} to Omniscient Brain for final verdict...")
@@ -327,7 +336,12 @@ async def _run_explorer_mode_full():
327
  decision = await llm_service.get_trading_decision(cand)
328
 
329
  if decision and decision.get('action') == 'WATCH':
330
- confidence = decision.get('confidence_level', 0.0)
 
 
 
 
 
331
  print(f" ๐ŸŽ‰ BRAIN APPROVED: {symbol} | Confidence: {confidence:.2f}")
332
  cand['llm_decision'] = decision
333
  approved_targets.append(cand)
@@ -359,7 +373,7 @@ async def lifespan(app: FastAPI):
359
  if data_manager: await data_manager.close()
360
  print("๐Ÿ‘‹ [System] Shutdown complete.")
361
 
362
- app = FastAPI(lifespan=lifespan, title="Titan Hybrid System V14.2 (Full Production)")
363
 
364
  @app.get("/")
365
  async def root():
 
1
+ # app.py (V14.3 - Production Fix & Enhanced Logging)
2
  import os
3
  import sys
4
  import traceback
 
57
  if sys_state.ready:
58
  return
59
 
60
+ print("\n๐Ÿ”Œ [System V14.3] Starting Full Initialization Sequence...")
61
 
62
  try:
63
  # 1. ุงู„ุจู†ูŠุฉ ุงู„ุชุญุชูŠุฉ ูˆุงู„ุจูŠุงู†ุงุช (Infrastructure Layer)
 
318
  # LAYER 3: Omniscient Brain Validation (LLM)
319
  # ----------------------------------------------------------------------
320
  print("\n--- ๐Ÿง  Layer 3: Omniscient Brain Validation ---")
 
321
 
322
+ # ๐Ÿ“ [ุฌุฏูŠุฏ] ุทุจุงุนุฉ ู‚ุงุฆู…ุฉ ุงู„ู…ุชุฃู‡ู„ูŠู† ู„ู„ุฏู…ุงุบ ู‚ุจู„ ุงู„ุฅุฑุณุงู„
323
+ if layer3_input_candidates:
324
+ print("๐Ÿ“‹ [L3 Qualification] The following candidates are advancing to Omniscient Brain:")
325
+ for i, cand in enumerate(layer3_input_candidates, 1):
326
+ l1 = cand.get('enhanced_final_score', 0)
327
+ l2 = cand.get('layer2_score', 0)
328
+ print(f" #{i} {cand['symbol']:<10} | L1: {l1:.3f} -> L2 Enhanced: {l2:.3f}")
329
+ print("-" * 50)
330
+
331
+ approved_targets = []
332
  for cand in layer3_input_candidates:
333
  symbol = cand['symbol']
334
  print(f" โš–๏ธ Submitting {symbol} to Omniscient Brain for final verdict...")
 
336
  decision = await llm_service.get_trading_decision(cand)
337
 
338
  if decision and decision.get('action') == 'WATCH':
339
+ # ๐Ÿ›ก๏ธ [FIX] ุชุญูˆูŠู„ ุขู…ู† ู„ู…ุณุชูˆู‰ ุงู„ุซู‚ุฉ ู„ู…ู†ุน ุงู†ู‡ูŠุงุฑ ุงู„ุชู†ุณูŠู‚
340
+ try:
341
+ confidence = float(decision.get('confidence_level', 0.0))
342
+ except (ValueError, TypeError):
343
+ confidence = 0.0
344
+
345
  print(f" ๐ŸŽ‰ BRAIN APPROVED: {symbol} | Confidence: {confidence:.2f}")
346
  cand['llm_decision'] = decision
347
  approved_targets.append(cand)
 
373
  if data_manager: await data_manager.close()
374
  print("๐Ÿ‘‹ [System] Shutdown complete.")
375
 
376
+ app = FastAPI(lifespan=lifespan, title="Titan Hybrid System V14.3 (Production Fixes)")
377
 
378
  @app.get("/")
379
  async def root():