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())