This project is a conversational Q&A chatbot built using the Google Generative AI (Bard) API. The chatbot is designed to answer questions interactively and is implemented with Python using Streamlit for the frontend. The Google Generative AI API is used as the backend to generate responses based on user input.
- Real-time conversational Q&A interface.
- Streamlit-powered user interface for easy interaction.
- Uses Google Generative AI (Bard) for generating intelligent responses.
- Simple and clean code structure.
GeminiChat_Project/
│
├── .env # Environment variables (contains the API key)
├── qachat.py # Main script for running the chatbot
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Python 3.10 or later.
- A Google Generative AI (Bard) API key.
-
Clone the repository:
git clone https://github.com/sejalmankar1012/GeminiChat_Project.git cd GeminiChat_Project -
Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up your environment variables: Create a
.envfile in the project directory and add your API key:GOOGLE_API_KEY=your_google_api_key_here -
Run the Streamlit app:
streamlit run qachat.py
-
Open the app in your browser: The app will open automatically, or you can navigate to
http://localhost:8501/in your browser.
- Enter a question in the input box.
- Click the Get Answer button.
- The chatbot will generate a response using the Google Generative AI API.
- You can tweak the chatbot's behavior by modifying the
generate_responsefunction in theqachat.pyfile. - You can customize the UI using Streamlit components.
- Add conversation history tracking.
- Implement context-aware responses.
- Deploy the chatbot online for public access.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.