Added LocalAI

This commit is contained in:
johnnyq
2024-02-10 21:25:18 -05:00
parent a1d642c54b
commit 48ba4445bf
2 changed files with 5 additions and 1 deletions

View File

@@ -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
];