Konversationen eingefügt
This commit is contained in:
5
api.php
5
api.php
@@ -5,11 +5,10 @@ require_once 'config.php';
|
||||
// Check if a POST request is sent
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
$user_message = $input['message'];
|
||||
$conversation = $input['conversation'];
|
||||
|
||||
// Prepare the command to execute the Python script
|
||||
// Note: Make sure `python` or `python3` is properly configured in your system's PATH.
|
||||
$command = escapeshellcmd("python3 assistant.py '$user_message'");
|
||||
$command = escapeshellcmd("python3 assistant.py '" . json_encode($conversation) . "'");
|
||||
$output = shell_exec($command);
|
||||
|
||||
// Decode the response from Python script
|
||||
|
||||
Reference in New Issue
Block a user