March 7th, 2024

Navigating the Transition: Semantic Kernel .NET V1 Migration Guide

On Monday we introduced the Python Beta and on Tuesday we announced the Java Release Candidate. Today we’ll dive into Microsoft’s Semantic Kernel migration plan detailing the changes needed to get to V1+ of the .NET version of Semantic Kernel.

Microsoft’s Semantic Kernel offers powerful capabilities for natural language understanding, and with the release of Semantic Kernel .NET V1, developers can unlock even more potential in their applications like automatic function calling, native dependency injection support, and improved prompt templates. To make it easier to migrate, we’ve prepared the V1+ of .NET Semantic Kernel migration guide to provide a comprehensive overview of the changes and steps needed to upgrade smoothly. Below are some of the highlights!

Package Changes

One of the significant changes in Semantic Kernel .NET V1 was the restructuring of packages. As a result of many packages being redefined, removed and renamed, many of our old packages needed to be renamed or removed as well.

Package Removal and Changes Needed

Ensure that your application matches the latest versions required by Semantic Kernel V1.

This includes updating packages like Microsoft.Extensions.Configuration, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.Http, and Microsoft.Extensions.Logging to version 8.0.0.

Convention Name Changes

Semantic Kernel V1 introduces changes in naming conventions to align with the AI community and improve clarity. Functions, variables, and settings have been renamed to reflect common terminology in the AI community.

Many of our internal naming conventions were changed to better reflect how the AI community names things. As OpenAI started the massive shift and terms like Prompt, Plugins, Models, RAG were taking shape it was clear that we needed to align with those terms to make it easier for the community to understand use the SDK.

Code Name Changes

Following the convention name changes, many of the code names were also changed to better reflect the new naming conventions. Abbreviations like “SK” were also removed to make the code more readable.

Namespace Simplifications

To reduce complexity and improve usability, namespaces in Semantic Kernel packages have been simplified. This allows developers to use fewer ‘using’ statements in their code, enhancing overall code readability.

Kernel Changes

The Kernel class has undergone significant simplification, with the removal of the IKernel interface as Developers should not need to create their own Kernel implementation.

Kernel Result and Context Changes

With the introduction of FunctionResult, the need for KernelResult has been eliminated. Additionally, SKContext has been replaced by KernelArguments for function inputs and FunctionResult for outputs, simplifying the API and improving usability.

Introducing the KernelPlugin Entity: Before V1 there wasn’t aconcrete concept of a plugin centric entity. This changed in V1 and for any function you add to a Kernel you will get a Plugin that it belongs to.

Usage of Experimental Attribute Feature

Certain functionalities in Semantic Kernel V1 are marked as experimental, indicating that they may change or be removed in future releases. As we approach Microsoft Build, most of these experimental features will be made non-experimental.

Prompt Configuration Files

Prompt configuration files have undergone changes to accommodate new naming conventions and settings. The biggest change was introducing the ability to have multiple service/model configurations.

Other naming changes to note:

  • completion was renamed to execution_settings
  • input was renamed to input_variables
  • defaultValue was renamed to default
  • parameters was renamed to input_variables
  • Each property name in the execution_settings once matched to the service_id will be used to configure the service/model execution settings. i.e.

Migrating to Semantic Kernel .NET V1 offers exciting opportunities for developers to leverage enhanced capabilities and improved performance. By following this migration guide and staying informed about the changes introduced in V1, developers can smoothly transition their applications and unlock the full potential of Semantic Kernel. If you have any questions please reach out to us on the discussion boards on GitHub!

0 comments

Discussion are closed.