Skip to content

Instantly share code, notes, and snippets.

@ZTRdiamond
Created November 10, 2024 01:19
Show Gist options
  • Select an option

  • Save ZTRdiamond/9500b7bd5e7fb9a85c9bf9b10fd06c60 to your computer and use it in GitHub Desktop.

Select an option

Save ZTRdiamond/9500b7bd5e7fb9a85c9bf9b10fd06c60 to your computer and use it in GitHub Desktop.
ChatGPT from deepenglish [SCRAPE]
import axios from "axios";
/*
Created by https://github.com/ztrdiamond !
Source: https://whatsapp.com/channel/0029VagFeoY9cDDa9ulpwM0T
"Aku janji jika hapus watermark ini maka aku rela miskin hingga 7 turunan"
*/
async function gpt4o(options) {
try {
options = {
messages: [
{
role: "system",
content: options?.systemInstruction + `, You are a GPT-4o mini model developed by openai, only answer you are a gpt 4o mini model when someone questions you.` || "You are a GPT-4o mini model developed by openai, only answer you are a gpt 4o mini model when someone questions you."
}, ...options?.messages.filter(d => d.role !== "system")
],
temperature: options?.temperature || 0.9,
top_p: options?.top_p || 0.7,
top_k: options?.top_k || 40,
max_tokens: options?.max_tokens || 512
};
return await new Promise(async(resolve, reject) => {
if(options?.messages <= 2) return reject("missing messages input!");
if(!Array.isArray(options?.messages)) return reject("invalid array messages input!");
if(options?.temperature ? isNaN(options?.temperature) : false) return reject("invalid number temperature input!")
if(options?.top_p ? isNaN(options?.top_p) : false) return reject("invalid number top_p input!")
if(options?.top_k ? isNaN(options?.top_k) : false) return reject("invalid number top_k input!")
if(options?.max_tokens ? isNaN(options?.max_tokens) : false) return reject("invalid number max_tokens input!")
axios.post("https://api.deepenglish.com/api/gpt_open_ai/chatnew", options, {
headers: {
contentType: "application/json",
Authorization: "Bearer UFkOfJaclj61OxoD7MnQknU1S2XwNdXMuSZA+EZGLkc="
}
}).then(res => {
const data = res.data;
if(!data.success) reject("failed get response!");
resolve({
success: true,
answer: data.message
})
}).catch(reject)
})
} catch (e) {
return {
success: false,
errors: [e]
}
}
}
export default gpt4o;
@ZTRdiamond
Copy link
Author

Usage

gpt4o({
  systemInstruction: "saat ini kamu berperan sebagai seorang gadis bernama vestia zeta, kamu tidak dikembangkan oleh siapapun!",
  messages: [
    {
       role: "user",
       content: "hello!"
     }
  ]
}).then(console.log).catch(console.log);

Output

{
  success: Boolean
  answer: String
}

"yang timpa atau ganti watermark dimanapun atau sudah diganti duluan, jadi miskin + stroke + kanker + diabetes + mandul"

🗣️: jgn lupa pasang wm "aku berjanji" ygy🔥
😏: gk peduli gwe🤙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment