This project is a chatbot built using Langchain and Google's Gemini model. It leverages Langchain's prompt templates and Google’s powerful AI model to deliver real-time answers through a Streamlit interface.
- Langchain Integration: The chatbot uses Langchain’s prompt system to generate structured prompts and manage responses via
StrOutputParser
. - Google AI (Gemini): Utilizes the Gemini model from Google AI Studio for generating conversational responses.
- Streamlit Interface: A simple, user-friendly input box for asking any question and displaying responses.
- Environment Variable Management: API keys are securely managed using
.env
files, ensuring security and ease of use.
- Python 3.7 or later
langchain-google-genai
,streamlit
,python-dotenv
libraries
- Clone the repository:
git clone https://github.com/your-username/langchain-gemini-chatbot.git
- Navigate to the project directory:
cd langchain-gemini-chatbot
- Install the required dependencies:
pip install -r requirements.txt
- Create a
.env
file in the root directory and add your API keys:GOOGLE_API_KEY=your_google_api_key LANGCHAIN_API_KEY=your_langchain_api_key
- Run the Streamlit app:
streamlit run app.py
- In the Streamlit interface, type your question in the input field and get a response powered by Google Gemini AI.
📦langchain-gemini-chatbot: The root folder or main directory where my project files are stored. ┣ 📜app.py: The main Python application file that runs my chatbot. ┗ 📜.env: The environment file where sensitive API keys (like Google API and Langchain API keys) are stored securely.