35428-vm/api/chat.php
Flatlogic Bot 2e3424ad5c v.2
2025-11-02 19:42:55 +00:00

17 lines
570 B
PHP

<?php
header('Content-Type: application/json');
// Simulate a delay
sleep(1);
// Get the message from the user
$input = json_decode(file_get_contents('php://input'), true);
$message = $input['message'] ?? 'No message received';
$persona_name = $input['persona']['name'] ?? 'Persona';
// A simple, canned response for now
$response = "This is a placeholder response from " . htmlspecialchars($persona_name) . ". You said: '" . htmlspecialchars($message) . "'. The real AI chat functionality will be implemented later.";
echo json_encode([
'reply' => $response
]);