semantic-kernel
БесплатноБез исполняемых скриптовНе проверенBuild AI applications with Microsoft Semantic Kernel. Create plugins, planners, and memory systems. Use for enterprise AI, copilot development, and Microsoft…
от majiayu000★ 31 звезда на GitHubОб этом скилле
Semantic Kernel
Expert guidance for building AI applications with Microsoft's SDK.
Triggers
Use this skill when:
- Building enterprise AI applications with Microsoft technologies
- Creating copilot-style AI assistants
- Working with Semantic Kernel plugins, planners, or memory
- Integrating AI into Microsoft ecosystem (Azure, Office, etc.)
- Building modular AI applications with plugin architecture
- Keywords: semantic kernel, microsoft, plugin, planner, memory, copilot, azure ai
Installation
Python
pip install semantic-kernel
.NET
dotnet add package Microsoft.SemanticKernel
Quick Start (Python)
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
# Create kernel
kernel = sk.Kernel()
# Add AI service
kernel.add_service(
OpenAIChatCompletion(
service_id="chat",
ai_model_id="gpt-4o",
api_key="your-key"
)
)
# Create and invoke prompt
result = await kernel.invoke_prompt("What is the capital of France?")
print(result)
Quick Start (.NET)
using Microsoft.SemanticKernel;
var builder = Kernel.CreateBuilder();
builder.AddOpenAIChatCompletion(
modelId: "gpt-4o",
apiKey: "your-key"
);
var kernel = builder.Build();
var result = await kernel.InvokePromptAsync("What is the capital of France?");
Console.WriteLine(result);
Plugins
Semantic Functions (Prompts)
# Python
from semantic_kernel.functions import KernelFunction
summarize = KernelFunction.from_prompt(
prompt="""Summarize the following text in {{$style}} style:
{{$input}}
Summary:""",
function_name="summarize",
plugin_name="TextPlugin"
)
kernel.add_function(plugin_name="TextPlugin", function=summarize)
result = await kernel.invoke(
summarize,
input="Long text here...",
style="professional"
)
// C#
var summarize = kernel.CreateFunctionFromPrompt(
@"Summarize the following text in {{$style}} style:
{{$input}}
Summary:"
);
var result = await kernel.InvokeAsync(summarize, new() {
["input"] = "Long text here...",
["style"] = "professional"
});
Native Functions
# Python
from semantic_kernel.functions import kernel_function
class MathPlugin:
@kernel_function(
name="add",
description="Add two numbers"
)
def add(self, a: int, b: int) -> int:
return a + b
@kernel_function(
name="multiply",
description="Multiply two numbers"
)
def multiply(self, a: int, b: int) -> int:
return a * b
kernel.add_plugin(MathPlugin(), plugin_name="Math")
result = await kernel.invoke("Math", "add", a=5, b=3)
// C#
public class MathPlugin
{
[KernelFunction, Description("Add two numbers")]
public int Add(int a, int b) => a + b;
[KernelFunction, Description("Multiply two numbers")]
public int Multiply(int a, int b) => a * b;
}
kernel.Plugins.AddFromType<MathPlugin>("Math");
var result = await kernel.InvokeAsync("Math", "Add", new() { ["a"] = 5, ["b"] = 3 });
Plugin from Directory
# plugins/WriterPlugin/Summarize/config.json
{
"schema": 1,
"description": "Summarize text",
"execution_settings": {
"default": {
"max_tokens": 500,
"temperature": 0.5
}
}
}
# plugins/WriterPlugin/Summarize/skprompt.txt
Summarize: {{$input}}
# Load plugin
kernel.add_plugin(parent_directory="./plugins", plugin_name="WriterPlugin")
Planners
Function Calling Stepwise Planner
from semantic_kernel.planners import FunctionCallingStepwisePlanner
planner = FunctionCallingStepwisePlanner(service_id="chat")
result = await planner.invoke(
kernel,
question="What is 25 * 4 and then add 10?"
)
print(result.final_answer)
Handlebars Planner
from semantic_kernel.planners.handlebars_planner import HandlebarsPlannerOptions, HandlebarsPlanner
planner = HandlebarsPlanner(
options=HandlebarsPlannerOptions(
allow_loops=True
)
)
plan = await planner.create_plan(kernel, goal="Research AI and write summary")
result = await plan.invoke(kernel)
Memory
Semantic Memory
from semantic_kernel.memory import SemanticTextMemory
from semantic_kernel.connectors.memory.azure_cognitive_search import AzureCognitiveSearchMemoryStore
from semantic_kernel.connectors.ai.open_ai import OpenAITextEmbedding
# Setup embedding
embedding = OpenAITextEmbedding(
ai_model_id="text-embedding-3-small",
api_key="your-key"
)
# Setup memory store
memory_store = AzureCognitiveSearchMemoryStore(
vector_size=1536,
search_endpoint="https://your-service.search.windows.net",
admin_key="your-key"
)
memory = SemanticTextMemory(storage=memory_store, embeddings_generator=embedding)
# Save memory
await memory.save_information(
collection="documents",
id="doc1",
text="Important information here",
Установить semantic-kernel в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл semantic-kernel?
Build AI applications with Microsoft Semantic Kernel. Create plugins, planners, and memory systems. Use for enterprise AI, copilot development, and Microsoft ecosystem integrations.
Как установить скилл semantic-kernel?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл semantic-kernel запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic