<?php

/**

 * AI Configuration File

 * Production-ready AI integration for School Finance System

 */



// AI Model Settings

define('AI_ENABLED', true);

define('AI_DEBUG_MODE', false); // Set to false in production

define('AI_CACHE_ENABLED', true);

define('AI_CACHE_TTL', 3600); // Cache predictions for 1 hour



// Model Paths

define('AI_MODELS_PATH', __DIR__ . '/ai_models/');

define('AI_TRAINING_DATA_PATH', __DIR__ . '/ai_training_data/');

define('AI_PREDICTIONS_CACHE', __DIR__ . '/cache/ai_predictions/');



// API Keys for external AI services — loaded from .env via config.php

define('AI_OPENAI_API_KEY', $_ENV['OPENAI_API_KEY'] ?? '');       // Optional: for advanced NLP

define('AI_HUGGINGFACE_API_KEY', $_ENV['HUGGINGFACE_API_KEY'] ?? ''); // Optional



// Prediction Thresholds

define('AI_DEFAULT_CONFIDENCE_THRESHOLD', 0.7);

define('AI_RISK_THRESHOLD_HIGH', 0.8);

define('AI_RISK_THRESHOLD_MEDIUM', 0.5);



// Create necessary directories

if (!file_exists(AI_MODELS_PATH)) mkdir(AI_MODELS_PATH, 0755, true);

if (!file_exists(AI_TRAINING_DATA_PATH)) mkdir(AI_TRAINING_DATA_PATH, 0755, true);

if (!file_exists(AI_PREDICTIONS_CACHE)) mkdir(AI_PREDICTIONS_CACHE, 0755, true);



// Include required classes

require_once 'ai_model.php';

require_once 'ai_predictor.php';

require_once 'ai_trainer.php';

require_once 'ai_recommendations.php';

?>