Instantiating a planner
Instantiating and using a planner is straightforward. In C#, we are going to use the Handlebars planner, and in Python, we will use the Stepwise planner.
C#
C# includes the new HandlebarsPlanner
, which allows you to create plans that include loops, making them shorter. Before using the Handlebars planner in C#, you need to install it with the following command:
dotnet add package Microsoft.SemanticKernel.Planners.Handlebars –-prerelease
To configure your Handlebars planner, you will also need to install the OpenAI planner connector with the following:
dotnet add package Microsoft.SemanticKernel.Planners.OpenAI --prerelease
Note that the planner is experimental, and C# will give you an error unless you let it know that you are OK with using experimental code, by adding a pragma
directive to your code:
#pragma warning disable SKEXP0060
To create a planner, we execute the following code:
var plannerOptions = new HandlebarsPlannerOptions...