Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created June 11, 2024 21:54
Show Gist options
  • Save xximjasonxx/7cad6ab40cbe7a15210ad6c817eafeed to your computer and use it in GitHub Desktop.
Save xximjasonxx/7cad6ab40cbe7a15210ad6c817eafeed to your computer and use it in GitHub Desktop.
var builder = Kernel.CreateBuilder();
builder.Plugins.AddFromType<MathPlugin>();
builder.AddAzureOpenAIChatCompletion("<deployment name>", "<endpoint>", "<key>");
var kernel = builder.Build();
#pragma warning disable // Suppress the diagnostic messages
var planner = new HandlebarsPlanner(new HandlebarsPlannerOptions() { AllowLoops = true });
var plan = await planner.CreatePlanAsync(kernel, $"Get the result of subtracting 10 from the sum of factorials {numberOne} and {numberTwo}");
var planResult = await plan.InvokeAsync(kernel, new KernelArguments());
Console.WriteLine(planResult);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment