Antigravity Agent commited on
Commit
a8bc4f1
·
1 Parent(s): 575d372

feat(core): enable REAL-MODE - activated live API reasoning and removed mock fallbacks

Browse files
Files changed (3) hide show
  1. llm_agent.py +1 -3
  2. ocr_module.py +2 -10
  3. reasoning_engine.py +4 -4
llm_agent.py CHANGED
@@ -69,9 +69,7 @@ def _smart_solve(problem: str):
69
  return res, [f"Arithmetic Calculation: {clean}", f"Result: {res}"]
70
  except: pass
71
 
72
- # 3. Domain-specific fallbacks
73
- if 'int' in problem.lower() and 'sin' in problem.lower() and 'pi' in problem.lower():
74
- return "0.7799", ["Fresnel integral approximation", "Result: ≈ 0.7799"]
75
 
76
  return None, []
77
 
 
69
  return res, [f"Arithmetic Calculation: {clean}", f"Result: {res}"]
70
  except: pass
71
 
72
+ return None, []
 
 
73
 
74
  return None, []
75
 
ocr_module.py CHANGED
@@ -126,16 +126,8 @@ class MVM2OCREngine:
126
  print(f"[OCR] Inference error: {e}")
127
  raw_latex = f"OCR Error: {str(e)}"
128
  else:
129
- # Simulation mode: use filename heuristics for demo
130
- fname = os.path.basename(image_path).lower()
131
- if "fresnel" in fname or "integral" in fname or "test_math" in fname:
132
- raw_latex = r"\int_{0}^{\pi} \sin(x^{2}) \, dx"
133
- elif "algebra" in fname or "linear" in fname:
134
- raw_latex = r"2x + 4 = 10"
135
- elif "quadratic" in fname:
136
- raw_latex = r"x^2 - 5x + 6 = 0"
137
- else:
138
- raw_latex = "No math detected (OCR model not loaded)."
139
 
140
  # Final CJK cleanup pass (catches anything that slipped through)
141
  raw_latex = clean_latex_output(raw_latex)
 
126
  print(f"[OCR] Inference error: {e}")
127
  raw_latex = f"OCR Error: {str(e)}"
128
  else:
129
+ # Simulation mode disabled. If Pix2Text is not loaded, we return empty so the user knows.
130
+ raw_latex = "No math detected (OCR model not loaded)."
 
 
 
 
 
 
 
 
131
 
132
  # Final CJK cleanup pass (catches anything that slipped through)
133
  raw_latex = clean_latex_output(raw_latex)
reasoning_engine.py CHANGED
@@ -9,10 +9,10 @@ import llm_agent
9
  # For Hugging Face Spaces we default all agents to simulated mode so that
10
  # the demo does not depend on external API keys or outbound network access.
11
  AGENT_PROFILES = [
12
- {"name": "GPT-4", "use_real_api": False},
13
- {"name": "Llama 3", "use_real_api": False},
14
- {"name": "Gemini 2.0 Pro", "use_real_api": False},
15
- {"name": "Qwen-2.5-Math-7B", "use_real_api": False},
16
  ]
17
 
18
  def run_agent_orchestrator(problem: str) -> List[Dict[str, Any]]:
 
9
  # For Hugging Face Spaces we default all agents to simulated mode so that
10
  # the demo does not depend on external API keys or outbound network access.
11
  AGENT_PROFILES = [
12
+ {"name": "Gemini 2.0 Flash (Primary)", "use_real_api": True},
13
+ {"name": "Llama 3 (Agentic Mode)", "use_real_api": True},
14
+ {"name": "GPT-4 (Verification Layer)", "use_real_api": True},
15
+ {"name": "Qwen-2.5-Math (Symbolic Focus)", "use_real_api": True},
16
  ]
17
 
18
  def run_agent_orchestrator(problem: str) -> List[Dict[str, Any]]: