ମୁଖ୍ୟ ବିଷୟବସ୍ତୁକୁ ଛାଡ଼ନ୍ତୁ
ସେମାଣ୍ଟିକ୍ କର୍ନେଲ୍ ଇଣ୍ଟେଗ୍ରେସନ୍

Semantic Kernel ପେମେଣ୍ଟ ଇଣ୍ଟେଗ୍ରେସନ୍।

Semantic Kernel package ଦରକାର ନାହିଁ। ସତ୍ୟ blockchain0x client କୁ KernelFunction (Python କିମ୍ବା Java) ଭିତରେ wrap କରନ୍ତୁ, କିମ୍ବା C# KernelFunction ରୁ REST API କୁ call କରନ୍ତୁ। ଯେକୌଣସି ଉପାୟରେ agent Base ଉପରେ USDC move କରେ।

ସଂକ୍ଷିପ୍ତ ଉତ୍ତର

Semantic Kernel package ନାହିଁ। Python ରେ ଆପଣ ଆସଲ blockchain0x client କୁ @kernel_function ସହିତ decorated ହୋଇଥିବା method ଭିତରେ wrap କରନ୍ତି; C# ରେ, ଯେଉଁଠାରେ କୌଣସି .NET SDK ship ହୋଇନାହିଁ, ଏକ [KernelFunction] ସିଧା REST API କୁ call କରେ। ଏହାକୁ ଆପଣଙ୍କ kernel ଉପରେ register କରନ୍ତୁ, FunctionChoiceBehavior କୁ Auto କରନ୍ତୁ, ଏବଂ agent Base ଉପରେ USDC move କରିପାରିବ। ଯାହା ship ହୋଇଛି ସେ core SDKs ହେଉଛି Node, Python, Ruby, Go, ଏବଂ JVM।

କାହିଁକି SEMANTIC KERNEL

ଏକମାତ୍ର enterprise-grade .NET agent framework।

ଯଦି ଆପଣଙ୍କ stack Microsoft-shaped ଅଟେ (Azure, .NET, SQL Server, Teams, Copilot Studio), Semantic Kernel ପ୍ରାୟ ସୁନିଶ୍ଚିତ ଭାବରେ ସଠିକ୍ agent framework। ଏହା Microsoft ଦ୍ୱାରା ତିଆରି, Azure OpenAI, AKS, ଏବଂ Entra ସହ integrate ହୁଏ, ଏବଂ .NET, Python, Java ଭରି first-class support ଦିଏ, ଯାହା କୌଣସି ଅନ୍ୟ framework ସହ match ହୁଏ ନାହିଁ। ଏବଂ ଏହା ପୂର୍ବରୁ ହିଁ ଆପଣଙ୍କ ଦରକାର ଥିବା ଜିନିଷ ଦେଇଥାଏ: KernelFunction କେବଳ ଗୋଟିଏ method, ସେଥିପାଇଁ payments wiring କରିବା ହେଉଛି ଆପଣ ଲେଖୁଥିବା method, ଅପେକ୍ଷା କରୁଥିବା package ନୁହେଁ।

ସେଥିପାଇଁ install କରିବାକୁ କୌଣସି Semantic Kernel adapter ନାହିଁ। Python ଏବଂ Java ରେ ଆପଣ ଆସଲ blockchain0x SDK କୁ KernelFunction ଭିତରେ wrap କରନ୍ତି; C# ରେ, ଯେଉଁଠାରେ ଏପର୍ଯ୍ୟନ୍ତ କୌଣସି .NET SDK ship ହୋଇନାହିଁ, KernelFunction HttpClient ସହ ସିଧା REST API କୁ call କରେ। ଆପଣ idiomatic ergonomics - decorated methods, async, attribute-based parameter validation - ରକ୍ଷା କରନ୍ତି, ଏବଂ track କରିବାକୁ କୌଣସି adapter version ନାହିଁ। ଆଜି ଅବସ୍ଥିତ core SDK ଗୁଡ଼ିକ Node, Python, Ruby, Go, ଏବଂ JVM ଅଟେ।

ଇନ୍ସ୍ଟଲେସନ୍

Semantic Kernel ଏବଂ Python ରେ core SDK ଇନଷ୍ଟଲ୍ କରନ୍ତୁ।

ଯୋଡିବା ପାଇଁ blockchain0x Semantic Kernel package ନାହିଁ। Python ରେ Semantic Kernel ସହିତ ଆସଲ blockchain0x SDK install କରାଯାଏ; C# ରେ Microsoft.SemanticKernel install କରାଯାଏ ଏବଂ built-in HttpClient ସହିତ REST API call କରାଯାଏ। Java ରେ Semantic Kernel for Java ସହିତ com.blockchain0x:sdk-jvm SDK ବ୍ୟବହୃତ ହୁଏ।

