From 1ed68226e4cf3ef4523f1296b45a6a05e239d2fd Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 13 Dec 2024 07:21:25 +0500 Subject: [PATCH] update the chat store to include workspace id and include in send --- src/services/index.ts | 6 +++++- src/store/chat.ts | 10 +++++++++- src/store/interface.ts | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/services/index.ts b/src/services/index.ts index 78f3fcbe..aa0ca095 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -60,6 +60,8 @@ export class ChatService { async sendMessage( chat_id: string, message: string, + sourceWebsocketID: string, + workspaceUUID: string, contextTags?: ContextTag[] ): Promise { try { @@ -76,7 +78,9 @@ export class ChatService { body: JSON.stringify({ chat_id, message, - context_tags: contextTags + context_tags: contextTags, + sourceWebsocketID, + workspaceUUID }) }); diff --git a/src/store/chat.ts b/src/store/chat.ts index 4556ff24..d7da80cb 100644 --- a/src/store/chat.ts +++ b/src/store/chat.ts @@ -91,9 +91,17 @@ export class ChatHistoryStore implements ChatStore { async sendMessage( chat_id: string, message: string, + sourceWebsocketID: string, + workspaceUUID: string, contextTags?: ContextTag[] ): Promise { - const newMessage = await chatService.sendMessage(chat_id, message, contextTags); + const newMessage = await chatService.sendMessage( + chat_id, + message, + sourceWebsocketID, + workspaceUUID, + contextTags + ); if (newMessage) { this.addMessage(newMessage); } diff --git a/src/store/interface.ts b/src/store/interface.ts index 6f4a12df..9d1eb7a9 100644 --- a/src/store/interface.ts +++ b/src/store/interface.ts @@ -478,6 +478,7 @@ export interface ChatMessage { status: ChatStatus; source: ChatSource; sourceWebsocketID: string; + workspaceUUID: string; } export interface Chat {