TimHeuer.OpenAIPluginMiddleware 1.0.15-pre

This is a prerelease version of TimHeuer.OpenAIPluginMiddleware.
There is a newer version of this package available.
See the version list below for details.
dotnet add package TimHeuer.OpenAIPluginMiddleware --version 1.0.15-pre                
NuGet\Install-Package TimHeuer.OpenAIPluginMiddleware -Version 1.0.15-pre                
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="TimHeuer.OpenAIPluginMiddleware" Version="1.0.15-pre" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TimHeuer.OpenAIPluginMiddleware --version 1.0.15-pre                
#r "nuget: TimHeuer.OpenAIPluginMiddleware, 1.0.15-pre"                
#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 TimHeuer.OpenAIPluginMiddleware as a Cake Addin
#addin nuget:?package=TimHeuer.OpenAIPluginMiddleware&version=1.0.15-pre&prerelease

// Install TimHeuer.OpenAIPluginMiddleware as a Cake Tool
#tool nuget:?package=TimHeuer.OpenAIPluginMiddleware&version=1.0.15-pre&prerelease                

TimHeuer.OpenAIPluginMiddleware GitHub Workflow Status (with branch)

OpenAI Plugin manifest middleware for ASP.NET Core

This is a middleware for ASP.NET Core that will add a manifest file to the response for OpenAI Plugins in the default location of /.well-known/ai-plugin.json.

For more information on OpenAI Plugins see the OpenAI Plugin documentation.

Installation

This is a NuGet package so if you are using Visual Studio just use the Package Manager and search for 'TimHeuer.OpenAIPluginMiddleware' (enable checking for pre-release) and install.

Additionally you can install the package using the .NET CLI if you are using other tools:

$ dotnet add package TimHeuer.OpenAIPluginMiddleware --version 1.0.10-pre

Usage (pattern using ASP.NET minimal hosting/APIs)

Add the middleware to your Program.cs file (below is just an example, substitute your options):

builder.Services.AddAiPluginGen(options =>
{
    options.NameForHuman = "Weather Forecast";
    options.NameForModel = "weatherforecast";
    options.LegalInfoUrl = "https://example.com/legal";
    options.ContactEmail = "noreply@example.com";
    options.LogoUrl = "https://example.com/logo.png";
    options.DescriptionForHuman = "Search for weather forecasts";
    options.DescriptionForModel = "Plugin for searching the weather forecast. Use It whenever a users asks about weather or forecasts";
    options.ApiDefinition = new Api() { RelativeUrl = "/swagger/v1/swagger.yaml" };
});

And then after the builder is built, add the middleware:

app.UseAiPluginGen();

Options

The options are mostly required to conform the plugin schema specification. Some defaults are provided:

  • Api/Type: "openapi"
  • Api/IsUserAuthetnication: "false"
  • Api/RelativeUrl: "/openapi.yaml"
  • SchemaVersion: "v1"
  • Auth/Type: "none"
Disclaimer

As with most of my projects this started as a learning, experiment, and selfish need. It may not fit your needs at all. That's okay, I'm not offended. You are free to ignore it and move along. Or you are also free to provide some helpful feedback to make it better for yourself or others.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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

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
1.0.27 246 6/16/2023
1.0.26 249 6/15/2023
1.0.19 145 5/29/2023
1.0.17-pre 133 5/29/2023
1.0.16-pre 144 5/29/2023
1.0.15-pre 143 5/29/2023
1.0.14-pre 138 5/29/2023
1.0.10-pre 128 5/28/2023
1.0.8-pre 126 5/28/2023
1.0.7-pre 129 5/28/2023
1.0.5-pre 128 5/28/2023

Added more auth schema support