Files
semantic-kernel/samples
Teresa HoangandShawn Callegari e195f4def9 Copilot Chat: Display usernames in Copilot Chat (#1899)
### 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.
-->

This PR adds support for fetching user data for each user in a chat
session, allowing us to display usernames instead of GUIDs in user
lists.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

- User data is loaded per conversation for optimization but only fetched
per user.
- Fetched user data is stored and indexed globally, since users can be
part of multiple chats.
- User data is fetched only if the user exists in the same tenant as the
active user due to AAD access restrictions, otherwise, user display name
will be "External Guest".

> Note: right now, external user's names will show up in the chat
history since we save user names as part of the chat message, but this
will be removed in future work:
https://github.com/orgs/microsoft/projects/852?pane=issue&itemId=29734028


![image](https://github.com/microsoft/semantic-kernel/assets/125500434/2e6d7e78-85d1-4045-93b4-651c0e19ae4a)

### 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: Shawn Callegari <[email protected]>
2023-07-11 18:44:47 +00:00
..