Created
December 31, 2025 12:04
-
-
Save ONLym22/6a95af763567f349f5e1422e2c3630c7 to your computer and use it in GitHub Desktop.
Uploaded via ONLym Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| π Name : Notegpt - Deepseek R1 | |
| π·οΈ Type : - | |
| π¦ Saluran : https://whatsapp.com/channel/0029Vb4HHTJFCCoYgkMjn93K | |
| π Base Url : https://notegpt.io | |
| π€ Creator : Hazel | |
| */ | |
| const axios = require('axios'); | |
| async function notegptAI(message) { | |
| if (!message) throw new Error('Message is required.'); | |
| try { | |
| const response = await axios.post( | |
| 'https://notegpt.io/api/v2/chat/stream', | |
| { | |
| message: message, | |
| language: 'ace', | |
| model: 'deepseek-reasoner', | |
| tone: 'default', | |
| length: 'moderate', | |
| conversation_id: '641eed40-0865-4dcf-9b90-39c868e4b710' | |
| }, | |
| { | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| responseType: 'stream' | |
| } | |
| ); | |
| return new Promise((resolve, reject) => { | |
| let resultText = ''; | |
| response.data.on('data', chunk => { | |
| const lines = chunk.toString().split('\n'); | |
| for (const line of lines) { | |
| if (line.startsWith('data:')) { | |
| const payload = line.replace(/^data:\s*/, ''); | |
| if (payload === '[DONE]') continue; | |
| try { | |
| const parsed = JSON.parse(payload); | |
| if (parsed.text) resultText += parsed.text; | |
| } catch (e) { | |
| } | |
| } | |
| } | |
| }); | |
| response.data.on('end', () => resolve(resultText)); | |
| response.data.on('error', reject); | |
| }); | |
| } catch (err) { | |
| throw new Error(err.response?.data?.message || err.message); | |
| } | |
| } | |
| // USAGE | |
| notegptAI('hai').then(console.log).catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment