Closed taichan03 closed 1 month ago
Update: Back end work is complete. Front end work is in progress.
New endpoints:
I am currently working on the front end changes. I plan to create a conversation list in the Chat component. First I plan to add a toggle button to hide/show the conversations log.
The conversation log will have a "New Conversation" button and a list of all the conversations below. Clicking on a conversation title will set the active chat conversation to the message history of that conversation.
Backend Upgrades and Refactoring
Upgrade from Django's HttpResponse to Django Rest Framework (DRF)
Implement DRF views and serializers Configure DRF settings in the project
Create a services folder structure
Move the OpenAI API call into a dedicated service Ensure the OpenAI service is reusable across the application
Database Schema Updates
Create a new table to store chat messages Fields should include:
User ID (foreign key to User model) Conversation ID Message content Timestamp Role (user/assistant)
Security and Performance
Implement authentication for API endpoints Optimize database queries for conversation history Implement rate limiting for API calls to OpenAI