This project is a collection of various applications and scripts utilizing the LangChain library for natural language processing tasks.
.env .gitignore agents/ - agents.ipynb api/ - app.py - client.py chatbot/ - app_llama.py - app.py rag/ - attention.pdf - chain.ipynb - rag.ipynb - speech.txt requirements.txt
-
agents/: Contains Jupyter notebooks for agent-based tasks.
agents.ipynb
: Notebook for agent-related experiments.
-
api/: Contains the API implementation using FastAPI.
app.py
: Main API application file. Implements routes and initializes models.client.py
: Client for interacting with the API.
-
chatbot/: Contains applications for chatbot implementations.
app_llama.py
: Chatbot application using the LLaMA model.app.py
: Main chatbot application using Streamlit.
-
rag/: Contains resources and notebooks for retrieval-augmented generation (RAG) tasks.
attention.pdf
: PDF document related to attention mechanisms.chain.ipynb
: Notebook for chain-based RAG tasks.rag.ipynb
: Notebook for RAG experiments.speech.txt
: Text file related to speech processing.
-
.env: Environment variables file.
-
.gitignore: Git ignore file.
-
requirements.txt: Python dependencies file.
-
Clone the repository:
git clone <repository-url> cd LangChain
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Copy the .env file to the root directory and update the values as needed.
To run the FastAPI application:
cd api
uvicorn app:app --reload
To run the Streamlit chatbot application:
cd chatbot
streamlit run app.py
API: Access the API endpoints at http://localhost:8000.
Chatbot: Open the Streamlit application in your browser and interact with the chatbot.