/node-chat

A node.js chat interface built on openai.

Primary LanguageJavaScript

AI Chatbot with OpenAI GPT-3.5

Prerequisites

  • Node.js: Ensure you have Node.js installed on your local machine.

Instructions

  1. Clone the Repository:

    git clone https://github.com/Paul-Okello/node-chat.git
    cd node-chat
  2. Create Environment File:

    • In the root directory, create a new file named .env.
    • Add your OpenAI API key in the following format:
      OPENAI_API_KEY=YOUR_API_KEY_HERE
      Replace YOUR_API_KEY_HERE with your valid OpenAI API key.
  3. Install Dependencies:

    npm install
  4. Running the Chatbot:

    • Execute the following command in your terminal:
      node chat.js
  5. Chatting with the AI:

    • Once the script is running, interact with the chatbot by typing messages following the "You:" prompt.
    • To exit the chat, type "exit".

This updated guide provides clear steps to set up and run the chatbot, emphasizing the importance of securely storing the OpenAI API key and interacting with the chatbot seamlessly.