/express-openapi-generator

express-openapi-generator

Primary LanguageEJS

Node.js OpenAI Chatbot Example

This is a simple Node.js application that uses the OpenAI API to generate a short paragraph based on a given topic.

Prerequisites

Before running the application, make sure you have the following:

  • Node.js installed
  • OpenAI API key (you can obtain this from the OpenAI website)

Installation

  1. Clone the repository:
    git clone https://github.com/jmrashed/express-openapi-generator.git
  1. Install dependencies:
npm install
  1. Create a .env file in the project root and add your OpenAI API key:
API_KEY=your_openai_api_key

Demo

Usage

  1. Start the server:
npx nodemon index.js
  1. Open your browser and go to http://localhost:3000.
  2. Enter a topic in the input field and click the "Generate" button.
  3. The server will use the OpenAI API to generate a short paragraph based on the provided topic.