import os, argparse import gradio as gr from utils.logging_config import setup_logging, get_logger from utils.version import __version__ # Initialize logging early - will be reconfigured based on debug mode setup_logging() logger = get_logger(__name__) from handlers.mcp_backend import process_message_and_attached_file from ui.pages.chat import draw_chat_page # Store last chat message and file in global variables (for demo purposes) last_message_body = None last_attached_file = None # ========================= # APP # ========================= def app(debug: bool = False): """Main application function with optional debug mode""" # Configure logging based on debug mode if debug: os.environ["YUGA_DEBUG"] = "true" setup_logging("DEBUG") logger.info("Application started in DEBUG mode") else: os.environ["YUGA_DEBUG"] = "false" setup_logging("INFO") logger.info("Application started in normal mode") with gr.Blocks() as demo: gr.Markdown( """ # 🐍 Yuga Planner **Yuga Planner** is a neuro-symbolic system that combines AI agents with constraint optimization for intelligent scheduling. """ ) draw_chat_page(debug) # Version footer gr.Markdown( f"""