
Getting Started Guide
How to Use Semantic Kernel
A practical guide to get you up and running with Semantic Kernel. Written by Delv Editorial, Delv Team.
Getting started with Semantic Kernel
In this guide, you will learn how to set up Semantic Kernel and create your first AI integration. After following these steps, you will be able to use Microsoft’s SDK to connect AI services to your applications using C#, Python, or Java.Step 1: Sign up and set up
- Visit the Semantic Kernel website.
- Scroll down to the "Get Started" section and click on the "Download" button to access the SDK.
- Choose the appropriate version for your programming language (C#, Python, or Java) and follow the installation instructions provided on the site.
- If you need a code editor, download Visual Studio for C# or PyCharm for Python from their respective websites.
Step 2: Your first integration
- Open your code editor and create a new project in your chosen language.
- Install the Semantic Kernel package. For example, in Python, run:
pip install semantic-kernel
- Import the Semantic Kernel library in your code:
from semantic_kernel import Kernel
- Initialise the Kernel:
kernel = Kernel()
- Create a simple AI task. For example, to generate a response based on a prompt:
response = kernel.run("What is the capital of France?")
print(response)
- Save and run your project to see the output.
Step 3: Get better results
- Explore the available plugins and memory features in the Semantic Kernel documentation to enhance your application’s functionality.
- Use the
kernel.add_plugin()method to integrate additional capabilities into your project. - Adjust the parameters of your tasks for better responses. For example, you can specify the temperature settings for more creative outputs.