Welcome to the Civil Engineering Chatbot GitHub repository!
This web application is designed to provide a conversational interface for users to interact with a chatbot specialized in civil engineering topics. The chatbot is designed to help people with civil engineering education and can interact in both Hindi and English languages.
Additionally, it offers a dark/light mode switch for user convenience and includes a FAQ feature to help users start conversations with the bot using predefined prompts (which can be customized through a JSON file). The application is built using React for the frontend and Flask for the Python backend using OpenAI API, making it a powerful and versatile tool for answering civil engineering queries.
The model used for getting responses is the GPT 3.5 turbo, which allows for reduced prompt size, increased performance, and less token usage for the same cost.
The chatbot is trained to provide information and answers related to civil engineering topics. Whether you have questions about structural engineering, construction materials, or any other aspect of civil engineering, this chatbot can help.
Users can interact with the chatbot in both Hindi and English languages, making it accessible to a wider audience and facilitating communication in their preferred language.
The app offers a user-friendly interface with a dark/light mode switch, allowing users to customize their visual experience based on their preferences and lighting conditions.
To help users get started, the chatbot includes a set of predefined prompts that can be used to initiate conversations. These prompts are customizable via a JSON file, making it easy to tailor the bot's responses to specific use cases or industries.
- Node.js and npm (for React frontend)
- Python 3.x (for Flask backend)
- Git (optional but recommended)
To get started with this project, follow these steps:
-
Clone this repository to your local machine (or download and unzip the ZIP file):
git clone https://github.com/kartikeya-git/CivilGPT.git
-
Install the required dependencies for both the frontend and backend components. You can use
npm
for the frontend andpip
for the backend:# Frontend cd chatapp npm install # Backend cd ../chatgpt-backend pip install -r requirements.txt
-
Set your OpenAI API key by replacing the "YOUR_API_KEY_HERE" with your own API key in the chatgpt-backend/app.py file (Line 9).
# chatgpt-backend/app.py
# Set your OpenAI API key here
openai.api_key = "YOUR_API_KEY_HERE"
- If you do not have an OpenAI API key, then you can get it from OpenAI's website:
- Go to OpenAI's Platform website at platform.openai.com and sign in with an OpenAI account.
- Click your profile icon at the top-right corner of the page and select "View API Keys."
- Click "Create New Secret Key" to generate a new API key.
- Copy this key in the file at the line as described in the Step 3.
You can customize the chatbot's initial prompts and responses by editing the faq.json
file located in the backend
directory. Add, modify, or remove prompts as needed to suit your application's requirements.
-
Start the Flask backend server.
cd chatgpt-backend python app.py
-
In a separate terminal, start the React frontend development server.
cd chatapp npm start
-
Open your web browser and navigate to http://localhost:3000 to access the Civil Engineering Chatbot.
Once the web app is running, you can interact with the Civil Engineering Chatbot:
- Open the web app in your browser.
- Choose your preferred language (Hindi or English) and mode (dark/light).
- Initiate a conversation with the chatbot using the predefined prompts or by typing your questions directly.
Feel free to extend and enhance the chatbot's capabilities according to your needs.
We welcome contributions from the community! If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code is well-documented.
- Test your changes thoroughly.
- Submit a pull request with a clear description of your changes.
We appreciate your contributions to make this chatbot even more helpful for civil engineering enthusiasts and professionals.
- Special thanks to OpenAI for their GPT-based models, which power the chatbot's responses.
Thank you for using the Civil Engineering Chatbot! If you have any questions or encounter issues, please feel free to open an issue in this repository.