Swagger.AIChat
1.0.1
dotnet add package Swagger.AIChat --version 1.0.1
NuGet\Install-Package Swagger.AIChat -Version 1.0.1
<PackageReference Include="Swagger.AIChat" Version="1.0.1" />
paket add Swagger.AIChat --version 1.0.1
#r "nuget: Swagger.AIChat, 1.0.1"
// Install Swagger.AIChat as a Cake Addin #addin nuget:?package=Swagger.AIChat&version=1.0.1 // Install Swagger.AIChat as a Cake Tool #tool nuget:?package=Swagger.AIChat&version=1.0.1
Swagger AI Chat Example
This repository contains an example of how to integrate Swagger (OpanAPI) with an AI chat application in C#.
AI Chat Integration
You can interact with the Swagger API through an AI chat interface. This allows you to send requests and receive responses directly from the chat, making it easier to test and use the API without needing to manually navigate the Swagger UI.
Using Semantic Kernel for AI Integration
This example leverages Semantic Kernel as the medium for integrating AI capabilities. Semantic Kernel provides a robust framework for building and deploying AI models, making it easier to incorporate advanced AI functionalities into your applications.
Semantic Kernel Integration
For detailed usage, refer to the code example below:
This code snippet describes how to add the configuration:
builder.Services.AddSingleton(new ChatAISetting
{
SystemPrompt = "You are an AI assistant that can help users call APIs.",
OpenAPIPluginName = "weather_api",
OpenAPIUrl = "https://localhost:7071/swagger/v1/swagger.json"
} );
This code snippet describes how to add the configuration for Chat AI resources.
app.UseSwaggerUI(options => options.AddSwaggerChatAIUI());
app.UseSwaggerChatAIUI();
You can find the complete code implementation in the Program.cs
file. This file contains all the necessary configurations and setup required to integrate Swagger with the AI chat application.
Usage
Once the application is running, you can access the Swagger UI by navigating to https://localhost:7071/swagger
in your web browser. This will provide you with an interactive interface to test the API endpoints.
Contributing
If you would like to contribute to this project, please fork the repository and submit a pull request.
License
This project is licensed under the MIT License.
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. |
-
net8.0
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.SemanticKernel (>= 1.40.0)
- Microsoft.SemanticKernel.Plugins.OpenApi (>= 1.40.0)
- Newtonsoft.Json (>= 13.0.3)
- Swashbuckle.AspNetCore.SwaggerUI (>= 7.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
History:
v1.0.0:
• Initial release
v1.0.1:
• Add README.md