A feature-rich chatbot web application built with Python using Google's Gemini API, Custom Search JSON API, and the Streamlit library. This project was developed as part of the Codexintern Python Developer internship.
- 🌐 Integrated Google Search: Seamlessly toggle Google Search to get real-time information within your chats.
- 📚 Chat History: Easily view and revisit your past conversations in the history tab. Expand any prompt to see the full response.
- 🧠 Model Selection: Choose the specific Gemini model you want to interact with from a dropdown menu.
Here's a glimpse of the application in action:
| Chat Interface | Chat History |
|---|---|
![]() |
![]() |
| Google Search Toggle | Model Selection |
|---|---|
![]() |
![]() |
Follow these steps to set up and run the project on your local machine.
First, clone the repository to your local machine.
git clone https://github.com/vj031206/gemini-chat-in-python.git
cd gemini-chat-in-pythonIt's recommended to create a virtual environment to manage dependencies.
- On Linux/macOS:
python3 -m venv venv source venv/bin/activate - On Windows:
python -m venv venv venv\Scripts\activate
Install all the required Python packages from the requirements.txt file.
pip install -r requirements.txtYou'll need to provide API keys for Google's services.
-
Create a new file named
.envin the root directory of the project. -
Copy the contents of
.env.exampleinto your new.envfile. -
Add your API keys to the
.envfile:GEMINI_API_KEY="YOUR_KEY_HERE" SEARCH_API_KEY="YOUR_KEY_HERE" SEARCH_ENGINE_ID="YOUR_KEY_HERE"
- Gemini API Key: Get yours from Google AI Studio.
- Custom Search JSON API Key & Search Engine ID: Follow the instructions on the Google Custom Search API page.
Once the setup is complete, you can run the Streamlit app with the following command:
streamlit run Chat.pyOpen your web browser and navigate to the local URL provided by Streamlit (usually http://localhost:8501).
Feel free to check out my other projects:
- Speech-to-Image Generator: vj031206/VJ3-Speech-to-Image
- Sentiment Analyser: vj031206/VJ3-Sentiment-Analysis-flask



