Skip to content

Commit

Permalink
Merge pull request stakwork#764 from MahtabBukhari/Update-the-chat-st…
Browse files Browse the repository at this point in the history
…ore-to-include-workspace-id-and-include-in-send

Update the chat store to include workspace id and include in send
  • Loading branch information
humansinstitute authored Dec 13, 2024
2 parents cb47b56 + 1ed6822 commit 72f8efd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export class ChatService {
async sendMessage(
chat_id: string,
message: string,
sourceWebsocketID: string,
workspaceUUID: string,
contextTags?: ContextTag[]
): Promise<ChatMessage | undefined> {
try {
Expand All @@ -76,7 +78,9 @@ export class ChatService {
body: JSON.stringify({
chat_id,
message,
context_tags: contextTags
context_tags: contextTags,
sourceWebsocketID,
workspaceUUID
})
});

Expand Down
10 changes: 9 additions & 1 deletion src/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ export class ChatHistoryStore implements ChatStore {
async sendMessage(
chat_id: string,
message: string,
sourceWebsocketID: string,
workspaceUUID: string,
contextTags?: ContextTag[]
): Promise<ChatMessage | undefined> {
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);
}
Expand Down
1 change: 1 addition & 0 deletions src/store/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ export interface ChatMessage {
status: ChatStatus;
source: ChatSource;
sourceWebsocketID: string;
workspaceUUID: string;
}

export interface Chat {
Expand Down

0 comments on commit 72f8efd

Please sign in to comment.