const fetch = require('node-fetch'); async function queryBot(userMessage) { const response = await fetch('https://api.openai.com/v1/chat/completions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer YOUR_API_KEY_HERE` }, body: JSON.stringify({ model: 'gpt-4', messages: [{ role: 'user', content: userMessage }], }), }); const data = await response.json(); console.log(data.choices[0].message.content); } queryBot("What are the best products for e-commerce?");
Super Sale 30% off
Best Electronics Deals
Subscribe Newsletter
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book