This repository demonstrates how to integrate LangChain with Google Gemini to build AI-powered applications using multimodal capabilities. It's designed as a starting point for developers looking to explore and experiment with LangChain and Google Gemini AI.
- Seamless integration: Connect LangChain with Google Gemini for text and multimodal tasks.
- Beginner-friendly: Simple setup to get started quickly.
- Extensible: Encourage contributions and customizations for advanced use cases.
Follow these steps to set up and run the project on your local machine:
git clone https://github.com/hmshb/langchain-google-gemini-integration.git
cd langchain-google-gemini-integration
python -m venv venv
source venv/bin/activate # For Linux/Mac
.\venv\Scripts\activate # For Windows
pip install -r requirements.txt
- Visit Google AI Studio.
- Create an API key for accessing Google Gemini.
- Copy the generated API key.
- Add the following line to the .env file, replacing your_google_api_key with your actual API key:
GEMINI_API_KEY=your_google_api_key
python index.py
langchain-google-gemini-integration/
├── .env # API key configuration file
├── gemini.py # Gemini AI LLM Model configurations file
├── index.py # Simple script that translate word from English to Italian
├── prompt_template_single_variable.py # Example of single variable usage in Prompt Template
├── prompt_template_multiple_variable.py # Example of multiple variable usage in Prompt Template
├── prompt_template_conditional_prompts.py # Example of conditional variable usage in Prompt Template
├── requirements.txt # Optional: Use for dependencies
├── README.md # Documentation file
├── venv/ # Virtual environment
Special thanks to:
- LangChain for providing a robust framework for building LLM applications.
- Google Gemini for their powerful multimodal AI capabilities.
This project is open-source and licensed under the MIT License.
If you find this repository helpful, please consider:
- ⭐ Starring the Repository to show your support.
- 📤 Forking the Repository to explore further and make your own customizations.
- 💬 Sharing Your Feedback by opening issues or discussions.
Let's build amazing AI-powered applications together!