-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Extracting plan json from ActionPlanner result #1802
Extracting plan json from ActionPlanner result #1802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @teresaqhoang !
It would be great to add unit test under Extensions.UnitTests\Planning
to verify and showcase how new regex resolves an issue.
…aqhoang/semantic-kernel into action-planner-json-parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @teresaqhoang ! I pushed some minor improvements for tests and XML documentation. Looks good to me!
### 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. --> LLM can return additional texts (i.e., preambles, explanations) around the proposed plan, so this PR extracts a well-formed JSON from the result of the planner using a RegEx and balanced group concepts. In response to: microsoft#1726 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Also, updates any use of Plan State to Plan Parameters due to previous Planner refactor. ### 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: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
Which version of semantic kernel is this issue resolved in, using 0.5.1.dev0 I am still seeing error |
Motivation and Context
LLM can return additional texts (i.e., preambles, explanations) around the proposed plan, so this PR extracts a well-formed JSON from the result of the planner using a RegEx and balanced group concepts.
In response to: #1726
Description
Also, updates any use of Plan State to Plan Parameters due to previous Planner refactor.
Contribution Checklist
dotnet format