Welcome to the FAQ Bot! This is a simple chatbot designed to help you with questions about car insurance in Australia. It uses a collection of Frequently Asked Questions (FAQs) and OpenAI's technology to provide you with helpful answers.
- Smart Matching: The bot understands your questions and finds the best answers from its FAQ database.
- Dynamic Responses: If it can't find an exact match, it will create a helpful answer based on similar questions.
- User-Friendly: Just type your question, and the bot will respond instantly!
Before you begin, make sure you have:
- Git: Version control software to manage your code. You can download it from Git's official website.
- Python: Version 3.7 or higher installed on your computer. You can download it from Python's official website.
- OpenAI API Key: You'll need an API key from OpenAI to use the chatbot. You can sign up for one here.
Open your terminal (Command Prompt on Windows) and run the following commands:
git clone https://github.com/Andreymae/faq-bot.git
cd faq-botIf you don't have Git installed, you can download the project as a ZIP file from this link and extract it.
Setting up a virtual environment is a good practice to keep your project organized. It creates a separate space for your project dependencies.
For Mac/Linux:
python3 -m venv venv
source venv/bin/activateFor Windows:
python -m venv venv
venv\Scripts\activateYou should see (venv) at the beginning of your command line, indicating that the virtual environment is active.
With your virtual environment activated, install the necessary packages by running:
pip install -r requirements.txtThis command will download all the libraries bot needs to function.
The bot needs an OpenAI API key to work properly. Set it as an environment variable.
For Mac/Linux:
export OPENAI_API_KEY=your_openai_api_key_hereFor Windows:
set OPENAI_API_KEY=your_openai_api_key_hereMake sure to replace your_openai_api_key_here with your actual API key from OpenAI.
Now, let's start the bot! Run the following command in your terminal:
python app.pyYou should see messages indicating that the server is running.
- Open your web browser and go to http://localhost:7860.
- Enter your OpenAI API key in the settings panel.
- Start asking questions about car insurance in Australia!
You can use these special commands while chatting with the bot:
/reload- Refresh the FAQ database./sources- See the sources of the information./health- Check if the bot is functioning properly.
- Explore the API documentation at http://localhost:8000/docs.
- Check out the source code to see how everything works.
- Try asking different questions to see how the bot responds!
- Bot won't start? Ensure Python is installed correctly and that you're in the right directory.
- Not getting answers? Double-check that your OpenAI API key is entered correctly.
- Encountering errors? Make sure all required packages were installed successfully.
Happy chatting with your new car insurance assistant! 🚗💬