Giter Site home page Giter Site logo

tyleroneil72 / react-chat-bot Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 4.0 96 KB

Customizable Chat bot built with React.js, Node.js and Express.js, integrated with OpenAI's API to provide natural language processing capabilities. The bot can engage in conversations with users, answer questions, and provide responses based on the context of the conversation.

License: MIT License

JavaScript 82.54% HTML 4.00% CSS 13.46%
chatbot expressjs gpt-4 natural-language-processing nodejs openai openai-api reactjs

react-chat-bot's Introduction

Chat Bot using React.js, Node.js, Express.js, and OpenAI API

License React Nodejs Express Openai

Description

This is a chat bot built with React.js, Node.js and Express.js, integrated with OpenAI's API to provide natural language processing capabilities. The bot can engage in conversations with users, answer questions, and provide responses based on the context of the conversation.

Features

  • Natural Language Processing (NLP) using OpenAI's API.
  • Interactive conversations with users.
  • Ability to answer questions and provide context-aware responses.
  • Fully customizable/tweakable

Example

Image 2023-11-10 at 3 30 PM

Installation

  1. Clone the repository:
git clone https://github.com/tyleroneil72/react-chat-bot.git
cd react-chat-bot
  1. Install dependencies:
npm install
  1. Obtain OpenAI API Key:

Sign up for an account at OpenAI. Get your API key from the OpenAI dashboard. Create a .env file in the root directory and add your API key:

API_KEY='YOUR KEY HERE'
# You may need to change this depending on your accounts access, gpt 3.5 is available to all accounts
MODEL='gpt-4'
# MODEL='gpt-3.5-turbo-1106' This model is soon to be deprecated
# MODEL='gpt-3.5-turbo'
# If you change this express port, it also must be changed in frontend/src/chat/Chat.jsx EXPRESS_PORT variable
EXPRESS_PORT='3000' 
VITE_PORT='5173'
const gptModel = process.env.MODEL;
const response = await openai.createChatCompletion({
      model: gptModel,
      messages: messages,
    });

NOTE: Works best with GPT-4

Usage

Run the following command from the root directory

npm start

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project was inspired by the capabilities of OpenAI's API.

This project was originally crafted without the use of React. If you're curious to explore its earlier version, you can find the legacy repository by clicking here

Contact

For any inquiries or questions, you can reach me at [email protected] or on my linkedin at https://ca.linkedin.com/in/tyler-oneil-dev

react-chat-bot's People

Contributors

tyleroneil72 avatar

Stargazers

 avatar Robbie avatar Gokul Simson avatar  avatar Hadassa Ester avatar

Watchers

 avatar

react-chat-bot's Issues

Request failed with status code 429

An error occurred while processing the request: Error: Request failed with status code 429.

This error comes out whenever I ask on the bot.
I don't know how to fix this, I am a beginner on coding.
I would like to use your code for a school project.
Thank youu.

image

Fix Documentation

Enhance the project by improving documentation and comments throughout the codebase for better clarity and understanding. Clear comments provide insights into code logic, aiding in troubleshooting.

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.