SemanticPluginForge.OpenApi
2.0.0-alpha
This is a prerelease version of SemanticPluginForge.OpenApi.
dotnet add package SemanticPluginForge.OpenApi --version 2.0.0-alpha
NuGet\Install-Package SemanticPluginForge.OpenApi -Version 2.0.0-alpha
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.OpenApi" Version="2.0.0-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SemanticPluginForge.OpenApi" Version="2.0.0-alpha" />
<PackageReference Include="SemanticPluginForge.OpenApi" />
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.OpenApi --version 2.0.0-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SemanticPluginForge.OpenApi, 2.0.0-alpha"
#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.OpenApi&version=2.0.0-alpha&prerelease
#tool nuget:?package=SemanticPluginForge.OpenApi&version=2.0.0-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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();
var kernel = kernelBuilder.Build();
kernel.AddFromOpenApiWithMetadataAsync("SamplePlugin", "sample_open_api_spec.json");
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. 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.
-
net8.0
- Microsoft.SemanticKernel.Plugins.OpenApi.Extensions (>= 1.48.0-alpha)
- SemanticPluginForge.Core (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0-alpha | 71 | 5/2/2025 |