mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 22:53:06 -04:00
prompt override
This commit is contained in:
parent
cde456f913
commit
9464b63f2b
1 changed files with 9 additions and 2 deletions
|
@ -16,20 +16,27 @@ module.exports = {
|
||||||
description_short: 'Talk to ChatGPT.',
|
description_short: 'Talk to ChatGPT.',
|
||||||
examples: ['chat How many otter species are there?'],
|
examples: ['chat How many otter species are there?'],
|
||||||
category: 'limited',
|
category: 'limited',
|
||||||
usage: 'chat <prompt>'
|
usage: 'chat <input> [-prompt <prompt override>]'
|
||||||
},
|
},
|
||||||
|
args: [
|
||||||
|
{ name: 'prompt', default: '', required: false, help: "The starting system prompt." },
|
||||||
|
],
|
||||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
if(!canUseLimitedTestCommands(context)) return;
|
if(!canUseLimitedTestCommands(context)) return;
|
||||||
context.triggerTyping();
|
context.triggerTyping();
|
||||||
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||||
|
|
||||||
|
let prompt = 'You are a friendly chat bot designed to help people. You should always use gender neutral pronouns when possible.'
|
||||||
|
if(args.prompt !== "") prompt = args.prompt
|
||||||
|
|
||||||
try{
|
try{
|
||||||
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
||||||
.set({
|
.set({
|
||||||
Authorization: process.env.AI_SERVER_KEY
|
Authorization: process.env.AI_SERVER_KEY
|
||||||
})
|
})
|
||||||
.send({
|
.send({
|
||||||
prompt: "You are a friendly chat bot designed to help people. You should always use gender neutral pronouns when possible.",
|
prompt: prompt,
|
||||||
input: [args.text],
|
input: [args.text],
|
||||||
temperature: 0.6,
|
temperature: 0.6,
|
||||||
model: "CHATGPT"
|
model: "CHATGPT"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue