This Django project demonstrates how to create a custom user model and define related models for user profiles, PDF documents, and chat messages.
List out the key features of your application.
-
Advanced Chatbot Integration: Utilizes cutting-edge Generative AI and advanced language models to power a chatbot that enables users to interact with uploaded PDF documents.
-
PDF Document Upload: Allows users to upload PDF files, making them accessible for content-based queries.
-
Real-time Responses: Provides real-time chatbot responses to user queries about the content of uploaded PDF documents.
-
Responsive UI: Implements a responsive user interface, ensuring a seamless experience across various devices for enhanced accessibility.
-
Chat History: Designed and implemented a chat history feature, allowing users to revisit previous conversations with the chatbot, fostering a user-friendly interaction.
-
Technology Stack: Employed Python, Django, PyPDF2, chatbot frameworks, LLM, openAI, and natural language processing libraries to architect and develop this solo project, demonstrating proficiency in these industry-standard technologies.
Before you begin, ensure you have met the following requirements:
- Python (3.x) installed on your system.
- Django installed (
pip install Django
). - Langchain library installed (
pip install langchain
). - PyPDF2 library installed (
pip install PyPDF2
). - OpenAI API key (set it as an environment variable named
OPENAI_API_KEY
).
Detailed instructions on how to install, configure, and get the project running.
1. Clone the repository: `git clone https://github.com/amanastel/PDF_Based_Chatbot_AI.git`
2. Navigate to the project directory: `cd PDF_Based_Chatbot_AI`
3. Create a virtual environment: `python3 -m venv venv`
4. Activate the virtual environment: `source venv/bin/activate`
5. Install dependencies: `pip install -r requirements.txt`
6. Apply database migrations: `python manage.py migrate`
7. Create a superuser: `python manage.py createsuperuser`
8. Run the development server: `python manage.py runserver`
- Create a superuser to access the admin panel:
python manage.py createsuperuser
- Start the development server:
python manage.py runserver
- Access the admin panel at:
http://localhost:8000/admin/
- Use the admin panel to manage users, profiles, PDF documents, and chat messages.
- User Registration:
POST /api/register/
- User Login:
POST /api/login/
- User Profile:
GET /api/profile/
- Upload PDF Document:
POST /api/upload-pdf/
- List PDF Documents:
GET /api/pdf-documents/
- Create Chat Message:
POST /api/chat/create/
- List Chat Messages:
GET /api/chat/list/
You can find the CustomUserSerializer
in the serializers.py
file under the llmApp
app directory. This serializer is used for user registration and login.
CustomProfile
: Represents user profiles with extended fields (phone and address).PDFDocument
: Represents uploaded PDF documents associated with users.ChatMessage
: Represents chat messages with timestamps.
List and provide a brief overview of the technologies used in the project.
- Django
- Python
- Langchain
- MySQL
- Vue
Contributions are welcome! If you find any issues or want to add new features, feel free to open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.