feat: add clear session messages functionality
- Implemented a new API endpoint to clear all messages in a session, enhancing session management capabilities. - Updated the frontend to include a clear messages option in the session menu, allowing users to easily remove chat history. - Added localization support for the new feature in English, Korean, Russian, and Chinese, improving accessibility for a broader audience. - Enhanced the chat view to handle session message clearing events, ensuring a responsive user experience. These changes significantly improve the user experience by providing a straightforward method to manage session messages effectively.
This commit is contained in:
@@ -35,6 +35,9 @@ type MessageService interface {
|
||||
// DeleteMessage deletes a message
|
||||
DeleteMessage(ctx context.Context, sessionID string, id string) error
|
||||
|
||||
// ClearSessionMessages deletes all messages in a session, along with their chat history KB entries
|
||||
ClearSessionMessages(ctx context.Context, sessionID string) error
|
||||
|
||||
// SearchMessages searches messages by keyword and/or vector similarity across all sessions of the current tenant.
|
||||
// Uses the chat history knowledge base for vector search instead of in-memory computation.
|
||||
SearchMessages(ctx context.Context, params *types.MessageSearchParams) (*types.MessageSearchResult, error)
|
||||
@@ -73,6 +76,8 @@ type MessageRepository interface {
|
||||
UpdateMessageImages(ctx context.Context, sessionID, messageID string, images types.MessageImages) error
|
||||
// DeleteMessage deletes a message
|
||||
DeleteMessage(ctx context.Context, sessionID string, id string) error
|
||||
// DeleteMessagesBySessionID deletes all messages belonging to a session
|
||||
DeleteMessagesBySessionID(ctx context.Context, sessionID string) error
|
||||
// GetFirstMessageOfUser gets the first message of a user
|
||||
GetFirstMessageOfUser(ctx context.Context, sessionID string) (*types.Message, error)
|
||||
// SearchMessagesByKeyword searches messages by keyword (ILIKE) across sessions for a tenant
|
||||
|
||||
Reference in New Issue
Block a user