Monday, November 25, 2024

Semantic Kernel: Diving into Microsoft’s AI orchestration SDK

For C#, you may set up Semantic Kernel from NuGet. The command line is:

     dotnet add package deal Microsoft.SemanticKernel

For Python, you may set up Semantic Kernel from PyPI. The command line is:

     pip set up semantic-kernel

It’s potential that you’ll want to make use of pip3 slightly than pip.

In Java, you may construct the mission within the repo from the Maven wrapper, and that can pull in every thing you want.

Irrespective of which language you utilize, you’ll want an API key, both from OpenAI or Azure OpenAI. Save the API key regionally in a secure place. You’ll additionally have to enter the API key someplace (it varies by language) in order that the code can use it to name LLMs. For those who run the Bing search instance (see screenshot under) you’ll additionally have to get a Bing API key from Azure.

Until you’ve got a robust curiosity in Python or Java, I recommend that you just learn and run the C# pocket book examples, that are at present in the very best form, i.e. they largely work with out throwing errors and largely match the documentation. Coming into the API key for these occurs interactively within the first instance.

The repository has a part on studying Semantic Kernel. Among the content material referenced is useful. Nevertheless, a number of the titles now not match the content material, and a number of the content material is at present lacking examples for explicit languages.

Sample C# notebook for Semantic Kernel

This pattern is the final of the C# notebooks for Semantic Kernel. It makes use of Bing search along side the Semantic Kernel and an OpenAI mannequin to offer present outcomes for queries.

IDG

Semantic Kernel Cookbook

The Semantic Kernel Cookbook, an open-source guide primarily centered on the implementation of the Semantic Kernel for learners, is offered in English and Simplified Chinese language. It’s an attention-grabbing complement to the official Semantic Kernel documentation, written by kinfey, a Microsoft Cloud Advocate.

Undertaking Miyagi

Undertaking Miyagi is an “as-is” demo envisioning pattern for the Copilot stack. It consists of examples of utilization for Semantic Kernel, Promptflow, LlamaIndex, LangChain, vector shops (Azure AI Search, CosmosDB Postgres pgvector), and generative picture utilities corresponding to DreamFusion and ControlNet. Undertaking Miyagi can also be attention-grabbing as a complement to the official Semantic Kernel documentation.

Semantic Kernel mission

Given how a lot Microsoft has invested in Copilots and Copilot+ PCs, you’d suppose that the Semantic Kernel mission would get some critical assets. However no. In December 2023 the Semantic Kernel repo bought over 100 commits every week; in June 2024, it has been getting about 30 commits every week. The core framework code appears to be progressing, particularly the C# model, and the Python and Java code appears to be catching up, however the documentation and examples don’t appear to be getting a lot love regardless of being old-fashioned.

Maybe I’m seeing a traditional growth cycle for an open supply mission. There was an enormous spike in code additions and deletions in Could 2024, just like the spikes in April and October of 2023. It’s potential that the documentation and instance writers have been ready for the code to quiet down earlier than updating their elements of the mission.

Or, presumably, Microsoft merely doesn’t care in regards to the Semantic Kernel open-source mission. Their inside efforts have been sufficient to launch plenty of Copilots. So far as exterior growth of AI functions goes, they might be content material to let LangChain or LlamaIndex dominate the ecosystem slightly than pushing their very own Semantic Kernel, so long as builders use Azure or OpenAI companies. Time will inform.

Professionals

  1.             A free open-source SDK that allows you to construct brokers that may name your present code.
  2.             Helps C#, Python, and Java.
  3.             Fairly simple to study and use, particularly in C#.
  4.             Can generate its personal plans.

Cons

  1.             Utilizing planners is pricey (makes use of plenty of AI tokens) and introduces noticeable delays for the consumer.
  2.             The documentation and examples appear to be out-of-date or lacking for Python and Java.

Value

Free open supply, MIT License.

Platform

C#, Python, and Java.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles