Coder Social home page Coder Social logo

simple-chatgpt-chat-streaming-demo's Introduction

Streamed ChatGPT API Demo

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.

Video Demo

Streaming Chat Demo

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (LTS or higher)
  • npm (comes bundled with Node.js)

Installation

  1. Clone this repository:
git clone https://github.com/jddev273/simple-chatgpt-chat-streaming-demo.git
  1. Navigate to the project directory:
cd streamed-chatgpt-demo
  1. Install the required dependencies:
npm install

Configuration

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.

Usage

  1. Start the server:

npm start

  1. Open your browser and visit http://localhost:3000 to interact with the AI assistant.

Application Structure

  • 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 the index.html file and any client-side scripts or styles.

License

MIT Licensed

Author

Johann Dowa

simple-chatgpt-chat-streaming-demo's People

Contributors

jddev273 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.