Copilot Chat: Multi-user support with SignalR#1345
Merged
adrianwyatt merged 45 commits intomainfrom Jun 17, 2023
Merged
Conversation
Combining and bringing in stage 1 of the multi user chat experience: - join chats via chat ids - signal R broadcasting from frontend and backend - signal R middleware - limit broadcasting to chat id groups - broadcast document uploading The code builds clean without any errors or warnings The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with dotnet format All unit tests pass, and I have added new tests where possible I didn't break anyone 😄 --------- Co-authored-by: Tao Chen <TaoChenOSU@users.noreply.github.com> Co-authored-by: Tao Chen <taochen@microsoft.com>
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Dispatch returns immediately even when the action is captured by the SignalR middleware. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Dispatch the action to next() in the pipeline before the async logic in the middleware to make sure the stores are updated. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
<!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Need to show how many users are in a chat. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Create a widget in the Webapp that can show users that are part of the chat. This only shows user ids for now. 2. Broadcast to all chat members when a user joins.  <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
<!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> We need to know if someone or the bot is typing from the frontend.  <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Relay typing state through the backend. <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatHistoryController.cs
Fixed
Show fixed
Hide fixed
TaoChenOSU
commented
Jun 5, 2023
samples/apps/copilot-chat-app/webapp/src/components/chat/ChatInput.tsx
Outdated
Show resolved
Hide resolved
adrianwyatt
requested changes
Jun 5, 2023
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatController.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatHistoryController.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatHistoryController.cs
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatHistoryController.cs
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatParticipantController.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatParticipantController.cs
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatParticipantController.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Hubs/MessageRelayHub.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Storage/ChatParticipantRepository.cs
Show resolved
Hide resolved
teresaqhoang
suggested changes
Jun 6, 2023
Contributor
teresaqhoang
left a comment
There was a problem hiding this comment.
ReadMEs also need updated
And we should bug bash this as a team before it goes in
samples/apps/copilot-chat-app/webapp/src/components/chat/ChatInput.tsx
Outdated
Show resolved
Hide resolved
...pps/copilot-chat-app/webapp/src/components/chat/invitation-dialog/InvitationCreateDialog.tsx
Show resolved
Hide resolved
...pps/copilot-chat-app/webapp/src/components/chat/invitation-dialog/InvitationCreateDialog.tsx
Outdated
Show resolved
Hide resolved
.../apps/copilot-chat-app/webapp/src/components/chat/invitation-dialog/InvitationJoinDialog.tsx
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapp/src/redux/features/message-relay/signalRMiddleware.ts
Outdated
Show resolved
Hide resolved
.../apps/copilot-chat-app/webapp/src/components/chat/invitation-dialog/InvitationJoinDialog.tsx
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatController.cs
Outdated
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Controllers/ChatHistoryController.cs
Show resolved
Hide resolved
samples/apps/copilot-chat-app/webapi/CopilotChat/Skills/ChatSkills/ChatSkill.cs
Show resolved
Hide resolved
d20b494 to
d973ee7
Compare
teresaqhoang
approved these changes
Jun 16, 2023
amsacha
approved these changes
Jun 17, 2023
adrianwyatt
approved these changes
Jun 17, 2023
adrianwyatt
added a commit
that referenced
this pull request
Jun 17, 2023
adrianwyatt
added a commit
that referenced
this pull request
Jun 19, 2023
markwallace-microsoft
pushed a commit
to markwallace-microsoft/semantic-kernel
that referenced
this pull request
Jun 23, 2023
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Brings in support for multi-user chat experience with AI to Copilot Chat. This will further show case what we can build with SK and the power of Copilot in multi-user settings. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Create ChatParticipant model to manage chat users. 2. Create FE and BE logic to allow users to join chats. 3. Use SignalR to achieve real time chatting experiences. 4. Documents permissions will remain in Chat level and Global level. 5. Plans can only be approved by the user who initiates the plans. 6. Permission for bot export/import will stay the same (i.e. anyone who is part of the chat can download a bot and anyone who has the Json can upload a bot). 7. Modify the prompts. Note: we still need to work on prompt engineering to further improve the user experience with AI.      ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Aman Sachan <51973971+amsacha@users.noreply.github.com> Co-authored-by: amsacha <amsacha@microsoft.com> Co-authored-by: Teresa Hoang <tehoang@microsoft.com> Co-authored-by: Teresa Hoang <125500434+teresaqhoang@users.noreply.github.com> Co-authored-by: Harleen Thind <39630244+hathind-ms@users.noreply.github.com> Co-authored-by: Adrian Bonar <56417140+adrianwyatt@users.noreply.github.com>
markwallace-microsoft
pushed a commit
to markwallace-microsoft/semantic-kernel
that referenced
this pull request
Jun 23, 2023
…" (microsoft#1534) This reverts commit 18a35e5. We're seeing 401s after deployment.
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Brings in support for multi-user chat experience with AI to Copilot Chat. This will further show case what we can build with SK and the power of Copilot in multi-user settings. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Create ChatParticipant model to manage chat users. 2. Create FE and BE logic to allow users to join chats. 3. Use SignalR to achieve real time chatting experiences. 4. Documents permissions will remain in Chat level and Global level. 5. Plans can only be approved by the user who initiates the plans. 6. Permission for bot export/import will stay the same (i.e. anyone who is part of the chat can download a bot and anyone who has the Json can upload a bot). 7. Modify the prompts. Note: we still need to work on prompt engineering to further improve the user experience with AI.      ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Aman Sachan <51973971+amsacha@users.noreply.github.com> Co-authored-by: amsacha <amsacha@microsoft.com> Co-authored-by: Teresa Hoang <tehoang@microsoft.com> Co-authored-by: Teresa Hoang <125500434+teresaqhoang@users.noreply.github.com> Co-authored-by: Harleen Thind <39630244+hathind-ms@users.noreply.github.com> Co-authored-by: Adrian Bonar <56417140+adrianwyatt@users.noreply.github.com>
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
…" (microsoft#1534) This reverts commit 18a35e5. We're seeing 401s after deployment.
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
…oft#1345)" (microsoft#1534)" (microsoft#1556) This reverts commit 8357616 which re-merged multi-user Copilot Chat
golden-aries
pushed a commit
to golden-aries/semantic-kernel
that referenced
this pull request
Oct 10, 2023
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Brings in support for multi-user chat experience with AI to Copilot Chat. This will further show case what we can build with SK and the power of Copilot in multi-user settings. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Create ChatParticipant model to manage chat users. 2. Create FE and BE logic to allow users to join chats. 3. Use SignalR to achieve real time chatting experiences. 4. Documents permissions will remain in Chat level and Global level. 5. Plans can only be approved by the user who initiates the plans. 6. Permission for bot export/import will stay the same (i.e. anyone who is part of the chat can download a bot and anyone who has the Json can upload a bot). 7. Modify the prompts. Note: we still need to work on prompt engineering to further improve the user experience with AI.      ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Aman Sachan <51973971+amsacha@users.noreply.github.com> Co-authored-by: amsacha <amsacha@microsoft.com> Co-authored-by: Teresa Hoang <tehoang@microsoft.com> Co-authored-by: Teresa Hoang <125500434+teresaqhoang@users.noreply.github.com> Co-authored-by: Harleen Thind <39630244+hathind-ms@users.noreply.github.com> Co-authored-by: Adrian Bonar <56417140+adrianwyatt@users.noreply.github.com>
golden-aries
pushed a commit
to golden-aries/semantic-kernel
that referenced
this pull request
Oct 10, 2023
…" (microsoft#1534) This reverts commit e90daf2. We're seeing 401s after deployment.
golden-aries
pushed a commit
to golden-aries/semantic-kernel
that referenced
this pull request
Oct 10, 2023
…oft#1345)" (microsoft#1534)" (microsoft#1556) This reverts commit 7332556 which re-merged multi-user Copilot Chat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Brings in support for multi-user chat experience with AI to Copilot Chat. This will further show case what we can build with SK and the power of Copilot in multi-user settings.
Description
Note: we still need to work on prompt engineering to further improve the user experience with AI.
Contribution Checklist
dotnet format