markdown
This project is a Django-based chatbot application that uses a Retrieval-Augmented Generation (RAG) model to answer user queries. The application can handle text input and support PDF file uploads to extract and process data from PDFs.
- Text Queries: Answer queries based on static text data.
- PDF Uploads: Upload PDF files, extract text, and query the content.
- Conversation Memory: Maintain context across multiple queries (optional implementation).
- Python 3.12 or higher
- Django
- LangChain libraries
- Cohere API key
- HuggingFace API token
-
Clone the repository:
git clone https://github.com/Srinivasulu2003/django-app.git
-
Create and activate a virtual environment:
python -m venv venv venv/Scripts/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the chatbot:
Open your web browser and go to
http://127.0.0.1:8000/
to interact with the chatbot.
-
Send a Query: Type your query in the input field and press "Send" to get a response based on the static text data or uploaded PDF content.
-
Upload a PDF: Use the file input to upload a PDF. The chatbot will extract the text and use it to answer your queries.
chatbot_project/
│
├── chatbot/ # Django app for chatbot functionality
│ ├── migrations/ # Database migrations
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── models.py
│ ├── tests.py
│ ├── views.py #langchain and cohere code
│ ├── urls.py
│ └── templates/
│ └── chatbot/
│ └── index.html #chatbot interface
│
├── chatbot_project/ # Django project configuration
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
│
├── manage.py # Django management script
├── requirements.txt # Project dependencies
└── README.md #this file
# Text file