Allowing users to add their own init prompt and replace the default for their own session
This commit is contained in:
parent
962c108eec
commit
5bbbcb7c08
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user