This is a toy app submitted as a final product for a web-development course.
It provides a "chatting" experience with the text-davinci-003 language model using OpenAI's public API.
Every such correspondence is saved as a log document in the backend's noSQL database.
- An OpenAI account.
- Node.js
- MongoDB Community Server
- MongoDB Compass
Download MongoDB Community Server first.
In the setup wizard, de-check the Compass installation option.
When finished, download and install Compass separately.
In ./server/ create a new file "secret.js" with the following content and all placeholders replaced to appropriate values:
const user = 'PLACEHOLDER'; // username to login into administrative section
const pass = 'PLACEHOLDER'; // password to login ...
const secret = 'PLACEHOLDER'; // some secret, could be a random string
const org = 'PLACEHOLDER'; // OpenAI personal organization string
const key = 'PLACEHOLDER'; // OpenAI API key
module.exports = {
user,
pass,
secret,
org,
key
}
*Note: you can find your account's API key here, and your organization ID here.
Run the following commands by order:
git clone https://github.com/yuval-ro/openai-app.git
npm upgrade
npm install
npm start
nodemon ./server/index.js
The React app will run on port 3000, while the server on 3001.
In a web browser, navigate to http://localhost:3000/ and test the app.
*Note: if you receive a status code 429 from the API, that means you have exhausted the request limit.
Refer to table below before opening any new issues / PRs:
Type of Cont. | Accepted |
---|---|
Pull requests | ✔️ |
Security issues | ✔️ |
Other issues | ❌ |
Licensed under the GPLv3, Copyright (c) 2023 yuval-ro. All rights reserved.