This repository contains a simple web application that provides a simple Node.JS chat application using the ChatGPT API through the streamed-chatgpt-api node library. Chat messages for each user are stored in memory.
Before you begin, ensure you have the following installed:
- Clone this repository:
git clone https://github.com/jddev273/simple-chatgpt-chat-streaming-demo.git
- Navigate to the project directory:
cd streamed-chatgpt-demo
- Install the required dependencies:
npm install
Set the OPENAPI_KEY environment variable. Ex. Linux/Unix.
Export OPENAI_API_KEY=your_openai_api_key_here
Or justset the apiKey variable to your api key in the chat route.
- Start the server:
npm start
- Open your browser and visit
http://localhost:3000
to interact with the AI assistant.
app.js
: The main entry point of the application, containing the server setup and route definitions.public/
: A folder containing the static assets served by the application, such as theindex.html
file and any client-side scripts or styles.
MIT Licensed
Johann Dowa