CodeForPhilly / balancer-main

CodeForPhilly balancer project (https://opencollective.com/code-for-philly/projects/balancer)
GNU Affero General Public License v3.0
11 stars 8 forks source link

Chatbot with history/memory #147

Closed taichan03 closed 1 month ago

taichan03 commented 3 months ago

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

snaeem3 commented 3 months 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.

Image

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.

Image