Skip to content

Commit

Permalink
Python: Retire planners that are not supported in dotnet. (#6141)
Browse files Browse the repository at this point in the history
### Motivation and Context

In dotnet, there are no action, basic or stepwise planners. Since Python
has the FunctionCallingStepwisePlanner, we will retire the legacy
stepwise planner. We're leaving the Sequential planner for the meantime
as it provides the developer with a way to show the plan steps.

<!-- 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.
-->

### Description

The PR:
- Removes the action, basic, and stepwise planners, along with their
unit/integration tests. Closes #5585
- Removes one action planner kernel syntax example.
- Updates the 05-planners Jupyter notebook to showcase the Sequential
Planner along with the FunctionCallingStepwisePlanner
- Fixes some sample paths that use the `prompt_template_samples` folder
in the root of the repo.

<!-- 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: -->

- [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 😄
  • Loading branch information
moonbox3 committed May 7, 2024
1 parent c068e86 commit db46d34
Show file tree
Hide file tree
Showing 24 changed files with 491 additions and 2,325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
Your full name, should you need to know it, is
Splendid Speckled Mosscap. You communicate
effectively, but you tend to answer with long
flowery prose. You are also a math wizard,
flowery prose. You are also a math wizard,
especially for adding and subtracting.
You also excel at joke telling, where your tone is often sarcastic.
Once you have the answer I am looking for,
Once you have the answer I am looking for,
you will return a full answer to me as soon as possible.
"""

Expand All @@ -44,7 +44,7 @@
),
)

plugins_directory = os.path.join(__file__, "../../../../samples/plugins")
plugins_directory = os.path.join(__file__, "../../../../../prompt_template_samples/")
# adding plugins to the kernel
# the joke plugin in the FunPlugins is a semantic plugin and has the function calling disabled.
# kernel.import_plugin_from_prompt_directory("chat", plugins_directory, "FunPlugin")
Expand Down
2 changes: 1 addition & 1 deletion python/samples/concepts/logging/setup_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def main():
OpenAIChatCompletion(service_id=service_id, ai_model_id="gpt-3.5-turbo", api_key=api_key, org_id=org_id)
)

plugins_directory = os.path.join(__file__, "../../../../samples/plugins")
plugins_directory = os.path.join(__file__, "../../../../../prompt_template_samples/")
plugin = kernel.add_plugin(parent_directory=plugins_directory, plugin_name="FunPlugin")

joke_function = plugin["Joke"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
chat_service,
)

plugins_directory = os.path.join(__file__, "../../../../samples/plugins")
plugins_directory = os.path.join(__file__, "../../../../../prompt_template_samples/")
# adding plugins to the kernel
# the joke plugin in the FunPlugins is a semantic plugin and has the function calling disabled.
kernel.add_plugin(parent_directory=plugins_directory, plugin_name="FunPlugin")
Expand Down
40 changes: 0 additions & 40 deletions python/samples/concepts/planners/action_planner.py

This file was deleted.

2 changes: 1 addition & 1 deletion python/samples/concepts/plugins/plugins_from_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def main():
)

# note: using plugins from the samples folder
plugins_directory = os.path.join(__file__, "../../../../samples/plugins")
plugins_directory = os.path.join(__file__, "../../../../../prompt_template_samples/")
plugin = kernel.add_plugin(parent_directory=plugins_directory, plugin_name="FunPlugin")

arguments = KernelArguments(input="time travel to dinosaur age", style="super silly")
Expand Down
2 changes: 1 addition & 1 deletion python/samples/getting_started/00-getting-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"metadata": {},
"outputs": [],
"source": [
"plugin = kernel.add_plugin(parent_directory=\"../../samples/plugins\", plugin_name=\"FunPlugin\")"
"plugin = kernel.add_plugin(parent_directory=\"../../../prompt_template_samples/\", plugin_name=\"FunPlugin\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"outputs": [],
"source": [
"# note: using plugins from the samples folder\n",
"plugins_directory = \"../../samples/plugins\"\n",
"plugins_directory = \"../../../prompt_template_samples/\"\n",
"\n",
"funFunctions = kernel.add_plugin(parent_directory=plugins_directory, plugin_name=\"FunPlugin\")\n",
"\n",
Expand Down
Loading

0 comments on commit db46d34

Please sign in to comment.