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

Add support for custom context in plan execution #826

Merged
merged 7 commits into from May 6, 2023

Conversation

lemillermicrosoft
Copy link
Member

@lemillermicrosoft lemillermicrosoft commented May 5, 2023

This commit fixes a bug that allows users to pass a custom SKContext object to a plan invocation, which can override or augment the default context variables. This enables more flexibility and control over the plan execution and the output. The commit also adds a unit test to verify the functionality of the new feature.

Contribution Checklist

@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels May 5, 2023
@lemillermicrosoft lemillermicrosoft added bug Something isn't working PR: ready for review All feedback addressed, ready for reviews PR: in progress Under development and/or addressing feedback and removed PR: ready for review All feedback addressed, ready for reviews labels May 5, 2023
@lemillermicrosoft lemillermicrosoft added PR: ready for review All feedback addressed, ready for reviews and removed PR: in progress Under development and/or addressing feedback labels May 5, 2023
lemillermicrosoft and others added 7 commits May 5, 2023 21:14
      Summary: This commit fixes a bug that allows users to pass a custom SKContext object to a plan invocation, which can override or augment the default context variables. This enables more flexibility and control over the plan execution and the output. The commit also adds a unit test to verify the functionality of the new feature.
      Summary: This commit adds the ability to execute a plan with a custom state and parameters, as well as overriding the input and other variables from the context. It also adds unit tests to verify the behavior of the plan execution with different combinations of state, parameters, and context. The commit modifies the GetNextStepVariables method in the Plan class to implement the logic for resolving the variables for each step in the plan. It also updates the documentation to explain the priority order for the variables.
      Summary: This commit replaces the hard-coded string "INPUT" with the constant ContextVariables.MainKey in two places where it is used to refer to the main context variable name. This improves readability and consistency, and avoids potential typos or mismatches.
      Summary: This commit simplifies the logic for setting step variables in the Plan class by removing redundant checks for empty strings. The variables.Get and State.Get methods already handle empty strings internally, so there is no need to check them again. This makes the code more readable and consistent.
@shawncal shawncal merged commit 930d585 into microsoft:main May 6, 2023
9 checks passed
codebrain pushed a commit to searchpioneer/semantic-kernel that referenced this pull request May 16, 2023
This commit fixes a bug that allows users to pass a custom SKContext
object to a plan invocation, which can override or augment the default
context variables. This enables more flexibility and control over the
plan execution and the output. The commit also adds a unit test to
verify the functionality of the new feature.

Co-authored-by: Lee Miller <lemillermicrosoft@users.noreply.github.com>
Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
dehoward pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
This commit fixes a bug that allows users to pass a custom SKContext
object to a plan invocation, which can override or augment the default
context variables. This enables more flexibility and control over the
plan execution and the output. The commit also adds a unit test to
verify the functionality of the new feature.

Co-authored-by: Lee Miller <lemillermicrosoft@users.noreply.github.com>
Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants