A beginner-friendly Python project demonstrating how to build an AI application using LangChain, Google Gemini, and LangSmith.
This project demonstrates:
- LangChain Prompt Templates
- Google Gemini API Integration
- LangSmith Tracing
- Environment Variable Management
- Secure API Key Handling
- Python Best Practices
- Python 3.11+
- LangChain
- Google Gemini API
- LangSmith
- python-dotenv
LangChain-LangSmith-App/
│
├── main.py
├── .env
├── .gitignore
├── README.md
└── requirements.txt
Clone the repository
git clone https://github.com/Krish6891/langchain-langsmith-assignment.gitMove into the project
cd langchain-langsmith-assignmentCreate Virtual Environment
python -m venv .venvActivate
Windows
.venv\Scripts\activateInstall Packages
pip install -r requirements.txtCreate a .env file
GOOGLE_API_KEY=YOUR_API_KEY
LANGSMITH_API_KEY=YOUR_LANGSMITH_API_KEY
LANGSMITH_TRACING=true
LANGSMITH_PROJECT=LangChain_Assignmentpython main.pyEnter your prompt:
What is LangChain?
AI Response:
LangChain is a framework that simplifies the development of AI-powered applications by connecting language models with prompts, tools, memory, and external data.
This project supports automatic tracing using LangSmith.
You can view:
- Prompt
- AI Response
- Execution Time
- Token Usage
- Complete Trace
N. Gopalakrishnan
GitHub: https://github.com/Krish6891