โš™๏ธ Semantic Kernel Integration

Purple Flea Plugins for
Semantic Kernel

Enterprise-grade crypto capabilities for Microsoft Semantic Kernel agents. Annotated KernelFunction plugins for wallets, Hyperliquid trading, provably fair casino games, and domain registration. Azure OpenAI ready. Works in C# and Python.

Get API Key โ†’ View Docs

Enterprise AI Meets On-Chain Finance

Microsoft Semantic Kernel powers enterprise AI applications at scale. Purple Flea's SK plugin library exposes real financial APIs as first-class KernelFunction methods โ€” type-safe, planner-compatible, and fully observable via SK telemetry.

๐Ÿข Azure OpenAI Ready

Certified compatible with Azure OpenAI Service. Deploy Purple Flea plugins in your existing Azure infrastructure without changing your architecture.

๐Ÿ”ง KernelFunction Annotations

Every plugin method is decorated with [KernelFunction] and [Description] for automatic discovery by the SK Planner.

๐Ÿ“Š SK Planner Compatible

HandlebarsPlanner and FunctionCallingStepwisePlanner can compose multi-step financial workflows automatically using Purple Flea tools.

๐Ÿ” OpenTelemetry Support

All plugin invocations emit SK-standard telemetry events. Monitor financial agent operations in Azure Application Insights or any OTEL backend.

Install the Plugin Package

Available for both .NET and Python. Choose the package that matches your SK project.

C# / .NET Python
terminal
# .NET
dotnet add package PurpleFlea.SemanticKernel

# Python
pip install purpleflea-semantic-kernel

Add Plugins to Your Kernel

Import all Purple Flea plugins in three lines. The SK Planner will automatically discover and compose them into multi-step financial workflows.

Program.cs
using Microsoft.SemanticKernel;
using PurpleFlea.SemanticKernel;

// Build the kernel with Azure OpenAI
var kernel = Kernel.CreateBuilder()
    .AddAzureOpenAIChatCompletion(
        deploymentName: "gpt-4o",
        endpoint: Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"),
        apiKey: Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY")
    )
    .Build();

// Import all Purple Flea plugins at once
var apiKey = Environment.GetEnvironmentVariable("PURPLE_FLEA_API_KEY");
kernel.ImportPluginFromObject(new PurpleFleasPlugin(apiKey), "PurpleFlea");

// Or import individual plugins selectively
kernel.ImportPluginFromObject(new WalletPlugin(apiKey), "Wallet");
kernel.ImportPluginFromObject(new TradingPlugin(apiKey), "Trading");
kernel.ImportPluginFromObject(new CasinoPlugin(apiKey), "Casino");
kernel.ImportPluginFromObject(new DomainsPlugin(apiKey), "Domains");

// Let the planner compose multi-step financial workflows
var planner = new HandlebarsPlanner();
var plan = await planner.CreatePlanAsync(
    kernel,
    "Create a crypto wallet, check ETH balance, then open a 10 USDC long on ETH-PERP"
);

var result = await plan.InvokeAsync(kernel);
Console.WriteLine(result);
WalletPlugin.cs (example plugin internals)
public class WalletPlugin
{
    private readonly PurpleFleasClient _client;

    public WalletPlugin(string apiKey)
        => _client = new PurpleFleasClient(apiKey);

    [KernelFunction, Description("Create a new non-custodial BIP-39 HD wallet")]
    public async Task<WalletResult> CreateWalletAsync()
        => await _client.Wallet.CreateAsync();

    [KernelFunction, Description("Get wallet balance for a specific chain")]
    public async Task<BalanceResult> GetBalanceAsync(
        [Description("The wallet address")] string address,
        [Description("Chain: eth, btc, sol, bnb, matic, trx")] string chain = "eth")
        => await _client.Wallet.GetBalanceAsync(address, chain);

    [KernelFunction, Description("Send crypto to another address")]
    public async Task<TransactionResult> SendAsync(
        [Description("Recipient address")] string to,
        [Description("Amount in USD")] decimal amount,
        [Description("Token: USDC, ETH, BTC, SOL")] string token = "USDC")
        => await _client.Wallet.SendAsync(to, amount, token);
}

Python Semantic Kernel Integration

The Python SK package uses the same plugin pattern. Decorate methods with @kernel_function or use the pre-built plugin classes.

agent.py
import asyncio
import os
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion
from purpleflea_semantic_kernel import (
    WalletPlugin, TradingPlugin, CasinoPlugin, DomainsPlugin
)

async def main():
    kernel = sk.Kernel()

    # Add Azure OpenAI (or OpenAI, or any SK-compatible model)
    kernel.add_service(AzureChatCompletion(
        deployment_name="gpt-4o",
        endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
        api_key=os.environ["AZURE_OPENAI_KEY"],
    ))

    # Register Purple Flea plugins
    api_key = os.environ["PURPLE_FLEA_API_KEY"]
    kernel.add_plugin(WalletPlugin(api_key), plugin_name="wallet")
    kernel.add_plugin(TradingPlugin(api_key), plugin_name="trading")
    kernel.add_plugin(CasinoPlugin(api_key), plugin_name="casino")
    kernel.add_plugin(DomainsPlugin(api_key), plugin_name="domains")

    # Invoke a composed workflow
    result = await kernel.invoke_prompt(
        "Create a new crypto wallet, check if 'myagent.ai' is available, and register it if the price is under $50"
    )
    print(result)

asyncio.run(main())

All Available KernelFunctions

Every function is decorated with [KernelFunction] and [Description] so the SK Planner can discover and compose them automatically.

CreateWallet
Generate a new BIP-39 HD wallet. Returns address and mnemonic.
GetBalance
Get token balance on any supported chain (ETH, BTC, SOL, BNB, MATIC, TRX).
SendCrypto
Transfer USDC or native tokens to any address.
SwapTokens
Best-rate cross-chain swap via aggregated DEX routing.
OpenPosition
Open a perpetual futures position on 275+ markets via Hyperliquid.
ClosePosition
Close an open position and realize P&L.
GetPositions
List all open positions with unrealized P&L.
CoinFlip
Provably fair coin flip. Cryptographically verifiable result.
RollDice
Roll dice with custom sides (2โ€“100). Fair and verifiable.
PlayCrash
Crash game with configurable auto-cashout multiplier.
CheckDomain
Check availability and pricing for any domain + TLD.
RegisterDomain
Register a domain. 500+ TLDs including .ai, .com, .io.

Earn Referral Commissions

Every API key carries a referral code. When agents you onboard generate activity, you earn a percentage of fees โ€” forever, automatically.

20%
Trading Fees
10%
Casino Wagers
10%
Wallet Swap Fees
15%
Domain Registrations

Other Frameworks & Integrations

Get Started

Ready to Give Your SK Agent Financial Superpowers?

Register in under a minute. Get your API key and start building. Enterprise support and Azure Marketplace listing available.

Get API Key โ†’ Documentation