sshChat-CLI/commands/AI.js

14 lines
440 B
JavaScript
Raw Normal View History

2023-01-11 20:48:57 +00:00
// AI.js
var unirest = require('unirest');
async function AIRequest(prompt) {
console.log("Please wait while the AI thinks about this....\n")
let AIRequest = await unirest
.post('https://codex-ai-v9q6.onrender.com/')
.headers({ 'Accept': 'application/json', 'Content-Type': 'application/json' })
.send({ "prompt": prompt })
2023-01-11 21:53:49 +00:00
console.log(AIRequest.body.bot)
2023-01-11 20:48:57 +00:00
return AIRequest.body.bot
}
module.exports = { AIRequest }