mirror of https://github.com/itflow-org/itflow
add ticket description to AI Query
This commit is contained in:
parent
03bd7f837c
commit
b31f1b4c49
|
|
@ -1,5 +1,6 @@
|
|||
document.getElementById('rewordButton').addEventListener('click', function() {
|
||||
var textInput = document.getElementById('textInput');
|
||||
var ticketDescription = document.getElementById('ticketDescription');
|
||||
var rewordButton = document.getElementById('rewordButton');
|
||||
var undoButton = document.getElementById('undoButton');
|
||||
var previousText = textInput.value; // Store the current text
|
||||
|
|
@ -13,7 +14,7 @@ document.getElementById('rewordButton').addEventListener('click', function() {
|
|||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ text: textInput.value }),
|
||||
body: JSON.stringify({ text: textInput.value, description: ticketDescription.value }),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ if (isset($_GET['ai_reword'])) {
|
|||
$input = json_decode($inputJSON, TRUE); // Convert JSON into array.
|
||||
|
||||
// Prefix the input text with "reword: "
|
||||
$prefixedText = "reword: " . $input['text'];
|
||||
$prefixedText = "You are a technician at a help desk, training another technician. This is a response to the following issue " . $input['description'] . " Help me reword this for clarity and proffesionalism: " . $input['text'];
|
||||
|
||||
// Preparing the data for the OpenAI Chat API request.
|
||||
$data = [
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ if (isset($_GET['ticket_id'])) {
|
|||
<h3 class="card-title text-bold"><?php echo $ticket_subject; ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body prettyContent">
|
||||
<div class="card-body prettyContent" id="ticketDetails">
|
||||
<?php echo $ticket_details; ?>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue