1 line
23 KiB
JSON
1 line
23 KiB
JSON
{"repo": "catgarmara/wazuh-security-chat", "files": {"docs/archive/CONFIGURATION_REFERENCE.md": {"ba8d4b65a0b42034394710519442f7a2a37e43f4": {"t": 1785746422.2351873, "n": 22520, "h": "562d827fb11435b1", "c": "# Configuration Reference - Multi-Model AI Chat Application\n\nComplete reference for all configuration options, environment variables, and settings in the multi-model AI chat application.\n\n## Table of Contents\n\n1. [Environment Variables](#environment-variables)\n2. [Feature Flags](#feature-flags)\n3. [Model Configuration](#model-configuration)\n4. [Security Settings](#security-settings)\n5. [Performance Configuration](#performance-configuration)\n6. [Configuration Files](#configuration-files)\n7. [Environment-Specific Settings](#environment-specific-settings)\n8. [Configuration Validation](#configuration-validation)\n\n## Environment Variables\n\n### Core Application Settings\n\n#### DEPLOYMENT_ENVIRONMENT\n- **Type**: String\n- **Default**: `development`\n- **Values**: `development`, `staging`, `production`, `testing`\n- **Description**: Sets the deployment environment and affects all other configuration defaults\n- **Example**: `DEPLOYMENT_ENVIRONMENT=production`\n\n#### FLASK_HOST\n- **Type**: String\n- **Default**: `127.0.0.1`\n- **Description**: Host address for the Flask server\n- **Examples**: \n - Development: `127.0.0.1` or `localhost`\n - Production: `0.0.0.0`\n\n#### FLASK_PORT\n- **Type**: Integer\n- **Default**: `5000`\n- **Range**: 1-65535\n- **Description**: Port number for the Flask server\n- **Examples**:\n - Development: `5000`\n - Production: `8000`, `80`, `443`\n\n#### FLASK_DEBUG\n- **Type**: Boolean\n- **Default**: Environment-specific (true for development, false for production)\n- **Description**: Enable Flask debug mode\n- **Values**: `true`, `false`\n- **Security**: Must be `false` in production\n\n#### FLASK_SECRET_KEY\n- **Type**: String\n- **Default**: None\n- **Required**: Production environment\n- **Description**: Secret key for Flask session security\n- **Length**: Minimum 32 characters recommended\n- **Example**: `FLASK_SECRET_KEY=your_random_32_character_secret_key_here`\n\n### AI Model Configuration\n\n#### DEEPSEEK_API_KEY\n- **Type**: String\n- **Default**: None\n- **Required**: Development, Staging, Production\n- **Description**: API key for DeepSeek AI model\n- **Format**: String (typically starts with 'sk-')\n- **Security**: Sensitive - store securely\n- **Example**: `DEEPSEEK_API_KEY=sk-your-deepseek-api-key-here`\n\n#### DEEPSEEK_BASE_URL\n- **Type**: String\n- **Default**: `https://api.deepseek.com`\n- **Description**: Base URL for DeepSeek API\n- **Example**: `DEEPSEEK_BASE_URL=https://api.deepseek.com/v1`\n\n#### DEEPSEEK_TIMEOUT\n- **Type**: Integer\n- **Default**: `30`\n- **Range**: 5-300\n- **Unit**: Seconds\n- **Description**: Timeout for DeepSeek API requests\n- **Example**: `DEEPSEEK_TIMEOUT=45`\n\n#### DEEPSEEK_MAX_TOKENS\n- **Type**: Integer\n- **Default**: `1000`\n- **Range**: 1-4000\n- **Description**: Maximum tokens for DeepSeek responses\n- **Example**: `DEEPSEEK_MAX_TOKENS=2000`\n\n#### DEEPSEEK_TEMPERATURE\n- **Type**: Float\n- **Default**: `0.7`\n- **Range**: 0.0-2.0\n- **Description**: Temperature for DeepSeek model responses\n- **Example**: `DEEPSEEK_TEMPERATURE=0.8`\n\n#### GEMINI_API_KEY\n- **Type**: String\n- **Default**: None\n- **Required**: Optional\n- **Description**: API key for Google Gemini AI model\n- **Security**: Sensitive - store securely\n- **Example**: `GEMINI_API_KEY=your-gemini-api-key-here`\n\n#### GEMINI_BASE_URL\n- **Type**: String\n- **Default**: None (uses Google's default)\n- **Description**: Base URL for Gemini API (if using custom endpoint)\n- **Example**: `GEMINI_BASE_URL=https://generativelanguage.googleapis.com`\n\n#### GEMINI_TIMEOUT\n- **Type**: Integer\n- **Default**: `30`\n- **Range**: 5-300\n- **Unit**: Seconds\n- **Description**: Timeout for Gemini API requests\n- **Example**: `GEMINI_TIMEOUT=40`\n\n#### GEMINI_MAX_TOKENS\n- **Type**: Integer\n- **Default**: `1000`\n- **Range**: 1-2048\n- **Description**: Maximum tokens for Gemini responses\n- **Example**: `GEMINI_MAX_TOKENS=1500`\n\n#### GEMINI_TEMPERATURE\n- **Type**: Float\n- **Default**: `0.7`\n- **Range**: 0.0-1.0\n- **Description**: Temperature for Gemini model responses\n- **Example**: `GEMINI_TEMPERATURE=0.6`\n\n### Security Configuration\n\n#### CORS_ORIGINS\n- **Type**: String (comma-separated)\n- **Default**: `http://localhost:3000,http://127.0.0.1:3000`\n- **Description**: Allowed CORS origins\n- **Examples**:\n - Development: `http://localhost:3000,http://127.0.0.1:3000`\n - Production: `https://yourdomain.com,https://app.yourdomain.com`\n- **Security**: Never use `*` in production\n\n#### MAX_MESSAGE_LENGTH\n- **Type**: Integer\n- **Default**: `1000`\n- **Range**: 100-10000\n- **Description**: Maximum length of user messages\n- **Example**: `MAX_MESSAGE_LENGTH=2000`\n\n#### RATE_LIMIT_PER_MINUTE\n- **Type**: Integer\n- **Default**: `60`\n- **Range**: 1-1000\n- **Description**: Maximum requests per minute per client\n- **Examples**:\n - Development: `100`\n - Production: `30`\n\n#### API_KEY_VALIDATION_ENABLED\n- **Type**: Boolean\n- **Default**: Environment-specific\n- **Description**: Enable API key validation on startup\n- **Values**: `true`, `false`\n\n### Session Configuration\n\n#### SESSION_TIMEOUT_HOURS\n- **Type**: Integer\n- **Default**: `24`\n- **Range**: 1-168 (1 week)\n- **Unit**: Hours\n- **Description**: Session expiration time\n- **Example**: `SESSION_TIMEOUT_HOURS=12`\n\n#### MAX_HISTORY_MESSAGES\n- **Type**: Integer\n- **Default**: `10`\n- **Range**: 1-100\n- **Description**: Maximum messages to keep in conversation history\n- **Example**: `MAX_HISTORY_MESSAGES=20`\n\n#### SESSION_CLEANUP_INTERVAL\n- **Type**: Integer\n- **Default**: `3600`\n- **Range**: 60-86400\n- **Unit**: Seconds\n- **Description**: Interval for cleaning up expired sessions\n- **Example**: `SESSION_CLEANUP_INTERVAL=1800`\n\n### Performance Configuration\n\n#### DEFAULT_TIMEOUT_SECONDS\n- **Type**: Integer\n- **Default**: `30`\n- **Range**: 5-300\n- **Unit**: Seconds\n- **Description**: Default timeout for AI client requests\n- **Example**: `DEFAULT_TIMEOUT_SECONDS=45`\n\n#### MAX_TIMEOUT_SECONDS\n- **Type**: Integer\n- **Default**: `300`\n- **Range**: 30-600\n- **Unit**: Seconds\n- **Description**: Maximum allowed timeout\n- **Constraint**: Must be >= DEFAULT_TIMEOUT_SECONDS\n- **Example**: `MAX_TIMEOUT_SECONDS=180`\n\n#### CONNECTION_POOL_SIZE\n- **Type**: Integer\n- **Default**: `10`\n- **Range**: 1-100\n- **Description**: Size of connection pool for AI clients\n- **Example**: `CONNECTION_POOL_SIZE=20`\n\n#### CACHE_TTL_SECONDS\n- **Type**: Integer\n- **Default**: `3600`\n- **Range**: 60-86400\n- **Unit**: Seconds\n- **Description**: Cache time-to-live\n- **Example**: `CACHE_TTL_SECONDS=7200`\n\n#### METRICS_RETENTION_DAYS\n- **Type**: Integer\n- **Default**: `7`\n- **Range**: 1-30\n- **Unit**: Days\n- **Description**: How long to retain performance metrics\n- **Example**: `METRICS_RETENTION_DAYS=14`\n\n### Logging Configuration\n\n#### LOG_LEVEL\n- **Type**: String\n- **Default**: Environment-specific\n- **Values**: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`\n- **Description**: Logging level\n- **Examples**:\n - Development: `DEBUG`\n - Production: `WARNING`\n\n#### LOG_FORMAT\n- **Type**: String\n- **Default**: `%(asctime)s - %(name)s - %(levelname)s - %(message)s`\n- **Description**: Log message format\n- **Example**: `LOG_FORMAT=%(asctime)s [%(levelname)s] %(name)s: %(message)s`\n\n#### LOG_FILE_PATH\n- **Type**: String\n- **Default**: None (console only)\n- **Description**: Path to log file\n- **Example**: `LOG_FILE_PATH=/var/log/chatapp/app.log`\n\n#### LOG_MAX_FILE_SIZE\n- **Type**: Integer\n- **Default**: `10485760` (10MB)\n- **Unit**: Bytes\n- **Description**: Maximum log file size before rotation\n- **Example**: `LOG_MAX_FILE_SIZE=52428800`\n\n#### LOG_BACKUP_COUNT\n- **Type**: Integer\n- **Default**: `5`\n- **Range**: 1-20\n- **Description**: Number of log backup files to keep\n- **Example**: `LOG_BACKUP_COUNT=10`\n\n### SOC (Security Operations Center) Configuration\n\n#### SOC_METADATA_ENABLED\n- **Type**: Boolean\n- **Default**: `true`\n- **Description**: Enable SOC metadata support\n- **Values**: `true`, `false`\n\n#### SOC_ALERT_ID_PREFIX\n- **Type**: String\n- **Default**: `ALERT`\n- **Description**: Prefix for SOC alert IDs\n- **Example**: `SOC_ALERT_ID_PREFIX=INCIDENT`\n\n#### SOC_MAX_INVESTIGATION_DEPTH\n- **Type**: Integer\n- **Default**: `5`\n- **Range**: 1-20\n- **Description**: Maximum depth for SOC investigations\n- **Example**: `SOC_MAX_INVESTIGATION_DEPTH=10`\n\n## Feature Flags\n\nFeature flags can be controlled via environment variables using the format `FEATURE_{FLAG_NAME}=true/false`.\n\n### Available Feature Flags\n\n#### FEATURE_PERFORMANCE_MONITORING\n- **Default**: `true`\n- **Description**: Enable performance monitoring and metrics collection\n- **Impact**: Affects response time tracking and performance analytics\n\n#### FEATURE_PERFORMANCE_CACHING\n- **Default**: `true`\n- **Description**: Enable response caching for improved performance\n- **Impact**: Reduces response times for repeated requests\n\n#### FEATURE_ERROR_RECOVERY\n- **Default**: `true`\n- **Description**: Enable automatic error recovery mechanisms\n- **Impact**: Provides retry logic and circuit breaker functionality\n\n#### FEATURE_SOC_METADATA\n- **Default**: `true`\n- **Description**: Enable SOC (Security Operations Center) metadata support\n- **Impact**: Allows security-specific request metadata and templates\n\n#### FEATURE_STREAMING_RESPONSES\n- **Default**: `true`\n- **Description**: Enable streaming responses from AI models\n- **Impact**: Provides real-time response streaming\n\n#### FEATURE_MODEL_SWITCHING\n- **Default**: `true`\n- **Description**: Enable switching between AI models during conversations\n- **Impact**: Allows users to switch models without losing conversation context\n\n#### FEATURE_DEBUG_MODE\n- **Default**: Environment-specific\n- **Description**: Enable debug mode features\n- **Impact**: Provides detailed error messages and debugging information\n\n#### FEATURE_METRICS_COLLECTION\n- **Default**: Environment-specific\n- **Description**: Enable metrics collection\n- **Impact**: Collects performance and usage metrics\n\n#### FEATURE_HEALTH_CHECKS\n- **Default**: `true`\n- **Description**: Enable health check endpoints\n- **Impact**: Provides /health and monitoring endpoints\n\n#### FEATURE_AUDIT_LOGGING\n- **Default**: Environment-specific\n- **Description**: Enable audit logging for security operations\n- **Impact**: Logs all security-relevant operations\n\n#### FEATURE_RATE_LIMITING\n- **Default**: `true`\n- **Description**: Enable rate limiting for API requests\n- **Impact**: Protects against abuse and ensures fair usage\n\n#### FEATURE_CORS_ENABLED\n- **Default**: `true`\n- **Description**: Enable CORS support\n- **Impact**: Allows cross-origin requests from specified origins\n\n## Model Configuration\n\n### Model-Specific Settings\n\nEach AI model can be configured with specific settings that override global defaults:\n\n#### DeepSeek Configuration\n```python\n{\n \"enabled\": True,\n \"api_key_env_var\": \"DEEPSEEK_API_KEY\",\n \"base_url_env_var\": \"DEEPSEEK_BASE_URL\",\n \"default_model\": \"deepseek-chat\",\n \"timeout\": 30,\n \"max_tokens\": 1000,\n \"temperature\": 0.7,\n \"fallback_models\": [\"gemini\"]\n}\n```\n\n#### Gemini Configuration\n```python\n{\n \"enabled\": True, # If API key is available\n \"api_key_env_var\": \"GEMINI_API_KEY\",\n \"base_url_env_var\": \"GEMINI_BASE_URL\",\n \"default_model\": \"gemini-pro\",\n \"timeout\": 30,\n \"max_tokens\": 1000,\n \"temperature\": 0.7,\n \"fallback_models\": [\"deepseek\"]\n}\n```\n\n### Environment-Specific Model Settings\n\nModels can have different settings per environment:\n\n```python\nenvironment_specific={\n Environment.DEVELOPMENT: {\n \"enabled\": True,\n \"timeout\": 10,\n \"max_tokens\": 500\n },\n Environment.STAGING: {\n \"enabled\": True,\n \"timeout\": 20,\n \"max_tokens\": 1000\n },\n Environment.PRODUCTION: {\n \"enabled\": True,\n \"timeout\": 30,\n \"max_tokens\": 2000\n },\n Environment.TESTING: {\n \"enabled\": False,\n \"timeout\": 5\n }\n}\n```\n\n## Security Settings\n\n### Security Configuration Matrix\n\n| Setting | Development | Staging | Production | Description |\n|---------|------------|---------|------------|-------------|\n| Debug Mode | ✅ Enabled | ❌ Disabled | ❌ Disabled | Debug information |\n| CORS Origins | `localhost:*` | Specific domains | Specific domains | Cross-origin requests |\n| Rate Limiting | 100/min | 60/min | 30/min | Request rate limits |\n| API Key Validation | ❌ Optional | ✅ Required | ✅ Required | Startup validation |\n| Secret Key | ❌ Optional | ❌ Optional | ✅ Required | Session security |\n| HTTPS | ❌ Optional | ✅ Recommended | ✅ Required | Transport security |\n| Audit Logging | ❌ Disabled | ✅ Enabled | ✅ Enabled | Security logging |\n\n### Security Validation Rules\n\n#### Production Security Requirements\n- Debug mode must be disabled\n- CORS origins must be explicitly configured (no wildcards)\n- Flask secret key must be set and >= 32 characters\n- Rate limiting must be enabled\n- API key validation must be enabled\n- Audit logging must be enabled\n\n#### Development Security Allowances\n- Debug mode allowed\n- CORS can include localhost\n- Secret key optional\n- Higher rate limits allowed\n- API key validation optional\n\n## Performance Configuration\n\n### Performance Settings Matrix\n\n| Setting | Development | Staging | Production | Description |\n|---------|------------|---------|------------|-------------|\n| Default Timeout | 10s | 20s | 30s | AI request timeout |\n| Max Timeout | 60s | 120s | 300s | Maximum allowed timeout |\n| Connection Pool | 5 | 10 | 20 | Client connection pool |\n| Cache TTL | 1h | 2h | 6h | Response cache duration |\n| Performance Monitoring | ✅ | ✅ | ✅ | Metrics collection |\n| Performance Caching | ✅ | ✅ | ✅ | Response caching |\n\n### Performance Optimization Settings\n\n#### High Performance Configuration\n```bash\n# Optimized for high throughput\nexport CONNECTION_POOL_SIZE=50\nexport DEFAULT_TIMEOUT_SECONDS=15\nexport CACHE_TTL_SECONDS=7200\nexport FEATURE_PERFORMANCE_CACHING=true\nexport FEATURE_PERFORMANCE_MONITORING=true\n```\n\n#### Low Latency Configuration\n```bash\n# Optimized for low latency\nexport DEFAULT_TIMEOUT_SECONDS=10\nexport MAX_TIMEOUT_SECONDS=30\nexport CONNECTION_POOL_SIZE=20\nexport CACHE_TTL_SECONDS=1800\n```\n\n#### Resource Constrained Configuration\n```bash\n# Optimized for limited resources\nexport CONNECTION_POOL_SIZE=3\nexport DEFAULT_TIMEOUT_SECONDS=20\nexport CACHE_TTL_SECONDS=900\nexport MAX_HISTORY_MESSAGES=5\nexport SESSION_TIMEOUT_HOURS=6\n```\n\n## Configuration Files\n\n### Configuration File Locations\n\nThe application supports loading configuration from JSON files:\n\n- `config/common.json` - Common settings for all environments\n- `config/development.json` - Development-specific settings\n- `config/staging.json` - Staging-specific settings\n- `config/production.json` - Production-specific settings\n- `config/testing.json` - Testing-specific settings\n\n### Configuration File Structure\n\n#### Base Configuration Format\n```json\n{\n \"server\": {\n \"host\": \"127.0.0.1\",\n \"port\": 5000,\n \"debug\": false\n },\n \"security\": {\n \"cors_origins\": [\"https://yourdomain.com\"],\n \"rate_limit_per_minute\": 60,\n \"max_message_length\": 1000\n },\n \"performance\": {\n \"default_timeout\": 30,\n \"max_timeout\": 300,\n \"connection_pool_size\": 10\n },\n \"session\": {\n \"timeout_hours\": 24,\n \"max_history_messages\": 10\n },\n \"logging\": {\n \"level\": \"INFO\",\n \"file_path\": \"/var/log/chatapp.log\"\n },\n \"features\": {\n \"performance_monitoring\": true,\n \"performance_caching\": true,\n \"error_recovery\": true,\n \"debug_mode\": false\n }\n}\n```\n\n#### Environment-Specific Overrides\n\n**config/development.json**:\n```json\n{\n \"server\": {\n \"debug\": true\n },\n \"logging\": {\n \"level\": \"DEBUG\"\n },\n \"features\": {\n \"debug_mode\": true\n },\n \"security\": {\n \"rate_limit_per_minute\": 100\n }\n}\n```\n\n**config/production.json**:\n```json\n{\n \"server\": {\n \"host\": \"0.0.0.0\",\n \"port\": 8000,\n \"debug\": false\n },\n \"logging\": {\n \"level\": \"WARNING\",\n \"file_path\": \"/var/log/chatapp/production.log\"\n },\n \"features\": {\n \"debug_mode\": false,\n \"audit_logging\": true\n },\n \"security\": {\n \"rate_limit_per_minute\": 30,\n \"cors_origins\": [\"https://yourdomain.com\"]\n }\n}\n```\n\n### Loading Configuration Files\n\n#### Via Command Line\n```bash\npython app.py --config config/production.json\n```\n\n#### Via Environment Variable\n```bash\nexport CONFIG_FILE=config/production.json\npython app.py\n```\n\n#### Programmatically\n```python\nfrom config_manager import ConfigurationManager\nconfig_mgr = ConfigurationManager(Environment.PRODUCTION, \"config/production.json\")\n```\n\n## Environment-Specific Settings\n\n### Development Environment\n\n**Purpose**: Local development and debugging\n\n**Key Characteristics**:\n- Debug mode enabled\n- Verbose logging\n- Relaxed security\n- Higher rate limits\n- Both models enabled if API keys available\n\n**Typical Configuration**:\n```bash\nexport DEPLOYMENT_ENVIRONMENT=development\nexport DEEPSEEK_API_KEY=your_dev_key\nexport FLASK_DEBUG=true\nexport LOG_LEVEL=DEBUG\nexport RATE_LIMIT_PER_MINUTE=100\nexport FEATURE_DEBUG_MODE=true\n```\n\n### Staging Environment\n\n**Purpose**: Production-like testing\n\n**Key Characteristics**:\n- Production-like security\n- Moderate logging\n- Both models enabled\n- Performance monitoring\n- Deployment validation\n\n**Typical Configuration**:\n```bash\nexport DEPLOYMENT_ENVIRONMENT=staging\nexport DEEPSEEK_API_KEY=your_staging_key\nexport GEMINI_API_KEY=your_staging_gemini_key\nexport CORS_ORIGINS=https://staging.yourdomain.com\nexport LOG_LEVEL=INFO\nexport RATE_LIMIT_PER_MINUTE=60\nexport FEATURE_DEBUG_MODE=false\nexport FEATURE_AUDIT_LOGGING=true\n```\n\n### Production Environment\n\n**Purpose**: Live production deployment\n\n**Key Characteristics**:\n- Maximum security\n- Minimal logging\n- Audit logging enabled\n- Strict rate limiting\n- Performance optimization\n- Required secret key\n\n**Typical Configuration**:\n```bash\nexport DEPLOYMENT_ENVIRONMENT=production\nexport DEEPSEEK_API_KEY=your_production_key\nexport GEMINI_API_KEY=your_production_gemini_key\nexport FLASK_SECRET_KEY=your_32_char_secret_key\nexport CORS_ORIGINS=https://yourdomain.com\nexport FLASK_HOST=0.0.0.0\nexport FLASK_PORT=8000\nexport LOG_LEVEL=WARNING\nexport RATE_LIMIT_PER_MINUTE=30\nexport FEATURE_DEBUG_MODE=false\nexport FEATURE_AUDIT_LOGGING=true\nexport CONNECTION_POOL_SIZE=20\n```\n\n### Testing Environment\n\n**Purpose**: Automated testing\n\n**Key Characteristics**:\n- Models disabled by default\n- Minimal logging\n- Fast timeouts\n- No external dependencies\n- Validation optional\n\n**Typical Configuration**:\n```bash\nexport DEPLOYMENT_ENVIRONMENT=testing\nexport LOG_LEVEL=ERROR\nexport DEFAULT_TIMEOUT_SECONDS=5\nexport SESSION_TIMEOUT_HOURS=1\nexport FEATURE_PERFORMANCE_MONITORING=false\nexport FEATURE_AUDIT_LOGGING=false\n```\n\n## Configuration Validation\n\n### Validation Categories\n\nThe configuration validation system checks multiple categories:\n\n#### Environment Variables\n- Required variables for each environment\n- Variable format and length validation\n- Security-sensitive variable validation\n\n#### Model Configuration\n- API key availability and format\n- Model enablement per environment\n- Timeout and parameter validation\n\n#### Security Configuration\n- CORS origin validation\n- Rate limiting settings\n- Debug mode restrictions\n- Secret key requirements\n\n#### Performance Configuration\n- Timeout relationship validation\n- Connection pool size validation\n- Cache configuration validation\n\n#### Deployment Readiness\n- Environment-specific requirements\n- Critical error detection\n- Warning assessment\n\n### Validation Levels\n\n#### Basic Validation\n- Essential functionality checks\n- Required environment variables\n- Basic model availability\n\n#### Standard Validation (Default)\n- Comprehensive configuration validation\n- Security setting checks\n- Performance configuration validation\n\n#### Strict Validation\n- Enhanced security validation\n- Performance optimization checks\n- Best practice compliance\n\n#### Deployment Validation\n- Production readiness assessment\n- Complete security validation\n- Performance optimization verification\n\n### Running Validation\n\n#### Command Line Validation\n```bash\n# Basic validation\npython validate_deployment.py development\n\n# Strict validation\npython validate_deployment.py production --level strict\n\n# Deployment validation\npython validate_deployment.py production --level deployment\n```\n\n#### API Validation\n```bash\n# Validate current configuration\ncurl -X POST http://localhost:5000/config/validate\n\n# Validate with specific level\ncurl -X POST http://localhost:5000/config/validate \\\n -H \"Content-Type: application/json\" \\\n -d '{\"level\": \"strict\"}'\n```\n\n#### Programmatic Validation\n```python\nfrom config_manager import ConfigurationManager, ValidationLevel\n\nconfig_mgr = ConfigurationManager(Environment.PRODUCTION)\nconfig_mgr._validate_configuration(ValidationLevel.DEPLOYMENT)\n\nvalidation_summary = config_mgr.get_validation_summary()\nprint(f\"Valid: {validation_summary['is_valid']}\")\n```\n\n### Validation Results\n\n#### Validation Summary Format\n```json\n{\n \"is_valid\": true,\n \"last_validation\": \"2024-01-15T10:30:00Z\",\n \"environment\": \"production\",\n \"issue_counts\": {\n \"errors\": 0,\n \"warnings\": 2,\n \"info\": 1,\n \"total\": 3\n },\n \"issues\": [\n {\n \"level\": \"warning\",\n \"category\": \"performance\",\n \"key\": \"connection_pool_size\",\n \"message\": \"Connection pool size is small (5)\",\n \"suggestion\": \"Consider increasing pool size for better performance\",\n \"environment\": \"production\"\n }\n ]\n}\n```\n\n#### Issue Categories\n- **error**: Critical issues that prevent deployment\n- **warning**: Issues that should be addressed but don't block deployment\n- **info**: Informational messages about configuration choices\n\n### Validation Integration\n\n#### CI/CD Integration\n```yaml\n# GitHub Actions example\n- name: Validate Configuration\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n FLASK_SECRET_KEY: ${{ secrets.FLASK_SECRET_KEY }}\n run: |\n python validate_deployment.py production --level deployment\n if [ $? -ne 0 ]; then\n echo \"Configuration validation failed\"\n exit 1\n fi\n```\n\n#### Docker Integration\n```dockerfile\n# Validate configuration during build\nRUN python validate_deployment.py production --quiet || \\\n (echo \"Configuration validation failed\" && exit 1)\n```\n\n#### Kubernetes Health Checks\n```yaml\nreadinessProbe:\n httpGet:\n path: /deployment/readiness\n port: 8000\n initialDelaySeconds: 5\n periodSeconds: 10\n```\n\nThis configuration reference provides complete documentation for all configuration options and settings in the multi-model AI chat application."}}}} |