Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -12,6 +12,7 @@ const jpegjs = require('jpeg-js')
|
|
| 12 |
const fileType = require("file-type")
|
| 13 |
const Stress = require('./lib/ddos.js');
|
| 14 |
//const { BingChat } = (await import("bing-chat")).default
|
|
|
|
| 15 |
const { sss_instagram, gramvio } = require("./lib/instagram.js")
|
| 16 |
const { allToJpg } = require("./lib/convertFormat.js")
|
| 17 |
const apikey = "@SadTeam77"
|
|
@@ -70,11 +71,25 @@ app.post('/api/chatgpt', async (req, res) => {
|
|
| 70 |
if (!status) return res.json({ success: false, message: 'Required an prompt text!' })
|
| 71 |
|
| 72 |
if(status !== apikey) return res.json({ success: false, message: 'Invalid status!' })
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
} catch (e) {
|
| 79 |
console.log(e)
|
| 80 |
e = String(e)
|
|
@@ -347,28 +362,6 @@ function toPDF(urls) {
|
|
| 347 |
}
|
| 348 |
})
|
| 349 |
}
|
| 350 |
-
async function acytoo(text, model) {
|
| 351 |
-
let res = await axios.request({
|
| 352 |
-
method: "POST",
|
| 353 |
-
url: "https://chat.acytoo.com/api/completions",
|
| 354 |
-
data: JSON.stringify({
|
| 355 |
-
key: "",
|
| 356 |
-
messages: [{
|
| 357 |
-
role: "user",
|
| 358 |
-
content: text,
|
| 359 |
-
createAt: "",
|
| 360 |
-
}],
|
| 361 |
-
model: model,
|
| 362 |
-
password: "",
|
| 363 |
-
temprature: 1
|
| 364 |
-
}),
|
| 365 |
-
headres: {
|
| 366 |
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
|
| 367 |
-
"Origin": "https://chat.acytoo.com"
|
| 368 |
-
}
|
| 369 |
-
})
|
| 370 |
-
return res.data
|
| 371 |
-
}
|
| 372 |
async function waifu2x(image, formats) {
|
| 373 |
// data
|
| 374 |
//let img = await axios.get(urls, { responseType: "arraybuffer"})
|
|
|
|
| 12 |
const fileType = require("file-type")
|
| 13 |
const Stress = require('./lib/ddos.js');
|
| 14 |
//const { BingChat } = (await import("bing-chat")).default
|
| 15 |
+
const { acytoo, chatgpt_4 } = require("./lib/chatgpt.js")
|
| 16 |
const { sss_instagram, gramvio } = require("./lib/instagram.js")
|
| 17 |
const { allToJpg } = require("./lib/convertFormat.js")
|
| 18 |
const apikey = "@SadTeam77"
|
|
|
|
| 71 |
if (!status) return res.json({ success: false, message: 'Required an prompt text!' })
|
| 72 |
|
| 73 |
if(status !== apikey) return res.json({ success: false, message: 'Invalid status!' })
|
| 74 |
+
if(model == "gpt-3") {
|
| 75 |
+
const response = await chatgpt_4(prompt)
|
| 76 |
+
res.json({
|
| 77 |
+
status: "ok",
|
| 78 |
+
result: response
|
| 79 |
+
})
|
| 80 |
+
} else if(model == "gpt-3.5") {
|
| 81 |
+
const response = await acytoo(prompt, "gpt-4")
|
| 82 |
+
res.json({
|
| 83 |
+
status: "ok",
|
| 84 |
+
result: response
|
| 85 |
+
})
|
| 86 |
+
} else if(model == "gpt-3") {
|
| 87 |
+
const response = await acytoo(prompt, "gpt-3.5-turbo")
|
| 88 |
+
res.json({
|
| 89 |
+
status: "ok",
|
| 90 |
+
result: response
|
| 91 |
+
})
|
| 92 |
+
}
|
| 93 |
} catch (e) {
|
| 94 |
console.log(e)
|
| 95 |
e = String(e)
|
|
|
|
| 362 |
}
|
| 363 |
})
|
| 364 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 365 |
async function waifu2x(image, formats) {
|
| 366 |
// data
|
| 367 |
//let img = await axios.get(urls, { responseType: "arraybuffer"})
|