Spaces:
Sleeping
Sleeping
| # app_config.py | |
| """ | |
| Application Configuration for Medical Assistant with Spiritual Support. | |
| This configuration file contains settings for the Gradio application, | |
| including theme settings, verification modes, and feature flags. | |
| Requirements: 1.3, 6.1 | |
| """ | |
| # Gradio UI Configuration | |
| GRADIO_CONFIG = { | |
| "theme": "soft", | |
| "show_api": False, | |
| "title": "Medical Assistant with Spiritual Support", | |
| "analytics_enabled": False, | |
| } | |
| # Enhanced Verification Modes Configuration | |
| ENHANCED_VERIFICATION_CONFIG = { | |
| # Enable/disable enhanced verification modes | |
| "enabled": True, | |
| # Default mode when entering enhanced verification | |
| "default_mode": None, # None = show mode selection, or "enhanced_dataset", "manual_input", "file_upload" | |
| # Session management settings | |
| "session": { | |
| "auto_save_interval_seconds": 30, | |
| "max_incomplete_sessions": 10, | |
| "session_timeout_hours": 24, | |
| }, | |
| # File upload settings | |
| "file_upload": { | |
| "max_file_size_mb": 50, | |
| "allowed_extensions": [".csv", ".xlsx", ".xls"], | |
| "max_rows_per_file": 10000, | |
| "preview_rows": 5, | |
| }, | |
| # Export settings | |
| "export": { | |
| "default_format": "csv", | |
| "available_formats": ["csv", "xlsx", "json"], | |
| "include_timestamps": True, | |
| "include_session_metadata": True, | |
| }, | |
| # Dataset editing settings | |
| "dataset_editing": { | |
| "require_confirmation_on_delete": True, | |
| "auto_backup_on_edit": True, | |
| "max_backup_versions": 5, | |
| }, | |
| # Progress tracking settings | |
| "progress_tracking": { | |
| "show_accuracy_percentage": True, | |
| "show_processing_speed": True, | |
| "show_time_estimates": True, | |
| }, | |
| } | |
| # Standard Verification Mode Configuration | |
| # NOTE: Standard Verification is now disabled as its functionality | |
| # has been integrated into Enhanced Verification modes | |
| STANDARD_VERIFICATION_CONFIG = { | |
| "enabled": False, # Disabled - functionality moved to Enhanced Verification | |
| "show_chaplain_feedback": True, | |
| "auto_save_results": True, | |
| } | |
| # Feature Flags | |
| FEATURE_FLAGS = { | |
| # Enhanced verification modes | |
| "enhanced_verification_enabled": True, | |
| "manual_input_mode_enabled": True, | |
| "file_upload_mode_enabled": True, | |
| "dataset_editing_enabled": True, | |
| # Standard verification - DISABLED (functionality moved to Enhanced Verification) | |
| "standard_verification_enabled": False, | |
| "chaplain_feedback_enabled": True, | |
| # Navigation features | |
| "show_mode_navigation_hints": False, # No need for hints since Standard is disabled | |
| "show_incomplete_session_prompts": True, | |
| # Export features | |
| "csv_export_enabled": True, | |
| "xlsx_export_enabled": True, | |
| "json_export_enabled": True, | |
| } | |
| # Logging Configuration | |
| LOGGING_CONFIG = { | |
| "log_level": "INFO", | |
| "log_verification_actions": True, | |
| "log_mode_switches": True, | |
| "log_export_operations": True, | |
| } | |
| def get_config(section: str = None): | |
| """ | |
| Get configuration settings. | |
| Args: | |
| section: Optional section name to retrieve specific config | |
| Returns: | |
| Configuration dictionary or specific section | |
| """ | |
| all_config = { | |
| "gradio": GRADIO_CONFIG, | |
| "enhanced_verification": ENHANCED_VERIFICATION_CONFIG, | |
| "standard_verification": STANDARD_VERIFICATION_CONFIG, | |
| "feature_flags": FEATURE_FLAGS, | |
| "logging": LOGGING_CONFIG, | |
| } | |
| if section: | |
| return all_config.get(section, {}) | |
| return all_config | |
| def is_feature_enabled(feature_name: str) -> bool: | |
| """ | |
| Check if a feature is enabled. | |
| Args: | |
| feature_name: Name of the feature flag | |
| Returns: | |
| True if feature is enabled, False otherwise | |
| """ | |
| return FEATURE_FLAGS.get(feature_name, False) | |