Open-Assistant
Open-Assistant copied to clipboard
Add flagged_message table and admin management endpoints
- Create a "flagged_message" table with message_id (FK, ondelete="CASCADE" similar to emoji table, see here),
processedboolean column (not null default false) andcreated_datedatetime not null default current_timestamp & create alembic migration script - insert/update a row in
flagged_messagetable whenever thered_flagemoji is added to the message, potentially in PromptRepository.handle_message_emoji() (this happen for text-label requests withis_report==True, see here). Check if there is an existing entry in the "flagged_message" table .. if found update it and set processed = False & created_date to current timestamp . (Do nothing when the flag is removed.) - Add GET
/admin/flagged_messages/REST endpoints to query unprocessed reported messages ordered by create_date (with max_count limit) - Add PUT
/admin/flagged_messages/{message_id}/processedendpoint to mark the message as processed
Related issue: https://github.com/LAION-AI/Open-Assistant/issues/912
Initial work on this has already been contributed by @GraemeHarris.
For a full solution we need now:
- (backend): Paging for the flag queries
- (web frontend): Admin pages to offer the backend functionality to the user
Will dive into fleshing this out
Since this issue was stale, I unassigned @GraemeHarris and set it to high prio.
I will see if I redeem myself quickly! But if anyone does take it out sooner let me know :)