SemanticPluginForge.Core 2.0.0

dotnet add package SemanticPluginForge.Core --version 2.0.0
                    
NuGet\Install-Package SemanticPluginForge.Core -Version 2.0.0
                    
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="SemanticPluginForge.Core" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SemanticPluginForge.Core" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SemanticPluginForge.Core" />
                    
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 SemanticPluginForge.Core --version 2.0.0
                    
#r "nuget: SemanticPluginForge.Core, 2.0.0"
                    
#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.
#addin nuget:?package=SemanticPluginForge.Core&version=2.0.0
                    
Install SemanticPluginForge.Core as a Cake Addin
#tool nuget:?package=SemanticPluginForge.Core&version=2.0.0
                    
Install SemanticPluginForge.Core as a Cake Tool

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 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 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.

SemanticPluginForge.OpenApi

A library for extending Semantic Kernel OpenAPI spec plugins with customizable metadata support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 71 5/2/2025
1.0.1 182 8/1/2024
1.0.0 86 7/23/2024