Update index.js
Browse files
index.js
CHANGED
@@ -3,6 +3,8 @@ const app = express()
|
|
3 |
const axios = require('axios')
|
4 |
const {startServer} = require('./lifestyle');
|
5 |
|
|
|
|
|
6 |
var Database = require('./database.js');
|
7 |
|
8 |
app.get('/', (req, res) => {
|
@@ -52,14 +54,6 @@ app.get('/api/test', async (req, res) => {
|
|
52 |
}
|
53 |
})
|
54 |
|
55 |
-
const payload = (prompt) => ({
|
56 |
-
model: "gpt-4o",
|
57 |
-
prompt: prompt,
|
58 |
-
top_p: 1,
|
59 |
-
logprobs: null,
|
60 |
-
stop: null
|
61 |
-
});
|
62 |
-
|
63 |
const OpenaiRes = async (prompt) => {
|
64 |
try {
|
65 |
const EncodeUrl = "aHR0cHM6Ly9vcGVuYWktZ3B0LnJlbWl4cHJvamVjdC5vcmcv"
|
@@ -81,7 +75,7 @@ const OpenaiRes = async (prompt) => {
|
|
81 |
"Sec-Fetch-Site": "cross-site",
|
82 |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"
|
83 |
};
|
84 |
-
const response = await axios.post(url,
|
85 |
if (response.status === 200) {
|
86 |
return response.data.choices[0].message.content + "\n\nPowered By xtdevs";
|
87 |
}
|
|
|
3 |
const axios = require('axios')
|
4 |
const {startServer} = require('./lifestyle');
|
5 |
|
6 |
+
import {GptModelOld} from './models.js'
|
7 |
+
|
8 |
var Database = require('./database.js');
|
9 |
|
10 |
app.get('/', (req, res) => {
|
|
|
54 |
}
|
55 |
})
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
const OpenaiRes = async (prompt) => {
|
58 |
try {
|
59 |
const EncodeUrl = "aHR0cHM6Ly9vcGVuYWktZ3B0LnJlbWl4cHJvamVjdC5vcmcv"
|
|
|
75 |
"Sec-Fetch-Site": "cross-site",
|
76 |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"
|
77 |
};
|
78 |
+
const response = await axios.post(url, GptModelOld(prompt), { headers, timeout: 50000 });
|
79 |
if (response.status === 200) {
|
80 |
return response.data.choices[0].message.content + "\n\nPowered By xtdevs";
|
81 |
}
|