This manual provides step-by-step instructions to set up and run the University Chatbot application locally.
Here's the updated version of the Prerequisites section with steps to check for Python and Visual Studio Code installations, and install them if necessary:
Before running the application, ensure you have the following:
-
Python Installation
The application requires Python. To check if Python is installed, run the following command in your terminal or command prompt:python --version
If Python is not installed, follow these steps to install it:
- Download Python from the official Python website.
- Run the installer and make sure to check the box that says Add Python to PATH during the installation process.
- After installation, confirm Python is installed by running:
python --version
-
Visual Studio Code (VS Code)
Visual Studio Code is recommended as the code editor for this application. To check if VS Code is installed, run the following command in your terminal:code --version
If VS Code is not installed, follow these steps to install it:
- Download the installer for your operating system from the official VS Code website.
- Run the installer and follow the prompts to complete the installation.
- Once installed, you can open VS Code by typing
code
in the terminal.
-
Gemini API Key
The Gemini API key is required for interacting with Generative AI. Follow these steps to obtain one:- Login to the Gemini AI Studio.
- Sign in with your account or create a new one.
- Click on Get API Key section and follow the prompts.
- Generate a new API key and copy it.
Note: Save the key securely as it will be used in the application.
-
Bing Search API Key
The Bing Search API key is required for integrating web search functionality. Follow these steps to obtain one:- Visit the Microsoft Azure Portal.
- Sign in with your Microsoft account or create a new one.
- Go to Create a Resource and search for "Bing Search v7".
- Set up a new resource for Bing Search and navigate to the Keys and Endpoint section.
- Copy one of the provided API keys.
Note: Save the key securely as it will be used in the application.
-
Create the
config.py
File
To securely store your API keys, create aconfig.py
file in the project directory and add the following code:# config.py GEMINI_API = "YOUR_API_KEY_HERE" BING_API = "YOUR_API_KEY_HERE"
- Replace
"YOUR_API_KEY_HERE"
with your actual Gemini API Key and Bing API Key. - Save this file in the same directory as your main application script (
app.py
).
- Replace
Use the following command to clone the repository from your Git hosting platform (e.g., GitHub):
git clone https://github.com/manishkolla/GenAI_University_Chatbot
Change your working directory to the cloned repository folder:
cd <project-directory>
Make sure Python and pip are installed on your system.
python --version
or
python3 --version
pip --version
If either is missing, download and install the latest version of Python from the official Python website.
It is recommended to use a virtual environment to isolate dependencies.
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
venv\Scripts\activate
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
Install all necessary Python libraries listed in the requirements.txt
file:
pip install -r requirements.txt
Run the Flask application using the following command:
python app.py
Once the application starts, it will display a local URL (usually http://127.0.0.1:5000/
). Open this URL in your web browser to access the application.
You can test the application by interacting with it through the web interface or API (depending on the implementation).
- Open the URL shown in the terminal (e.g.,
http://127.0.0.1:5000/
) in your browser. - Ask questions related to Computer Science (CS), Data Science departments, or the directory. For example:
- "What is the role of the CS department?"
- "Can you provide information about the Data Science program?"
- "Who is the head of the CS department?"
- "Can you find a contact in the directory?"
- The application should respond with the relevant information or provide helpful answers based on its functionality.
Once done, deactivate the virtual environment using:
deactivate