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

13 lines
638 B
PHP
Executable File

<?php
set_time_limit(300);
header('Content-Type: application/json');
$task = $_POST['task'] ?? '';
if (empty($task)) { echo json_encode(['error' => 'Task required']); exit; }
$ctx = stream_context_create(['http' => ['method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => json_encode(['message' => "Execute: $task", 'provider' => 'mistral']), 'timeout' => 30], 'ssl' => ['verify_peer' => false]]);
$resp = @file_get_contents("https://127.0.0.1:8443/hamid-api.php", false, $ctx);
$data = json_decode($resp, true);
echo json_encode(['success' => true, 'task' => $task, 'result' => $data['response'] ?? 'Erreur']);