mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
testing chatgpt logic
This commit is contained in:
parent
521a8eb704
commit
39781f5318
1 changed files with 10 additions and 0 deletions
10
app/chatgpt.js
Normal file
10
app/chatgpt.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
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);
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue