This repository contains a simple chatbot application built using Streamlit and Google's Gemini API. The bot, named "RedPill AI," can interact with users and generate responses based on their queries.
- Interactive Chat Interface: The chatbot uses Streamlit to provide a web-based interface for user interaction.
- Google Gemini API Integration: Utilizes Google's Generative Model (gemini-pro) to generate intelligent and relevant responses.
- Session State Management: Maintains chat history across user interactions using Streamlit's session state.
- Python 3.x
- Virtual environment tool (e.g., venv)
- Google Generative AI API Key
- Clone the repository:
git clone https://github.com/darshanm17/RedPill-AI-with-Streamlit.git cd RedPill-AI-with-Streamlit
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required packages:
pip install streamlit google-auth google-auth-oauthlib google-generativeai
- Set up your Google API Key: -Replace the placeholder API key in the code with your actual Google API key.
- Activate the virtual environment if not already active:
source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Run the Streamlit app:
streamlit run app.py
- Open your browser and navigate to http://localhost:8501 to interact with RedPill AI.
- Title and Environment Setup: The app starts by setting the title and configuring the Google API key.
- Model Initialization: Configures the gemini-pro model from Google's Generative AI API.
- Chat History Management: Initializes and manages chat history using Streamlit's session state.
- Message Display: Displays chat messages from the session history on app rerun.
- Response Handling: Defines a function to handle user queries and generate responses using the Gemini API.
- User Input Handling: Accepts user input and triggers the response function when a query is provided.
- Add error handling for network and API issues.
- Implement user authentication for personalized sessions.
- Enhance the UI with custom styling and additional features.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.