ଇନ୍ସ୍ଟଲ୍ - PYTHON
pip install semantic-kernel blockchain0x
INSTALL - .NET (କେବଳ Semantic Kernel)
dotnet add package Microsoft.SemanticKernel
ପରିବେଶ ଚଳକଗୁଡିକ
BLOCKCHAIN0X_API_KEY=sk_test_...   # sk_test_ = Base Sepolia, sk_live_ = Base mainnet
BLOCKCHAIN0X_API_KEY=sk_test_...             # same key, the name the .NET REST example reads
OPENAI_API_KEY=sk-...

BLOCKCHAIN0X_API_KEY (Python client ଏହା ପଢ଼େ) ହେଉଛି ଆପଣଙ୍କ dashboard ରୁ ମିଳୁଥିବା sk_test_ testnet କିମ୍ବା sk_live_ mainnet key; C# REST example BLOCKCHAIN0X_API_KEY ରୁ ସେଇ ମୂଲ୍ୟ ପଢ଼େ। OPENAI_API_KEY (କିମ୍ବା Azure-hosted models ପାଇଁ AZURE_OPENAI_*) ହେଉଛି ଆପଣଙ୍କ LLM key। webhook handler କୁ ଅତିରିକ୍ତ ଭାବେ BLOCKCHAIN0X_WEBHOOK_SECRET ଆବଶ୍ୟକ।

ସମ୍ପୂର୍ଣ୍ଣ ଏଜେଣ୍ଟ ଉଦାହରଣଗୁଡିକ

Python ଏବଂ C# ରେ ଏକ ୱାଲେଟ୍ KernelFunction।

Python @kernel_function ଦ୍ୱାରା decorate ହୋଇଥିବା method ଭିତରେ real blockchain0x client କୁ wrap କରେ। C#, ଯେଉଁଠି କୌଣସି .NET SDK ship ହୁଏନାହିଁ, HttpClient ସହିତ ସିଧା POST /v1/payments କୁ call କରୁଥିବା [KernelFunction] expose କରେ। ଦୁହେଁ kernel ଉପରେ Wallet.send_usdc ଭାବରେ register ହୁଏ; ପରିବେଷ୍ଟିତ ceremony ମାତ୍ର ଭିନ୍ନ।

PYTHON (plugin.py)
from semantic_kernel import Kernel
from semantic_kernel.functions import kernel_function
from blockchain0x import Client

blockchain0x = Client()  # reads BLOCKCHAIN0X_API_KEY from the environment

class WalletPlugin:
    @kernel_function(description="Send a USDC payment from an agent wallet.")
    def send_usdc(self, agent_id: str, to: str, amount_wei: str) -> str:
        # amount_wei is USDC base units (6 decimals): "10000" = 0.01 USDC
        return str(
            blockchain0x.payments.create(body={"agentId": agent_id, "to": to, "amountWei": amount_wei})
        )

kernel = Kernel()
kernel.add_plugin(WalletPlugin(), plugin_name="Wallet")
# Add your chat service, then let the model call Wallet.send_usdc.
.NET (WalletPlugin.cs)
using System.ComponentModel;
using System.Net.Http.Json;
using Microsoft.SemanticKernel;

// There is no .NET SDK, so a C# KernelFunction calls the REST API directly.
public class WalletPlugin
{
    private static readonly HttpClient Http = new()
    {
        BaseAddress = new Uri("https://api.blockchain0x.com"),
    };

    [KernelFunction, Description("Send a USDC payment from an agent wallet. amountWei is USDC base units (6 decimals).")]
    public async Task<string> SendUsdc(string agentId, string to, string amountWei)
    {
        Http.DefaultRequestHeaders.Authorization =
            new("Bearer", Environment.GetEnvironmentVariable("BLOCKCHAIN0X_API_KEY"));
        var res = await Http.PostAsJsonAsync("/v1/payments", new { agentId, to, amountWei });
        return await res.Content.ReadAsStringAsync();
    }
}

// builder.Plugins.AddFromType<WalletPlugin>("Wallet");

Register the function on the kernel, set FunctionChoiceBehavior to Auto, and when the user's message implies a payment the model calls Wallet.send_usdc with the agent id, recipient, and amount. amountWei is base units, so 0.01 USDC is "10000". The Python path returns the SDK result; the C# path returns the REST response body.

