.Net: Update Sequential Planner example with plan recall#2365
Merged
lemillermicrosoft merged 11 commits intomicrosoft:mainfrom Aug 16, 2023
Merged
.Net: Update Sequential Planner example with plan recall#2365lemillermicrosoft merged 11 commits intomicrosoft:mainfrom
lemillermicrosoft merged 11 commits intomicrosoft:mainfrom
Conversation
rogerbarreto
requested changes
Aug 9, 2023
dotnet/samples/KernelSyntaxExamples/Example12_SequentialPlanner.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/KernelSyntaxExamples/Example12_SequentialPlanner.cs
Outdated
Show resolved
Hide resolved
This commit updates the Sequential Planner example to include a new feature that demonstrates how to save and recall a plan for future use. It also refactors some code to improve readability and maintainability, such as extracting methods for initializing the kernel with memory and retrieving the memory store.
📝 Update copyright notice in Example12_SequentialPlanner.cs Update the copyright notice in the Example12_SequentialPlanner.cs file to include the Unicode BOM. No other changes were made in this commit.
Rearrange and refactor the methods for initializing the kernel, memory, and planner in Example12_SequentialPlanner.cs. This change improves the code organization and makes it easier to understand the initialization process.
7eed689 to
8249b94
Compare
Removed unnecessary else block and simplified the memory initialization process in the Example12_SequentialPlanner class. This change makes the code more readable and easier to maintain.
rogerbarreto
requested changes
Aug 10, 2023
dmytrostruk
approved these changes
Aug 16, 2023
SOE-YoungS
pushed a commit
to SOE-YoungS/semantic-kernel
that referenced
this pull request
Nov 1, 2023
) This commit updates the Sequential Planner example to include a new feature that demonstrates how to save and recall a plan for future use. It also refactors some code to improve readability and maintainability, such as extracting methods for initializing the kernel with memory and retrieving the memory store. Resolves microsoft#2343 ### Example Output ``` ======== Sequential Planner - Create and Execute Email Plan ======== Original plan: Goal: Summarize an input, translate to french, and e-mail to John Doe Steps: - SummarizeSkill.Summarize INPUT='$INPUT' => SUMMARIZED_TEXT - WriterSkill.Translate input='$SUMMARIZED_TEXT' language='French' => FRENCH_SUMMARY - email.GetEmailAddress INPUT='John Doe' => JOHN_DOE_EMAIL - email.SendEmail email_address='$JOHN_DOE_EMAIL' INPUT='$FRENCH_SUMMARY' Step 1 - Results so far: In a distant kingdom, King Arjun ruled fairly, but a dragon terrorized his people. Archer Mira offered help, killed the dragon with one shot, and married Arjun. They ruled together, living happily ever after, with Mira remembered as their savior. Step 2 - Results so far: Dans un royaume lointain, le roi Arjun régnait de manière juste, mais un dragon terrorisait son peuple. L'archère Mira proposa son aide, tua le dragon d'un seul coup et épousa Arjun. Ils régnèrent ensemble, vivant heureux pour toujours, et Mira fut commémorée en tant que leur sauveuse. Step 3 - Results so far: johndoe1234@example.com Step 4 - COMPLETE! Sent email to: johndoe1234@example.com. Body: Dans un royaume lointain, le roi Arjun régnait de manière juste, mais un dragon terrorisait son peuple. L'archère Mira proposa son aide, tua le dragon d'un seul coup et épousa Arjun. Ils régnèrent ensemble, vivant heureux pour toujours, et Mira fut commémorée en tant que leur sauveuse. ======== Sequential Planner - Find and Execute Saved Plan ======== Goal: Write summary in french and e-mail John Doe Searching for saved plan... Restored plan (relevance=0.9370563865513345): Goal: Summarize an input, translate to french, and e-mail to John Doe Steps: - SummarizeSkill.Summarize INPUT='$INPUT' => SUMMARIZED_TEXT - WriterSkill.Translate INPUT='$SUMMARIZED_TEXT' language='French' => FRENCH_SUMMARY - email.GetEmailAddress INPUT='John Doe' => JOHN_DOE_EMAIL - email.SendEmail email_address='$JOHN_DOE_EMAIL' INPUT='$FRENCH_SUMMARY' Result: Sent email to: johndoe1234@example.com. Body: Dans un futur lointain, Remy, 15 ans, découvre un secret dangereux, ce qui le force à fuir avec l'aide d'Eve. Poursuivis par la Fédération Galactique, ils découvrent son passé, révélant qu'il n'est pas un garçon ordinaire. ``` ### 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 - [x] I didn't break anyone 😄 --------- Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit updates the Sequential Planner example to include a new feature that demonstrates how to save and recall a plan for future use. It also refactors some code to improve readability and maintainability, such as extracting methods for initializing the kernel with memory and retrieving the memory store.
Resolves #2343
Example Output
Contribution Checklist