File size: 3,836 Bytes
7bbd836
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96bfe42
 
7bbd836
96bfe42
7bbd836
 
 
 
 
 
 
 
 
 
 
 
96bfe42
 
7bbd836
 
 
96bfe42
7bbd836
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# 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)