>dotnet new console (After creating a folder in VSCode run this command to create a C# project)
>dotnet add package Microsoft.SemanticKernel --version 1.30.0 (This command will install the Semantic Kernal SDK
>dotnet run
Create Azure OpenAI end-point and deployment and the following code is a hello-world code to test your setup:
using Microsoft.SemanticKernel;
// Populate values from your OpenAI deployment
var modelId = "<Model Name From Deployment>";
var endpoint = "<EndPoint URL>";
var apiKey = "<API KEY>";
// Create a kernel with Azure OpenAI chat completion
var builder = Kernel.CreateBuilder().AddAzureOpenAIChatCompletion(modelId, endpoint, apiKey);
// Build the kernel
Kernel kernel = builder.Build();
var result = await kernel.InvokePromptAsync("Give me a list of breakfast foods with eggs and cheese");
Console.WriteLine(result);
No comments:
Post a Comment