Files
wevads-platform/scripts/api_ai-bridge.php
2026-02-26 04:53:11 +01:00

22 lines
892 B
PHP
Executable File

<?php
header('Content-Type: application/json');
$action = $_POST['action'] ?? '';
$input = $_POST['input'] ?? '';
if ($action == 'voice') {
$res = shell_exec("python3 /opt/wevads/scripts/voice_commander.py");
echo json_encode(["response" => "🎤 Voice: " . ($res ?: "Aucun ordre détecté.")]);
} elseif ($action == 'vision') {
$res = shell_exec("python3 /opt/wevads/scripts/image_processor.py");
echo json_encode(["response" => "👁️ Vision: " . ($res ?: "Analyse du template terminée.")]);
} elseif ($action == 'learn') {
$res = shell_exec("python3 /opt/wevads/scripts/daily_self_learning.py");
echo json_encode(["response" => "🧠 Apprentissage: " . ($res ?: "Cortex mis à jour.")]);
} else {
$res = shell_exec("python3 /opt/wevads/scripts/brain_gateway.py '$input'");
echo json_encode(["response" => $res ?: "Hamid Claude réfléchit..."]);
}
?>