-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Python: add stepwise planner #2223
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
Python: add stepwise planner #2223
Conversation
…ave/semantic-kernel into python-add-stepwise-planner
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.
Hi @joowon-dm-snu,
Thanks for porting stepwise planner to python SK. And thank for you identifying the bug in plan.py. I am going to cherry pick the plan.py change out to a separate PR and add a new test for it as it's needed downstream for something else.
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
### Motivation and Context Initially called out and fixed by @joowon-dm-snu in #2223 This PR closes [#2094](#2094) There was a bug in the Plan Object Model that propagates the name of the step parameter to the next step. It should be propagating the parameter's value ### Description In addition to making the code change to fix the bug, also added a unit test that covers the changed code. Below image shows the before and after of the test with the fix.  ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 Co-authored-by: Abby Harrison <[email protected]>
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
python/tests/integration/planning/stepwise_planner/test_stepwise_planner.py
Show resolved
Hide resolved
python/semantic_kernel/planning/stepwise_planner/stepwise_planner_config.py
Show resolved
Hide resolved
python/semantic_kernel/planning/stepwise_planner/stepwise_planner.py
Outdated
Show resolved
Hide resolved
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.
It'd be worth doing the webskill improvement IMO but would understand if better for a different PR. And we can iterate on any changes we do in dotnet (after we create a good validation suite).
Rearranged the order of chat completion parameters in both `ChatRequestSettings` and `OpenAIChatCompletion` classes for better readability. Updated test cases to reflect these changes and added a new test case for stop sequences.
FYI @joowon-dm-snu I pushed a commit to fix the UTs. |
python/tests/integration/planning/stepwise_planner/test_stepwise_planner.py
Outdated
Show resolved
Hide resolved
…#2388) ### Motivation and Context Initially called out and fixed by @joowon-dm-snu in microsoft#2223 This PR closes [microsoft#2094](microsoft#2094) There was a bug in the Plan Object Model that propagates the name of the step parameter to the next step. It should be propagating the parameter's value ### Description In addition to making the code change to fix the bug, also added a unit test that covers the changed code. Below image shows the before and after of the test with the fix.  ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 Co-authored-by: Abby Harrison <[email protected]>
### 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. --> implement stepwise planner microsoft#2221 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Abby Harrison <[email protected]> Co-authored-by: Lee Miller <[email protected]> Co-authored-by: Abby Harrison <[email protected]>
Motivation and Context
implement stepwise planner #2221
Description
Contribution Checklist