mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Added LocalAI
This commit is contained in:
@@ -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
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user