File size: 1,338 Bytes
9d29c62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import asyncio
import os
import sys

# Set encoding for Windows console (just in case)
if sys.platform == 'win32':
    sys.stdout.reconfigure(encoding='utf-8')
    sys.stderr.reconfigure(encoding='utf-8')

from orchestrator import BuddyOrchestrator
from domain.processing_strategy import ProcessingStrategy
from smart_solver import SmartSolver

async def debug_orchestrator():
    orchestrator = BuddyOrchestrator()
    problem_text = "פתור את המשוואה הטריגונומטרית: sin x = 0.5"
    grade = "10"
    student_name = "דוד"

    print("🚀 Starting Smart Solver Trace...")
    try:
        data_anchor = {"function_equations": ["sin x = 0.5"]}
        result = await orchestrator.smart_solve(
            problem_text=problem_text,
            data_anchor=data_anchor,
            grade=grade,
            category="ALGEBRA",
            processing_strategy=ProcessingStrategy.STRICT_SYMBOLIC
        )
        
        import json
        with open("debug_output.json", "w", encoding="utf-8") as f:
            json.dump(result, f, indent=2, ensure_ascii=False)
        print("✅ Saved to debug_output.json")

    except Exception as e:
        print(f"❌ Error during execution: {e}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    asyncio.run(debug_orchestrator())