Deep dive into LangChain building blocks: prompts, chat models (Gemini), output parsers, text splitters, embeddings/vector stores, retrievers, LCEL piping, and a tool-using agent.
- [langchain_components.ipynb]
- [ex1.ipynb]
- [ex2.ipynb]
- [ex3.ipynb]
- Environment variable: set
GOOGLE_API_KEY(e.g., via a local.env). - Install:
pip install langchain langchain-google-genai langchain-text-splitters langchain-community faiss-cpu python-dotenv numexpr pytz
- Open notebooks in Jupyter and run cells top‑to‑bottom.
- Start with langchain_components.ipynb, then try
ex1→ex2→ex3. - If a cell needs API access, ensure
GOOGLE_API_KEYis set and restart the kernel.
- Recommended:
gemini-2.5-flash - Fallbacks (if not enabled):
gemini-1.5-pro,gemini-1.5-flash
- HTML:
jupyter nbconvert --to html langchain_components.ipynb - PDF (Chromium):
jupyter nbconvert --to webpdf langchain_components.ipynb --WebPDFExporter.allow_chromium_download=True
- Dr. Partha Majumder