#r "nuget: Microsoft.SemanticKernel, 1.23.0" #!import config/Settings.cs using Microsoft.SemanticKernel; using Kernel = Microsoft.SemanticKernel.Kernel; var builder = Kernel.CreateBuilder(); // Configure AI backend used by the kernel var (useAzureOpenAI, model, azureEndpoint, apiKey, orgId) = Settings.LoadFromFile(); if (useAzureOpenAI) builder.AddAzureOpenAIChatCompletion(model, azureEndpoint, apiKey); else builder.AddOpenAIChatCompletion(model, apiKey, orgId); var kernel = builder.Build(); // FunPlugin directory path var funPluginDirectoryPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "..", "..", "prompt_template_samples", "FunPlugin"); // Load the FunPlugin from the Plugins Directory var funPluginFunctions = kernel.ImportPluginFromPromptDirectory(funPluginDirectoryPath); // Construct arguments var arguments = new KernelArguments() { ["input"] = "time travel to dinosaur age" }; // Run the Function called Joke var result = await kernel.InvokeAsync(funPluginFunctions["Joke"], arguments); // Return the result to the Notebook Console.WriteLine(result);