feat(channel): add channel support across various components and locales
- Introduced a new `channel` field in multiple request and message structures to track the source channel (e.g., "web", "api", "im"). - Updated frontend API calls and chat components to include the `channel` parameter, ensuring consistent channel tracking in user messages. - Enhanced localization files to support channel labels in English, Korean, Russian, and Chinese. - Added database migration scripts to incorporate the `channel` column in the messages table, facilitating the storage of channel information. - Refactored related functions and components to accommodate the new channel feature, improving overall message context and tracking.
This commit is contained in:
@@ -165,7 +165,7 @@ func createAgentQueryEvent(sessionID, assistantMessageID string) interfaces.Stre
|
||||
}
|
||||
|
||||
// createUserMessage creates a user message and returns the created message.
|
||||
func (h *Handler) createUserMessage(ctx context.Context, sessionID, query, requestID string, mentionedItems types.MentionedItems, images types.MessageImages) (*types.Message, error) {
|
||||
func (h *Handler) createUserMessage(ctx context.Context, sessionID, query, requestID string, mentionedItems types.MentionedItems, images types.MessageImages, channel string) (*types.Message, error) {
|
||||
return h.messageService.CreateMessage(ctx, &types.Message{
|
||||
SessionID: sessionID,
|
||||
Role: "user",
|
||||
@@ -175,6 +175,7 @@ func (h *Handler) createUserMessage(ctx context.Context, sessionID, query, reque
|
||||
IsCompleted: true,
|
||||
MentionedItems: mentionedItems,
|
||||
Images: images,
|
||||
Channel: channel,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user