Skip to content

Copilot Chat: Multi-user support with SignalR#1345

Merged
adrianwyatt merged 45 commits intomainfrom
feature-copilotmultiuser
Jun 17, 2023
Merged

Copilot Chat: Multi-user support with SignalR#1345
adrianwyatt merged 45 commits intomainfrom
feature-copilotmultiuser

Conversation

@TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Jun 5, 2023

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

  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.

image
image
image
image
image

Contribution Checklist

amsacha and others added 12 commits May 31, 2023 15:52
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.

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/c63fd541-ffb4-4564-b020-20fdd728bbbe)

<!-- 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.

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/92002f11-9e12-429f-b0d1-72eedbe34fed)

<!-- 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 😄
@TaoChenOSU TaoChenOSU added PR: in progress Under development and/or addressing feedback samples labels Jun 5, 2023
@TaoChenOSU TaoChenOSU self-assigned this Jun 5, 2023
@TaoChenOSU TaoChenOSU added PR: ready for review All feedback addressed, ready for reviews and removed PR: in progress Under development and/or addressing feedback labels Jun 5, 2023
@adrianwyatt adrianwyatt added PR: feedback to address Waiting for PR owner to address comments/questions and removed PR: ready for review All feedback addressed, ready for reviews labels Jun 5, 2023
Copy link
Contributor

@teresaqhoang teresaqhoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReadMEs also need updated

And we should bug bash this as a team before it goes in

@TaoChenOSU TaoChenOSU force-pushed the feature-copilotmultiuser branch from d20b494 to d973ee7 Compare June 7, 2023 23:51
@amsacha amsacha requested a review from a team as a code owner June 17, 2023 00:11
@adrianwyatt adrianwyatt added this pull request to the merge queue Jun 17, 2023
Merged via the queue into main with commit 18a35e5 Jun 17, 2023
adrianwyatt added a commit that referenced this pull request Jun 17, 2023
This reverts commit 18a35e5. We're
seeing 401s after deployment.
adrianwyatt added a commit that referenced this pull request Jun 19, 2023
#1534)" (#1556)

This reverts commit 8357616 which
re-merged multi-user Copilot Chat
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.


![image](https://github.com/microsoft/semantic-kernel/assets/12570346/84d07b48-5bc5-44a4-8326-9f8007ece16a)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/58a14bb5-126f-4f14-870a-5837dccb9a5f)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9d75b49b-d0a3-4bc4-8414-a288e68c92d4)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/48e4e6b6-2a7a-4675-a381-ce2e3ec5c8dc)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9ab27650-ce40-479c-8834-e4b2f5caaccf)


### 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.


![image](https://github.com/microsoft/semantic-kernel/assets/12570346/84d07b48-5bc5-44a4-8326-9f8007ece16a)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/58a14bb5-126f-4f14-870a-5837dccb9a5f)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9d75b49b-d0a3-4bc4-8414-a288e68c92d4)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/48e4e6b6-2a7a-4675-a381-ce2e3ec5c8dc)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9ab27650-ce40-479c-8834-e4b2f5caaccf)


### 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
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.


![image](https://github.com/microsoft/semantic-kernel/assets/12570346/84d07b48-5bc5-44a4-8326-9f8007ece16a)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/58a14bb5-126f-4f14-870a-5837dccb9a5f)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9d75b49b-d0a3-4bc4-8414-a288e68c92d4)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/48e4e6b6-2a7a-4675-a381-ce2e3ec5c8dc)

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/9ab27650-ce40-479c-8834-e4b2f5caaccf)


### 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
@teresaqhoang teresaqhoang deleted the feature-copilotmultiuser branch December 13, 2023 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: ready for review All feedback addressed, ready for reviews

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

6 participants