import gradio as gr import pandas as pd import logging from typing import Dict, Any, List, Optional # Import the reconstruction function that now expects a cache dictionary from services.report_data_handler import fetch_and_reconstruct_data_from_bubble # UI formatting functions try: from ui.insights_ui_generator import ( format_report_for_display, # REMOVED: extract_key_results_for_selection, - No longer directly used here for display # REMOVED: format_single_okr_for_display - No longer directly used here for display ) # NEW: Import the enhanced OKR display functions from ui.okr_ui_generator import format_okrs_for_enhanced_display, get_initial_okr_display AGENTIC_MODULES_LOADED = True except ImportError as e: logging.error(f"Could not import agentic pipeline display modules: {e}. Tabs 3 and 4 will be disabled.") AGENTIC_MODULES_LOADED = False # Placeholder functions for when modules are not loaded, ensuring return signatures match def format_report_for_display(report_data): return {'header_html': '