diff --git a/post/ai.php b/post/ai.php index 965556d1..4ab0f301 100644 --- a/post/ai.php +++ b/post/ai.php @@ -12,11 +12,14 @@ if (isset($_GET['ai_reword'])) { $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, TRUE); // Convert JSON into array. + // Prefix the input text with "reword: " + $prefixedText = "reword: " . $input['text']; + // Preparing the data for the OpenAI Chat API request. $data = [ "model" => "$config_ai_model", // Specify the model "messages" => [ - ["role" => "user", "content" => $input['text']] + ["role" => "user", "content" => $prefixedText] ], "temperature" => 0.7 ]; diff --git a/settings_ai.php b/settings_ai.php index dc8ee6c9..76292c7a 100644 --- a/settings_ai.php +++ b/settings_ai.php @@ -21,6 +21,7 @@ require_once "inc_all_settings.php"; +