Getting Started With Semantic Kernel 1.0.0-beta1

If you’d like to get started from scratch on a .NET/C# project with Semantic Kernel, you’ve arrived at the right place.

Steps

  1. Make a GitHub repo
  2. Change to the directory
  3. Create a project with dotnet new console
  4. Add a bunch of packages listed below
  5. Grab the folder of RepoUtils to add to your project
  6. Get a simple program that is taken from the KernelSyntaxExamples
  7. Remove all the junk around it like in the example below
  8. You should be able to then dotnet run

Required Nuget Packages

% dotnet add package Microsoft.SemanticKernel --version 1.0.0-beta1
% dotnet add package Microsoft.Extensions.Configuration
% dotnet add package Microsoft.Extensions.Logging
% dotnet add package Microsoft.Extensions.Configuration.UserSecrets
% dotnet add package Microsoft.Extensions.Logging.Console

I’m happy to be told later why I had to add the subpackages of a larger package … but I’ll save that for being flamed another day :-).

Your Program.cs

// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Threading.Tasks;
using Microsoft.SemanticKernel.Plugins.Core;
using RepoUtils;

Console.WriteLine("======== Functions ========");

// Load native plugin
var text = new TextPlugin();

// Use function without kernel
var result = text.Uppercase("ciao!");

Console.WriteLine(result);

Okay! You’re good to go!