SemanticPluginForge.Core 1.0.1

dotnet add package SemanticPluginForge.Core --version 1.0.1                
NuGet\Install-Package SemanticPluginForge.Core -Version 1.0.1                
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="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SemanticPluginForge.Core --version 1.0.1                
#r "nuget: SemanticPluginForge.Core, 1.0.1"                
#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.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
1.0.1 117 8/1/2024
1.0.0 75 7/23/2024