Khrisna commited on
Commit
3b8f864
·
1 Parent(s): 113044c

Create chatgpt.js

Browse files
Files changed (1) hide show
  1. lib/chatgpt.js +50 -0
lib/chatgpt.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const axios = require("axios")
2
+
3
+ async function acytoo(text) {
4
+ let res = await axios.request({
5
+ method: "POST",
6
+ url: "https://chat.acytoo.com/api/completions",
7
+ data: JSON.stringify({
8
+ key: "",
9
+ messages: [{
10
+ role: "user",
11
+ content: text,
12
+ createAt: "",
13
+ }],
14
+ model: "gpt-3.5-turbo-0613",
15
+ password: "",
16
+ temprature: 1
17
+ }),
18
+ headres: {
19
+ "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",
20
+ "Origin": "https://chat.acytoo.com"
21
+ }
22
+ })
23
+ return res.data
24
+ }
25
+
26
+ async function chatgpt_4(text) {
27
+ let res = await axios.request({
28
+ method: "POST",
29
+ url: "https://deeply.cz/wp-json/mwai-ui/v1/chats/submit",
30
+ data: JSON.stringify({
31
+ botId: "default",
32
+ chatId: "",
33
+ contexId: 5072,
34
+ customId: null,
35
+ message: [],
36
+ newImageId: null,
37
+ newMessage: text + ",jawab dangan bahasa indonesia",
38
+ session: "N/A",
39
+ stream: false
40
+ }),
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ "X-Wp-Nonce": "1833972ea7",
44
+ "Referer": "https://deeply.cz/chat-gpt/"
45
+ }
46
+ })
47
+ return res.data
48
+ }
49
+
50
+ module.exports = { acytoo, chatgpt_4 }