Skip to content

Feature: Copilot Chat #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 85 commits into from
Closed

Feature: Copilot Chat #290

wants to merge 85 commits into from

Conversation

adrianwyatt
Copy link
Contributor

@adrianwyatt adrianwyatt commented Apr 3, 2023

Motivation and Context

  • Adds frontend webapp (React)
  • Add backend SKWebApi (SK REST API Service) for CopilotChat sample
  • Adds CosmosDB connector memory store

Description

craigomatic and others added 29 commits March 20, 2023 16:08
### Motivation and Context
This will form the foundation of the next unit of work.

### Description
Basic aspnet web api with a reference to the SK nuget package.
This PR builds out a component skeleton that will serve as the
foundation for the SK Chatbot. This includes:

- Chat Window with populated conversations list and chat room showing
active conversation or chat history
- Ability to add new chat
- Ability to update chat name
### Motivation and Context
- Refactors state to only track one conversations object (removes Chat
slice)
- Adds support for SK sample server
+ refinements

### Description
On Chat input enter, a simple POST is made to the SK sample server and
this serves as the bot response (for now).
See README for instructions on how to run the app. 

Also removes some instances of token acquisition -- I'll have a
different POC for this later.

Conversation state was also changed to frontload most recent updates so
latest chat interaction is shown at the top of left rail
### Motivation and Context
To create a better chat experience, the prompt to the completion model
is composed of multiple dynamic components, including command messages,
user intent, and memories, etc. The prompt will evolve as the
conversation between the user and the application proceeds.

### Description
1. Add a new chat skill containing multiple functions that will work
together to construct the final prompt for each exchange.
**Motivation and Context**
Have a server encapsulating SK functionality in a way that can support
all future skills

**Description**
- Add config classes
- Add request classes
- Configure server
- Configure DI services
- Create SK controller
- Contribution Checklist
### Motivation and Context
A couple changes to the kernel since the last rebase to main that
affected the skill implementation:
1. The class CompleteRequestSettings was moved to another scope.
2. IsCriticalException() was change to internal.
3. MemoryQueryResult got another property called Metadata that
encapsulated properties that previously lived directly under
MemoryQueryResult.

### Description
Update the chat skill to align with the latest kernel changes.
**Motivation and Context**
We want stuff that works and this enables to app to compile and to
address ChatSkill invocations

**Description**
Fixed code to work with latest changes from main
Added in required native skills
Addressed style issues highlighted by VS
### Motivation and Context
Currently there is not a 1st party persistent memorystore implementation
for Semantic Kernel. This PR adds that support so that memories can be
stored in CosmosDB.

### Description
* Adds a new project to SemanticKernel.Skills called
SemanticKernel.Skills.CosmosDB
* This project contains a class `CosmosMemoryStore` which can be added
to the kernel during configuration, as the backing store

Example usage:

```csharp
var client = new CosmosClient("<your connection string>");
var db = "<an existing database in CosmosDB>";
var container = "<an existing container in the database>";

var memoryStore = new CosmosMemoryStore<float>(client, db, container);

var sk = Kernel.Builder
    .WithLogger(NullLogger.Instance)
    .WithMemory(memoryStore)
    .Configure(c =>
    {
       //add your model endpoints here
    })
    .Build();
```
### Motivation and Context
Adapt code to SKWebAPI (as opposed to KernelHttpServer)

### Description
Change Web App to reflect new backend
Put in way to set port on backend
### Motivation and Context
Clean up the folder structure.


### Description
Aligns with the existing folder structure and adds the CosmosDB memory
store implementation to the SKWebApi

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

<!-- Thank you for your contribution to the semantic-kernel repo! -->
### Motivation and Context
Currently the frontend invokes the FunSkill Joke function which is just
a placeholder.

### Description
Invoke the ChatSkill Chat function to actually get a response.
### Motivation and Context
We don't want to show the SK icons.

### Description
Replace the SK Icons with icons of different colors representing
different chats.
**Motivation and Context**
Since SK's kernel disposes of some objects when it is disposed of,
having those objects fed in as singletons would lead to the SK to only
be able to work once and then fail on future invocations because it was
trying to access disposed objects.

**Description**
Made more objects scoped (to requests) rather than singletons.
### Motivation and Context
Removing Vite dependency to simplify toolchain + updating README

### Description
We are authenticating with the /common endpoint, and in order to use
/common/ endpoint, the application must not be configured with
'Consumer' as the user audience. The userAudience should be configured
with 'All' to use /common/ endpoint.
@adrianwyatt adrianwyatt self-assigned this Apr 3, 2023
glahaye and others added 27 commits April 4, 2023 14:14
### Motivation and Context
We are working to update Planning to be object based rather than skill
based, to help abstract the semantic structure of plans (XML, etc.) away
from users into an abstract syntax tree. This will make it so developers
do not have to parse and modify XML manually and enable developers to
create their own plan and plan generators that can be executed by the
kernel.

### Description
This changes adds the following classes and interfaces to the
SemanticKernel.Planning namespace:

- IPlan: An interface that represents a plan for achieving a goal using
a semantic kernel.
- BasePlan: A base class that implements the IPlan interface with some
default properties and methods.
- PlanStep: A class that represents a single step in a plan, including
the description, the selected skill and function, the named parameters,
the output and result keys, and the optional children steps.
- KernelPlanningExtensions: A static class that provides extension
methods for running a plan using an IKernel instance.
- Renames the Plan class to SkillPlan, to avoid confusion with the
PlanExecution class and other types of plans in the SemanticKernel
namespace
### Motivation and Context
Fix the build

### Description
This commit adds a pragma directive to suppress the IDE0130 warning that
suggests using the file name as the namespace for the
KernelPlanningExtensions.cs file. This warning is not applicable for
extension methods, as they need to be in the same namespace as the type
they are extending. The commit also adds a using directive for the
Microsoft.SemanticKernel.Planning namespace, which is needed for the
extension methods.
Simple fixes, dictionary words and methods visibility
### Motivation and Context
Skill.cs was not used at all

### Description
Remove Skill.cs
### Motivation and Context
Make appsettings easier to use

### Description
Remove unused part, comment better, make file easier to use and tougher
to accidentally abuse
### Motivation and Context
Give the possibility to use HTTP so that people just trying out the
service don't have to deal with cert issues (self-signed or otherwise)

### Description
Added flag to toggle HTTP / HTTPS
### Motivation and Context
Minor cleanup of unused IDispoable on CosmosDBMemoryStore
### Motivation and Context
To create clarity for onboarding of Copilot Chat sample app.

### Description
Added readme and two images to Copilot Chat directory.
### Motivation and Context
Updated readme files to be more accurate, and include UseHttp flag.
Added example.env file back to branch.
### Motivation and Context
Minor updates to CopilotChat from PR feedback

### Description
- Added XMLDoc the CosmosDBRecord
- Reverted FileCompression changes (unrelated)
- Refactored CosmosDB storage to work with new IMemoryStore model.

---------

Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
Co-authored-by: amsacha <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: SergeyMenshykh <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: microsoftShannon <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
Co-authored-by: amsacha <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: SergeyMenshykh <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
Co-authored-by: amsacha <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: SergeyMenshykh <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
Co-authored-by: amsacha <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: SergeyMenshykh <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
@adrianwyatt
Copy link
Contributor Author

Abandoning to resolve conflicts in a non-feature branch.

@adrianwyatt adrianwyatt closed this Apr 6, 2023
@dluc dluc deleted the feature-refapp branch April 7, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: in progress Under development and/or addressing feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants