in ChatBot/SemanticKernel/SemanticKernelService.cs [17:42]
public SemanticKernelService()
{
_chatHistory = new ChatHistory();
// Step 1: Create the Kernel Builder
var kernelBuilder = Kernel.CreateBuilder();
// Step 2: Add Azure OpenAI chat completion to the Kernel
// When using this sample code, please make sure to provide the following parameters:
// - modelId: The name of your deployed model in Azure OpenAI (e.g., gpt-35-turbo)
// - endpoint: The endpoint URL of your Azure OpenAI resource (starts with https)
// - apiKey: The access key for your Azure OpenAI service
var modelId = "";
var endpoint = "";
var apiKey = "";
kernelBuilder.AddAzureOpenAIChatCompletion(modelId, endpoint, apiKey);
// Step 3: Add the plugin to the kernel
kernelBuilder.Plugins.AddFromType<OrderManagementPlugin>("OrderManagement");
// Step 4: Create the Kernel
_kernel = kernelBuilder.Build();
// Step 5: Get the chat completion service
_chatCompletionService = _kernel.GetRequiredService<IChatCompletionService>();
}