An open API service indexing awesome lists of open source software.

https://github.com/jmrashed/express-openapi-generator

express-openapi-generator
https://github.com/jmrashed/express-openapi-generator

Last synced: 4 months ago
JSON representation

express-openapi-generator

Awesome Lists containing this project

README

        

# 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](https://beta.openai.com/signup/))

## Installation

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

# Demo

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