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
- Make a GitHub repo
- Change to the directory
- Create a project with
dotnet new console
- Add a bunch of packages listed below
- Grab the folder of
RepoUtils
to add to your project - Get a simple program that is taken from the
KernelSyntaxExamples
- Remove all the junk around it like in the example below
- 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!