mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 07:24:59 -05:00
[PR #789] [MERGED] feat: delete message #91501
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/789
Author: @dannyl1u
Created: 2/18/2024
Status: ✅ Merged
Merged: 2/23/2024
Merged by: @tjbck
Base:
main← Head:feat/delete-message📝 Commits (10+)
40a7ac9feat: delete message scaffoldingc3ed6feUpdate UserMessage.svelte32c7971add isFirstMessage prop to UserMessage component60c99a4remove user message and response from DOM as paircd3cecdfilter out deleted messages in payload 🗑️941bcdcRefactor deleteMessage function and update deleteMessagePair usage632882aadd message filtering in +page.svelte to filter out deleted messages in payload 🗑️51b5940invoke stopResponse() if user deletes message during response generation95b8edfuse cancelChatCompletion API call instead of stopResponse functiona655ccdonly cancel chat completion if the deleted message is the most recently sent📊 Changes
4 files changed (+161 additions, -98 deletions)
View changed files
📝
src/lib/components/chat/Messages.svelte(+119 -87)📝
src/lib/components/chat/Messages/UserMessage.svelte(+38 -7)📝
src/routes/(app)/+page.svelte(+2 -2)📝
src/routes/(app)/c/[id]/+page.svelte(+2 -2)📄 Description
Implement Delete Message Functionality
Description
This pull request introduces functionality allowing users to delete their messages from the chatbot conversation. This feature aims to improve the user experience by enabling the management of conversation flow, particularly useful for removing side questions, clarifications, or typos.
Motivation
Implementing message deletion addresses the need for clearer conversational context, as highlighted in issue #652. Users can now manage their conversation history more effectively, ensuring that only relevant messages influence the chatbot's responses and overall dialogue quality.
Implementation Details
Frontend Changes:
historyobject with adeleted=trueflag.deleted=trueare excluded from the payload in subsequent API calls, ensuring that deleted messages do not influence the conversation flow.Demo video
https://youtu.be/UklUb_QMrZM
Resolves #652
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.