ୱେବ୍‌ହୁକ୍ ହ୍ୟାଣ୍ଡଲିଂ

ପେମେଣ୍ଟ ଘଟଣାଗୁଡିକୁ ଗ୍ରହଣ କରିବା ପାଇଁ ASP.NET କୋର୍ ମିନିମାଲ୍ API।

ପେମେଣ୍ଟ ସେଟଲ୍ ହେଲେ, Blockchain0x ଆପଣଙ୍କ webhook URL କୁ signed event POST କରେ। କୌଣସି shipped .NET verifier ନାହିଁ, ସେହିପାଇଁ handler ଡକ୍ୟୁମେଣ୍ଟେଡ୍ HMAC ସହିତ ହାତେ verify କରେ - ଯେଉଁକାମ helper ମଧ୍ୟ କରିଥାନ୍ତା। ନିମ୍ନରେ .NET example; Python ଏବଂ Java ନିଜ ନିଜ HMAC libraries ସହିତ ସେଇ ଭାବରେ verify କରନ୍ତି.

ୱେବ୍‌ହୁକ୍.CS
using System.Security.Cryptography;
using System.Text;
using Microsoft.AspNetCore.Builder;

var app = WebApplication.CreateBuilder(args).Build();
var secret = Environment.GetEnvironmentVariable("BLOCKCHAIN0X_WEBHOOK_SECRET")!;

app.MapPost("/webhooks/payment", async (HttpRequest req) =>
{
    using var reader = new StreamReader(req.Body);
    var raw = await reader.ReadToEndAsync(); // RAW body - verify before parsing
    var sig = req.Headers["X-Blockchain0x-Signature"].ToString();
    var ts = req.Headers["X-Blockchain0x-Timestamp"].ToString();

    var parts = sig.Split(',').Select(p => p.Split('=', 2))
        .Where(p => p.Length == 2).ToDictionary(p => p[0], p => p[1]);
    var t = parts.GetValueOrDefault("t", ts);
    var v1 = parts.GetValueOrDefault("v1", sig);

    var want = Convert.ToHexString(new HMACSHA256(Encoding.UTF8.GetBytes(secret))
        .ComputeHash(Encoding.UTF8.GetBytes($"{t}.{raw}"))).ToLowerInvariant();
    var fresh = Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - long.Parse(t)) <= 300;
    if (!fresh || !CryptographicOperations.FixedTimeEquals(
            Encoding.UTF8.GetBytes(want), Encoding.UTF8.GetBytes(v1)))
        return Results.Unauthorized();

    if (req.Headers["X-Blockchain0x-Event-Type"] == "payment.received")
        await RunFollowupAsync(); // USDC landed - do the next step
    return Results.Ok();
});

app.Run();

algorithm ଟି t.rawBody string ଉପରେ HMAC-SHA256, 300-second replay window, ଏବଂ constant-time compare ବ୍ୟବହାର କରେ। signature intact ରଖିବା ପାଇଁ StreamReader ମାଧ୍ୟମରେ raw body ପଢ଼ନ୍ତୁ; deserialize କରି ପୁଣି re-serialize କରନ୍ତୁ ନାହିଁ। shipped events ହେଉଛି payment.received, payment.sent, wallet.deployed, ଏବଂ webhook.test। production ରେ webhook ଟି ପ୍ରାୟଃ agent ସହ database share କରୁଥିବା ଏକ separate ASP.NET Core service ଭାବେ ଚାଲେ, ଯାହାଦ୍ୱାରା ଦୁଇଟି coordinate କରିପାରେ।

ସୋର୍ସ ଏବଂ ଡକ୍ସ

SDKs ଏବଂ REST surface open ଅଟେ। ସେଗୁଡ଼ିକ ପଢ଼ନ୍ତୁ।

Clone କରିବା ପାଇଁ Semantic Kernel starter package ନାହିଁ - ଉପରେ ଥିବା recipes ହିଁ integration। blockchain0x core SDKs (Node, Python, Ruby, Go) GitHub ଉପରେ open source ଅଟେ, ଏବଂ ସେମାନଙ୍କର method surface ସହିତ C# example ଯେ REST routes call କରେ ସେଗୁଡିକ docs ରେ document ହୋଇଛି।

docs.blockchain0x.com/docs/overview

SDK method surface ଏବଂ REST routes the docs ରେ documented ଅଛି। Base Sepolia ବିରୁଦ୍ଧରେ sk_test_ key ରୁ ଆରମ୍ଭ କରନ୍ତୁ, ତାପରେ KernelFunction ଆପଣ ଆଶା କରୁଥିବା ଭଳି କାମ କଲେ sk_live_ କୁ switch କରନ୍ତୁ।

ସାଧାରଣ ବିପଦ

ସେମାଣ୍ଟିକ୍ କର୍ଣ୍ଣେଲ୍-ନିର୍ଦ୍ଦିଷ୍ଟ ଜାଲକୁ ଏଡାଇବାକୁ ପାଞ୍ଚ ଜାଲ।

Semantic Kernel ର ପ୍ଲଗଇନ୍ ମୋଡେଲ୍ ସଫା ହେଉଛି କିନ୍ତୁ ଏହାରେ କ୍ରସ୍-ଭାଷା ଏବଂ ବ୍ୟବହାର-ଡିଫଲ୍ଟ ଗୋଟିକା ଅଛି। ସେଗୁଡିକୁ ପୂର୍ବରୁ ଜାଣିବା ସମୟ ବଚାଏ।

PITFALL 1

କୌଣସି ଭାଷାରେ ମଧ୍ୟ Semantic Kernel package ନାହିଁ

NuGet, PyPI, କିମ୍ବା Maven adapter ନାହିଁ। ଯାହା ship ହୋଇଛି ସେ core SDKs ହେଉଛି Node, Python, Ruby, Go, ଏବଂ JVM - .NET ନୁହେଁ। ସେହିପରି Python kernel ଏକ @kernel_function ଭିତରେ blockchain0x Python client କୁ wrap କରେ, Java kernel com.blockchain0x:sdk-jvm SDK ବ୍ୟବହାର କରେ, ଏବଂ C# kernel KernelFunction ରୁ ସିଧା REST API କୁ call କରେ (ଉପରେ ଦେଖାଯାଇଛି)। ତିନୋଟି ମଧ୍ୟ କେବଳ କିଛି line।

PITFALL 2

FunctionChoiceBehavior ଆଟୋ ହେବା ଆବଶ୍ୟକ

Semantic Kernel କେବଳ ସେତେବେଳେ plugin functions invoke କରେ, ଯେତେବେଳେ prompt-execution settings ରେ FunctionChoiceBehavior କୁ Auto କରାଯାଇଥାଏ। Default ହେଉଛି None, ସେଥିପାଇଁ user କେତେ ମଧ୍ୟ ସ୍ପଷ୍ଟ ଭାବେ ଚାହିଲେ ମଧ୍ୟ model ଆପଣଙ୍କ wallet function କୁ କେବେ call କରେ ନାହିଁ। ଯଦି agent function କୁ ସମ୍ପୂର୍ଣ୍ଣ ଅଗ୍ରାହ୍ୟ କରେ, ପ୍ରଥମେ ଏହାକୁ ଯାଞ୍ଚ କରନ୍ତୁ।

PITFALL 3

ରାଶିଗୁଡ଼ିକ USDC base units ରେ, string ଭାବେ

The payments call takes amountWei: a string of USDC base units (6 decimals), so 0.01 USDC is "10000" and 5 USDC is "5000000". Type the function argument as a string in any language. payments.create also does not retry by default and can answer 503 until the chain adapter is wired for your network - return a clear message rather than letting the agent loop.

PITFALL 4

ଏଜେଣ୍ଟମାନେ ମଧ୍ୟରେ ପ୍ଲଗ୍ଇନ୍ ସ୍କୋପ୍

Wallet function କେବଳ ସେହି agent ର kernel ଉପରେ register କରନ୍ତୁ, ଯାହା spending authority ଧାରଣ କରିବା ଉଚିତ୍। Plugin ସାର୍ବଜନୀନ ନୁହେଁ - ଯେ agent ର kernel ରେ ଏହା ନାହିଁ, ସେ ଏହାକୁ call କରିପାରିବ ନାହିଁ। Reviewer agent କୁ wallet function ଛଡ଼ା ଏକ kernel ଦିଅନ୍ତୁ, କିମ୍ବା ପ୍ରତ୍ୟେକ agent ପାଇଁ allowed functions କୁ ସୀମିତ କରନ୍ତୁ, ଯାହାରେ ଟଙ୍କା ଗୋଟିଏ role ରେ ରହିଥାଏ।

PITFALL 5

କଚା ଦେହ ବିପରୀତ ଓେଭୁକ୍ସକୁ ପରୀକ୍ଷା କରନ୍ତୁ

