update endpoint

This commit is contained in:
derpystuff 2023-08-09 00:27:25 +02:00
parent cf62e33d19
commit 7076740ac3

View file

@ -22,14 +22,15 @@ module.exports = {
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).`)]})
try{ try{
let res = await superagent.post(`${process.env.AI_SERVER}/chatgpt`) 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: "You are a friendly chat bot designed to help people. You should always use gender neutral pronouns when possible.",
input: [args.text], input: [args.text],
temperature: 0.6 temperature: 0.6,
model: "CHATGPT"
}) })
return editOrReply(context, {embeds:[createEmbed("default", context, { return editOrReply(context, {embeds:[createEmbed("default", context, {
description: codeblock("ansi", ["👤 " + format(args.text, "cyan") + "\n🤖 " + res.body.output.substr(0, 2000 - args.text.length)]), description: codeblock("ansi", ["👤 " + format(args.text, "cyan") + "\n🤖 " + res.body.output.substr(0, 2000 - args.text.length)]),