mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
free gpt
This commit is contained in:
parent
317613923f
commit
77ca289d1e
1 changed files with 9 additions and 5 deletions
|
@ -22,12 +22,16 @@ module.exports = {
|
|||
context.triggerTyping();
|
||||
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||
try{
|
||||
let res = await superagent.get(`${process.env.AI_SERVER}/chat`)
|
||||
.query({
|
||||
prompt: args.text
|
||||
})
|
||||
let res = await superagent.post(`${process.env.AI_SERVER}/chatgpt`)
|
||||
.set({
|
||||
Authorization: process.env.AI_SERVER_KEY
|
||||
})
|
||||
.send({
|
||||
prompt: "You are a friendly chat bot designed to help people.",
|
||||
input: [args.text]
|
||||
})
|
||||
return editOrReply(context, {embeds:[createEmbed("default", context, {
|
||||
description: codeblock("ansi", ["👤 " + format(args.text, "cyan") + "\n🤖 " + res.body.text]),
|
||||
description: codeblock("ansi", ["👤 " + format(args.text, "cyan") + "\n🤖 " + res.body.output]),
|
||||
footer: {
|
||||
text: `This information may be inaccurate or biased • ${context.application.name}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue