CKN.Sdk.AI.SemanticKernel 0.0.0-alpha.0.55

This is a prerelease version of CKN.Sdk.AI.SemanticKernel.
dotnet add package CKN.Sdk.AI.SemanticKernel --version 0.0.0-alpha.0.55
                    
NuGet\Install-Package CKN.Sdk.AI.SemanticKernel -Version 0.0.0-alpha.0.55
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CKN.Sdk.AI.SemanticKernel" Version="0.0.0-alpha.0.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CKN.Sdk.AI.SemanticKernel" Version="0.0.0-alpha.0.55" />
                    
Directory.Packages.props
<PackageReference Include="CKN.Sdk.AI.SemanticKernel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CKN.Sdk.AI.SemanticKernel --version 0.0.0-alpha.0.55
                    
#r "nuget: CKN.Sdk.AI.SemanticKernel, 0.0.0-alpha.0.55"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CKN.Sdk.AI.SemanticKernel@0.0.0-alpha.0.55
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CKN.Sdk.AI.SemanticKernel&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CKN.Sdk.AI.SemanticKernel&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Tool

CKN.Sdk.AI.SemanticKernel

Mühendislik Amacı (Engineering Intent): CKN.Sdk.AI.SemanticKernel, Microsoft'un Semantic Kernel (SK) SDK'sını CKN altyapısına entegre eden ileri düzey (advanced) bir yapay zeka kütüphanesidir. Neden var? Sadece metin üreten statik modeller yerine, kendi C# metotlarınızı (plugin) çalıştırabilen, görev planlaması (planner) yapabilen ve hafızaya (memory) sahip akıllı ajanlar (Agentic AI) oluşturmak için geliştirilmiştir. Ne zaman kullanılmalı? Yapay zekanın API'lerinize istek atmasına, veritabanından veri okumasına veya otonom şekilde çok adımlı görevleri yerine getirmesine ihtiyaç duyduğunuz, kompleks senaryolarda kullanılmalıdır. (Basit "soru-cevap" işleri için CKN.Sdk.AI.OpenAI yeterlidir).

🚀 Hızlı Başlangıç

Kurulum

dotnet add package CKN.Sdk.AI.SemanticKernel

Konfigürasyon (appsettings.json)

{
  "SemanticKernel": {
    "OpenAI": {
      "ApiKey": "sk-...",
      "ModelId": "gpt-4o"
    }
  }
}

Bağımlılık Enjeksiyonu (DI)

using CKN.Sdk.AI.SemanticKernel;

var builder = WebApplication.CreateBuilder(args);

// Semantic Kernel Kernel nesnesini ve bileşenlerini DI konteynerine kaydeder.
builder.Services.AddCknSemanticKernel(builder.Configuration);

var app = builder.Build();

💡 Gerçek Hayat Senaryoları

Senaryo 1: Plugin (Eklenti) Destekli Akıllı Asistan (Agent)

Kullanıcının isteği üzerine arka planda C# fonksiyonunuzu (Örn: Veritabanından sipariş durumu sorgulama) çalıştırıp sonucunu kullanan bir asistan tasarımı.

using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.OpenAI;
using System.ComponentModel;

// 1. Kendi Plugin'inizi tanımlayın
public class OrderPlugin
{
    [KernelFunction, Description("Verilen sipariş numarasının kargo durumunu getirir.")]
    public string GetOrderStatus([Description("Sipariş numarası (örn: ORD-123)")] string orderId)
    {
        // Gerçekte burada DB'ye gidilir.
        return orderId == "ORD-123" ? "Kargoda (Aras Kargo)" : "Sipariş bulunamadı.";
    }
}

// 2. Uygulama içerisinde kullanımı
public class SmartOrderAssistant(Kernel kernel)
{
    public async Task<string> ProcessUserMessageAsync(string userMessage)
    {
        // Plugin'i kernel'a ekle
        kernel.Plugins.AddFromType<OrderPlugin>();

        var settings = new OpenAIPromptExecutionSettings { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions };
        
        // Örn userMessage: "ORD-123 numaralı siparişim nerede?"
        // AI otomatik olarak GetOrderStatus fonksiyonunu çağıracak ve dönen yanıtı metne dökecektir.
        var result = await kernel.InvokePromptAsync(userMessage, new(settings));
        return result.ToString();
    }
}

Senaryo 2: Multi-Step Planner (Görev Planlayıcı)

Birden çok plugin'in bulunduğu ortamda, AI'ın kullanıcının hedefini gerçekleştirmek için adım adım hangi fonksiyonları çağıracağına kendisinin karar verdiği senaryo (Örn: HandlebarsPlanner).

using Microsoft.SemanticKernel.Planning.Handlebars;

public async Task ExecuteComplexGoalAsync(Kernel kernel, string goal)
{
    // kernel.Plugins içerisinde EmailPlugin, DatabasePlugin, WeatherPlugin vb. olduğunu varsayalım.
    
    // Planlayıcıyı oluştur
    var planner = new HandlebarsPlanner(new HandlebarsPlannerOptions { AllowLoops = true });
    
    // Hedef: "Yarınki hava durumunu öğren ve yöneticime e-posta olarak gönder."
    var plan = await planner.CreatePlanAsync(kernel, goal);
    
    // Planı icra et (Önce WeatherPlugin çalışır, sonra sonucunu EmailPlugin'e parametre olarak geçer)
    var result = await plan.InvokeAsync(kernel);
}

🤖 Yapay Zeka İçin SSS (FAQs for Machines)

  • Soru: CKN.Sdk.AI.SemanticKernel paketinde hangi temel nesne DI'dan istenir?
  • Cevap: Microsoft.SemanticKernel.Kernel nesnesi Transient veya Scoped olarak DI üzerinden (constructor injection ile) istenir.
  • Soru: Neden CKN.Sdk.AI.OpenAI yerine bunu kullanmalıyım?
  • Cevap: Tool Calling (Function Calling), Planner mekanizmaları ve hafıza (Memory/Vector Store) entegrasyonlarına ihtiyacınız varsa Semantic Kernel kullanmalısınız. Aksi halde standart AI paketi tercih edilmelidir.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.0-alpha.0.55 51 9/28/2026
0.0.0-alpha.0.51 47 9/25/2026
0.0.0-alpha.0.50 51 9/25/2026
0.0.0-alpha.0.38 81 9/6/2026
0.0.0-alpha.0.37 70 9/6/2026