diff --git a/commands/system/new-chat.js b/commands/system/new-chat.js index 9a56554..90a16aa 100644 --- a/commands/system/new-chat.js +++ b/commands/system/new-chat.js @@ -51,12 +51,11 @@ module.exports = { } ], - - run: async (client, interaction) => { const file = './cache/' + interaction.user.id let options = interaction.options._hoistedOptions; + let varsToCheck = [ { name: "model", value: null }, { name: "temperature", value: null }, @@ -74,6 +73,7 @@ module.exports = { } } } + // Now you can access the values of each variable you are interested in: let userInputModel = varsToCheck.find(v => v.name === "model")?.value; let userInputTemperature = varsToCheck.find(v => v.name === "temperature")?.value; @@ -127,9 +127,8 @@ module.exports = { } } - - var req = unirest('POST', apiUrl + '?model=' + model + '&temperature=' + temperature + '&top_k=' + topK + '&top_p=' + topP + '&max_length=' + maxLength + '&context_window=' + contextWindow + '&repeat_last_n=' + repeatLastN + '&repeat_penalty=' + repeatPenalty + '&init_prompt=' + initPrompt + '&n_threads=' + nThreads) - .headers({ + const req = unirest('POST',`${apiUrl}?model=${model}&temperature=${temperature}&top_k=${topK}&top_p=${topP}&max_length=${maxLength}&context_window=${contextWindow}&repeat_last_n=${repeatLastN}&repeat_penalty=${repeatPenalty}&init_prompt=${initPrompt}&n_threads=${nThreads}`) + .headers({ 'accept': 'application/json' }) .send('')