Allowing users to add their own init prompt and replace the default for their own session

This commit is contained in:
Raven Scott 2023-04-03 00:20:06 +02:00
parent 962c108eec
commit 5bbbcb7c08
1 changed files with 12 additions and 0 deletions

View File

@ -19,9 +19,21 @@ module.exports = {
name: "create-session",
description: "create a new session chat",
private: true,
options: [{
"name": "init-prompt",
"description": "A prompt you want to init the chat with, a default is used if not provided.",
"required": false,
"type": 3 // 6 is type USER
}],
run: async (client, interaction) => {
const file = './cache/' + interaction.user.id
if (!interaction.options._hoistedOptions[0]){
console.log("-- No init-prompt provided, using default --")
} else [
initPrompt = interaction.options._hoistedOptions[0].value
]
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({
'accept': 'application/json'