Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: make planner constructors more similar #2849

Merged
merged 17 commits into from Sep 21, 2023

Conversation

hario90
Copy link
Contributor

@hario90 hario90 commented Sep 15, 2023

Motivation and Context

Fixes #2847, #2519

Contains breaking changes.

This addresses inconsistencies in planner construction. The planners sometimes took a prompt override through a delegate in the config and sometimes as a constructor argument. Additionally, the ActionPlanner used to take a loggerFactory as a constructor argument while the other planners did not.

The goal of these changes is to make working with planners more predictable.

Description

  • Added GetPromptTemplate delegate function to the planner base config. All planners will use this to get the prompt override.
  • Removed logger factory argument from ActionPlanner constructor. Used the Kernel's logger factory to create a new logger within each planner constructor.
  • Renamed private Config private instance field to _config

Contribution Checklist

@hario90 hario90 requested a review from a team as a code owner September 15, 2023 21:11
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Sep 15, 2023
@hario90 hario90 changed the title make planner constructors more similar Normalize planner constructors Sep 15, 2023
@github-actions github-actions bot changed the title Normalize planner constructors .Net: make planner constructors more similar Sep 15, 2023
@lemillermicrosoft lemillermicrosoft added the PR: breaking change Pull requests that introduce breaking changes label Sep 15, 2023
@hario90 hario90 added the PR: ready for review All feedback addressed, ready for reviews label Sep 15, 2023
@shawncal
Copy link
Member

@hario90 We've got some conflicts. Can you please resolve, then ping me for final review and merge?

@hario90 hario90 added this pull request to the merge queue Sep 21, 2023
Merged via the queue into microsoft:main with commit fd391fa Sep 21, 2023
18 checks passed
@hario90 hario90 deleted the planner-constructors branch September 21, 2023 16:40
SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request Nov 1, 2023
### Motivation and Context

Fixes microsoft#2847,  microsoft#2519

Contains breaking changes.

This addresses inconsistencies in planner construction. The planners
sometimes took a prompt override through a delegate in the config and
sometimes as a constructor argument. Additionally, the ActionPlanner
used to take a loggerFactory as a constructor argument while the other
planners did not.

The goal of these changes is to make working with planners more
predictable.

### Description

* Added `GetPromptTemplate` delegate function to the planner base
config. All planners will use this to get the prompt override.
* Removed logger factory argument from ActionPlanner constructor. Used
the Kernel's logger factory to create a new logger within each planner
constructor.
* Renamed private `Config` private instance field to `_config` 

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 馃槃

---------

Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
@banduki
Copy link

banduki commented Jan 12, 2024

Is GetPromptTemplate() a delegate to allow override of the create plan prompt? If so, it seems to be ignored by the HandlebarPlanner.

If not intended to override the create plan prompt, what is it used for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: breaking change Pull requests that introduce breaking changes PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Planner Constructor normalization
5 participants