This project is a chatbot implementation using the OpenAI API for natural language processing and the Flask framework in Python for the backend. The communication between the client and server is facilitated through websockets using the Socket.IO library.
The chatbot's user interface (UI) is inspired by a CodePen design.
The project follows the following directory structure:
To run the chatbot locally, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/chatbot.git
- Install the required dependencies:
pip install -r requirements.txt
- Start the server:
python run.py
- Open your web browser and go to
http://localhost:8888
to access the chatbot UI.
The config.py
file contains configuration parameters for the chatbot. You may modify this file to customize the behavior of the chatbot, such as setting the API keys for the OpenAI API or adjusting other settings.
Once the chatbot is running, users can interact with it through the web interface. Messages are sent to the server via websockets, and the Flask backend processes the user input using the OpenAI API to generate appropriate responses.
You can also deploy the chatbot using Docker. A Dockerfile is provided for easy deployment. Follow these steps to deploy the chatbot using Docker:
- Build the Docker image:
docker build -t chatbot-app .
- Run the Docker container:
docker run -p 8888:8888 chatbot-app
The chatbot will be accessible at http://localhost:8888
just like when running locally.
Here are some helpful links for the documentation:
- Flask-SocketIO Documentation: https://flask-socketio.readthedocs.io/en/latest/intro.html
- Socket.IO Documentation: https://socket.io/docs/v4/
The provided links will help you understand and utilize the technologies and tools used in this project, including Flask-SocketIO for server side WebSocket communication and Socket.IO for client side WebSocket communication.
This project is licensed under the Unlicense - a public domain dedication.
You are free to use, modify, and distribute the code in any way you see fit without any restrictions. The Unlicense allows you to do whatever you want with the code, including using it for commercial purposes, without requiring any attribution or permission from the original author.
The Unlicense is a permissive license that grants you the maximum freedom to use the software without imposing any legal obligations or limitations.
For more details, please refer to the Unlicense website.
Feel free to make this project your own and use it for any purpose you desire.
The chatbot UI design is based on a CodePen design created by Zenworm, which can be found at source.
Contributions to this project are welcome. If you find any issues or have improvements to suggest, please feel free to submit a pull request.
Hey there! I'm excited that you're exploring my chatbot project. If you have any questions, feedback, or just want to say hi, feel free to get in touch with me!
I'm always happy to chat about anything related to this project, and I'm open to suggestions for improvements or new features. Your input is valuable, and it helps make this chatbot even better.
You can reach out to me through any of the following channels:
- Email: david.zwsse@simplelogin.co
- Twitter: @Viodid1
- LinkedIn: David Yunta
Don't hesitate to contact me if you have any questions, run into issues, or just want to share your experience with the chatbot. I'm looking forward to hearing from you!