Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

# πŸ€– Simple AI Chatbot using LangChain + OpenRouter (Python)
This is a basic Python project that shows how to use **LangChain** with **OpenRouter** to create a simple AI assistant. 
The AI answers questions in **easy, simple words**, making it perfect for beginners learning AI integration
---
## βœ… Features
- Uses **LangChain** for AI interaction 
- Uses **OpenRouter API** (free model supported) 
- Takes a question and prints the AI reply in the terminal 
- Beginner-friendly and easy to understand 
---
## πŸ§‘β€πŸ’» Requirements
Make sure you have:
- Python **3.9+** installed 
- An **OpenRouter API Key**
---
## πŸ“¦ Install Required Libraries
Run this command in your terminal:
```bash
pip install langchain langchain-openai python-dotenv

πŸ” Setup Environment Variable

  1. Create a file named .env in your project folder
  2. Add your OpenRouter API key inside it:
OPENROUTER_API_KEY=your_api_key_here

⚠️ Never share your API key publicly.


▢️ How to Run the Project

Run the following command in your terminal:

python createagent.py

You will see the AI response printed in the terminal.


🧠 Example Question Used

user_question = "What is artificial intelligence in simple terms?"

βœ… Example Output

Artificial intelligence is when computers are taught to think and learn like humans to do tasks such as answering questions, recognizing images, or making decisions.

πŸ“ Project Structure

langchain-tutorials/
β”‚
└──.env
└── python_langchian_example/
 β”‚
 β”œβ”€β”€ createagent.py
 └── README.md

🎯 Who Is This For?

  • Beginners learning LangChain
  • Students exploring AI integration
  • Developers testing OpenRouter with Python

πŸ“œ License

This project is free to use for learning and educational purposes.

About

Beginner-friendly LangChain tutorial with Python,Golang examples for building AI agents, chatbots, and LLM-powered apps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /