mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
10 lines
287 B
JavaScript
10 lines
287 B
JavaScript
require('dotenv').config();
|
|
(async () => {
|
|
const { ChatGPTAPI } = await import('chatgpt');
|
|
|
|
const api = new ChatGPTAPI({ apiKey: process.env.OPENAI_KEY });
|
|
|
|
// send a message and wait for the response
|
|
let res = await api.sendMessage('What is OpenAI?');
|
|
console.log(res);
|
|
})();
|