This is a chat bot built with Node.js and Express, 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.
This project has undergone a transformation and is now powered by React. Feel free to explore the revamped version by visiting the repository here
- Natural Language Processing (NLP) using OpenAI's API.
- Interactive conversations with users.
- Ability to answer questions and provide context-aware responses.
- Fully customizable/tweakable
- Clone the repository:
git clone https://github.com/rickychauhk/chatbot
cd chat-bot
- Install dependencies:
cd backend
npm install
- 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 the model in the backend/services/openaiService.js file depending on availability
const response = await openai.createChatCompletion({
// Switch to different models if necessary
// model: "gpt-3.5-turbo",
model: "gpt-4",
messages: messages,
});
Run the following command to start the chat bot server from the backend:
cd backend
npm start
And the index.html file should open in your browser
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
This project was inspired by the capabilities of OpenAI's API.