Deserializing ପୂର୍ବରୁ raw request body ପଢ଼ନ୍ତୁ ଏବଂ verify କରନ୍ତୁ - HMAC ସଠିକ୍ byte ଗୁଡିକୁ cover କରେ, ସେହିପାଇଁ parse-then-reserialize round trip ଏହାକୁ ଭାଙ୍ଗିଦିଏ। ନିମ୍ନ .NET handler ଡକ୍ୟୁମେଣ୍ଟ କରାଯାଇଥିବା algorithm କାର୍ଯ୍ୟାନ୍ବୟନ କରେ: t.rawBody ଉପରେ HMAC-SHA256, 300-second window, ଏବଂ constant-time compare। Python ଏବଂ Java ନିଜସ୍ୱ HMAC library ସହ ସେହିଭଳି verify କରେ।

ପ୍ରାୟତଃ ପ୍ରଶ୍ନ

ତିନି Semantic Kernel-ନିର୍ଦ୍ଦିଷ୍ଟ ପ୍ରଶ୍ନ।

ଇନଷ୍ଟଲ୍ କରିବାକୁ Semantic Kernel package ଅଛି କି (NuGet, PyPI, କିମ୍ବା Maven)?

ନା। ସତ୍ୟ path ଆପଣଙ୍କ language ଉପରେ ନିର୍ଭର କରେ। Python Semantic Kernel ଉପରେ real blockchain0x Python client କୁ @kernel_function ଭିତରେ wrap କରାଯାଏ, ଉପରେ ଦେଖାଯାଇଥିବା ପରି। Java Semantic Kernel, KernelFunction ଭିତରେ com.blockchain0x:sdk-jvm SDK ବ୍ୟବହାର କରେ। C# ଏବଂ ଅନ୍ୟ .NET languages ପାଖରେ blockchain0x SDK ନାହିଁ - shipped core SDKs ହେଉଛି Node, Python, Ruby, Go, ଏବଂ JVM - ସେହିପାଇଁ .NET KernelFunction REST API କୁ ସିଧାସଳଖ call କରେ, ଏହା ମଧ୍ୟ ଉପରେ ଦେଖାଯାଇଛି। ଏକମାତ୍ର shipped framework packages ହେଉଛି blockchain0x-langchain ଏବଂ blockchain0x-crewai (Python) ସହ @blockchain0x/mcp server।

କାହିଁକି .NET SDK gap ଅଛି, ଏବଂ ଏହା କିଛି ସମସ୍ୟା କି?

ଏହା କେବଳ ଆଜିର SDK roadmap ର ସ୍ଥିତି: Node, Python, Ruby, Go, ଏବଂ JVM ship କରେ, .NET ଏପର୍ଯ୍ୟନ୍ତ ନୁହେଁ। ଏହା blocker ନୁହେଁ। REST API bearer-token auth ସହିତ HTTPS ଉପରେ plain JSON, ଏବଂ ଉପରେ ଥିବା POST /v1/payments କଲ୍ କରୁଥିବା C# KernelFunction କେବଳ HttpClient ସହିତ କିଛି ଲାଇନ୍। ଯଦି first-class .NET SDK ଆପଣଙ୍କ ପାଇଁ ଗୁରୁତ୍ତ୍ୱପୂର୍ଣ୍ଣ, ଆମକୁ କହନ୍ତୁ, ଆମେ demand ସହିତ ତୁଳନା କରିବୁ।

କି ଏହା Agent Framework ଏବଂ Microsoft 365 Copilot ସହିତ କାମ କରେ?

ହଁ। wallet function ଏକ ସାଧାରଣ Semantic Kernel function, ସେହିପାଇଁ ଏହା single ChatCompletionAgent run ଏବଂ AgentGroupChat orchestration ରେ କାମ କରେ - ଏହାକୁ କେବଳ billing agent ର kernel ରେ register କରନ୍ତୁ ଏବଂ payment ସେଟଲ୍ ହେବା ପରେ ଅନ୍ୟମାନଙ୍କୁ କାମ କରିବାକୁ ଦିଅନ୍ତୁ। Microsoft 365 Copilot extensions ଯେଉଁମାନେ Semantic Kernel କୁ ଭିତରେ ଚଳାନ୍ତି ସେମାନେ ଏକେ ଭାବରେ register କରିପାରନ୍ତି; ଆପଣଙ୍କ ନିଜ UI ସହିତ payment କୁ user କୁ surface କରନ୍ତୁ। କୌଣସି Copilot-specific package ନାହିଁ; ଏହା ସେଇ recipe।

ଆପଣଙ୍କର SK ଏଜେଣ୍ଟକୁ ବିଲିଂ ଯୋଡନ୍ତୁ।

ପ୍ରକୃତ client କିମ୍ବା REST API ଉପରେ ଏକ KernelFunction, install କରିବାକୁ package ନାହିଁ। Free to start।