SemanticPluginForge.Core
1.0.1
dotnet add package SemanticPluginForge.Core --version 1.0.1
NuGet\Install-Package SemanticPluginForge.Core -Version 1.0.1
<PackageReference Include="SemanticPluginForge.Core" Version="1.0.1" />
paket add SemanticPluginForge.Core --version 1.0.1
#r "nuget: SemanticPluginForge.Core, 1.0.1"
// Install SemanticPluginForge.Core as a Cake Addin #addin nuget:?package=SemanticPluginForge.Core&version=1.0.1 // Install SemanticPluginForge.Core as a Cake Tool #tool nuget:?package=SemanticPluginForge.Core&version=1.0.1
SemanticPluginForge
SemanticPluginForge is a .NET library for extending Semantic Kernel plugins with metadata support.
Installation
You can install the SemanticPluginForge package via NuGet:
dotnet add package SemanticPluginForge
Usage
Implementing a Custom Metadata Provider
Implement the IPluginMetadataProvider
interface. The following code is a sample provider that overrides the description of a function from the TimePlugin
.
public class CustomTimeYearMetadataProvider : IPluginMetadataProvider
{
public PluginMetadata? GetPluginMetadata(KernelPlugin plugin) => null;
public FunctionMetadata GetFunctionMetadata(KernelPlugin plugin, KernelFunctionMetadata metadata) =>
plugin.Name == "TimePlugin" && metadata.Name == "Year"
? new FunctionMetadata(metadata.Name) { Description = "Get the current year in 4-digit number format." }
: null;
}
Registering the Metadata Provider
Register the custom metadata provider with the service collection.
services.AddSingleton<IPluginMetadataProvider, CustomTimeYearMetadataProvider>();
Adding Plugins with Patched Metadata
Use the extension methods from this library to add plugins with patched metadata.
var kernelBuilder = services.AddKernel();
kernelBuilder.Plugins.AddFromTypeWithMetadata<TimePlugin>();
Product | Versions 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. |
-
net8.0
- Microsoft.SemanticKernel.Core (>= 1.15.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SemanticPluginForge.Core:
Package | Downloads |
---|---|
SemanticPluginForge.OpenAI
A library for extending Semantic Kernel OpenAI and OpenAPI spec plugins with customisable metadata support. |
GitHub repositories
This package is not used by any popular GitHub repositories.