Implement conversation retention, AI summaries, and file management APIs - #86
Open
sujith8875 wants to merge 1 commit into
Open
Implement conversation retention, AI summaries, and file management APIs#86sujith8875 wants to merge 1 commit into
sujith8875 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR completes Tasks 1–3 by improving conversation lifecycle management, adding automatic conversation summaries, and introducing file upload APIs.
Task 1: Conversation retention and infrastructure
Added PostgreSQL configuration and required dependencies.
Added a scheduled daily cleanup job for permanently removing conversations soft-deleted for over 30 days.
Added --days and --dry-run options to the cleanup command.
Updated local CORS and cookie settings for frontend development.
Added frontend/.env to .gitignore.
Task 2: Conversation summaries
Added a summary field to conversations.
Automatically generates or refreshes summaries when conversations, messages, or versions change.
Uses GPT for concise summaries, with a local fallback when OpenAI configuration is unavailable.
Displays summaries in the Django admin.
Task 3: API development and integration
Added paginated and filterable conversation-summary endpoint:
GET /chat/conversation-summaries/
Supports page, page_size, search, title, created_after, and created_before.
Added file-management endpoints:
POST /chat/files/ — upload a file.
GET /chat/files/ — list user-uploaded files and metadata.
DELETE /chat/files// — delete an uploaded file.
Added SHA-256 duplicate detection per user, including database-level protection against simultaneous duplicate uploads.
Added media storage configuration and migrations for uploaded files.
Added tests covering summary filtering/pagination, uploads, duplicate prevention, deletion, and authorization.
email: sujithkumar.nani@gmail.com
name: suijth kumar naru
contact: +916281766782