28 lines
1.3 KiB
PHP
Executable File
28 lines
1.3 KiB
PHP
Executable File
<?php
|
|
// WEVAL CONFIG UNIFIÉ - Inclure dans toutes les interfaces
|
|
function getWevalSettings() {
|
|
static $settings = null;
|
|
if ($settings) return $settings;
|
|
try {
|
|
$pdo = new PDO("pgsql:host=localhost;dbname=adx_system", "admin", "admin123");
|
|
$stmt = $pdo->query("SELECT setting_key, setting_value FROM weval_mind_settings");
|
|
$settings = [];
|
|
while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
$settings[$r['setting_key']] = $r['setting_value'];
|
|
}
|
|
return $settings;
|
|
} catch (Exception $e) {
|
|
return ['api_endpoint' => 'http://89.167.40.150:5821/weval-brain-providers.php', 'default_provider' => 'cerebras'];
|
|
}
|
|
}
|
|
function getApiEndpoint() { return getWevalSettings()['api_endpoint'] ?? 'http://89.167.40.150:5821/weval-brain-providers.php'; }
|
|
function getDefaultProvider() { return getWevalSettings()['default_provider'] ?? 'cerebras'; }
|
|
function getPromptInternal() { return getWevalSettings()['prompt_internal'] ?? 'Tu es WEVAL MIND.'; }
|
|
function getPromptPublic() { return getWevalSettings()['prompt_public'] ?? 'Tu es l\'assistant WEVAL.'; }
|
|
function isKBEnabled($interface) {
|
|
$s = getWevalSettings();
|
|
$ifs = json_decode($s['interfaces'] ?? '{}', true);
|
|
return $ifs[$interface]['kb'] ?? true;
|
|
}
|
|
|