mirror of https://github.com/itflow-org/itflow
Added LocalAI
This commit is contained in:
parent
a1d642c54b
commit
48ba4445bf
|
|
@ -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
|
||||
];
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ require_once "inc_all_settings.php";
|
|||
<option value="" <?php if($config_ai_enable == 0) { echo "selected"; } ?> >Disabled</option>
|
||||
<option <?php if($config_ai_provider == "Ollama") { echo "selected"; } ?> >Ollama</option>
|
||||
<option <?php if($config_ai_provider == "OpenAI") { echo "selected"; } ?> >OpenAI</option>
|
||||
<option <?php if($config_ai_provider == "LocalAI") { echo "selected"; } ?> >LocalAI</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue