-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Copilot Chat: Add StepwisePlanner to Copilot Chat Sample App #1879
Comments
Did you try adding this to your to your <PackageReference Include="Microsoft.SemanticKernel.Planning.StepwisePlanner" Version="0.17.230629.1-preview" /> |
@hollygrimm Thank you that helped! Just curious, why do we need to add a reference in .csproj file for StepwisePlanner because I didn't see any for SequentialPlanner or ActionPlanner? I had to implement a workaround to fix another issue: In StepwisePlanner.cs there is no CreatePlanAsync method. I could only find the CreatePlan method. Is there a reason that CreatePlanAsync is not implemented for StepwisePlanner? FYI, here is how I modified the code to make it work:
BTW, I used the preview version of VS Code Copilot Chat to help fix the problem. It suggested using Task.FromResult(). It also suggested using a switch statement instead of "if else" to improve readability and maintainability. |
@samleegithub If you run > Microsoft.SemanticKernel.Abstractions 0.17.230629.1-preview
> Microsoft.SemanticKernel.Core 0.17.230629.1-preview
> Microsoft.SemanticKernel.Planning.ActionPlanner 0.17.230629.1-preview
> Microsoft.SemanticKernel.Planning.SequentialPlanner 0.17.230629.1-preview
|
Hello @samleegithub, glad to hear you are interested in the stepwise planner and excited to see that you are playing with the code! Our team is also actively working on bring the Stepwise planner to CC: #1758. Stay tuned! |
Hey @samleegithub, to answer your question:
You can think of Stepwise planner as a planning system that loops through an intent detection pattern. Its plan creation is not asynchronous because it creates a static single-step plan that always has the same function: ExecutePlan (populated with the kernel's functions and other context). So when you get this plan back from Stepwise Planner and invoke it, it will invoke the ExecutePlan function, which loops through a chain of thought, action, and observation until it finds the answer. It'll give propose an action (function + parameters to call), invoke, then make an observation based on the output of the function, correct as necessary and repeat, or return if it thinks it meets the goal. This example shows the flow pretty well:
And Lee (creator of Stepwise Planner) explains it more in detail with examples here: This video is super helpful in explaining it: What is the Stepwise Planner? Motivation and Walkthrough | Intro to Semantic Kernel - YouTube Hope this helps! |
Closing for now. Reopen if necessary. |
Add StepwisePlanner to Copilot Chat Sample App.
I tried to do it myself but I'm unable to figure out why StepwisePlanner could not be found.
I am getting this error:
First, I made the same changes in this pull request (#1811) to get Copilot Chat working with the "0.17.230629.1-preview" version:
Next I added this code to https://github.com/microsoft/semantic-kernel/blob/main/samples/apps/copilot-chat-app/webapi/CopilotChat/Skills/ChatSkills/CopilotChatPlanner.cs:
I added a new enum for Stepwise here: https://github.com/microsoft/semantic-kernel/blob/main/samples/apps/copilot-chat-app/webapi/CopilotChat/Models/ProposedPlan.cs
Finally, I set Planner Type to "Stepwise" here: https://github.com/microsoft/semantic-kernel/blob/main/samples/apps/copilot-chat-app/webapi/appsettings.json
The text was updated successfully, but these errors were encountered: