BotSharp/src/Plugins/BotSharp.Plugin.SemanticKernel/SemanticKernelPlugin.cs

25 lines
990 B
C#
Raw Normal View History

2023-11-12 09:12:34 +00:00
using BotSharp.Abstraction.MLTasks;
using BotSharp.Abstraction.Plugins;
using BotSharp.Abstraction.VectorStorage;
2023-11-12 09:12:34 +00:00
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace BotSharp.Plugin.SemanticKernel
{
public class SemanticKernelPlugin : IBotSharpPlugin
{
public string Name => "Semantic Kernel";
public string Description => "Semantic Kernel Service";
2023-11-12 14:04:00 +00:00
2023-11-12 09:12:34 +00:00
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
var settings = new SemanticKernelSettings();
config.Bind("SemanticKernel", settings);
2023-11-12 09:12:34 +00:00
services.AddScoped<ITextCompletion, SemanticKernelTextCompletionProvider>();
services.AddScoped<IChatCompletion, SemanticKernelChatCompletionProvider>();
services.AddScoped<IVectorDb, SemanticKernelMemoryStoreProvider>();
services.AddScoped<ITextEmbedding, SemanticKernelTextEmbeddingProvider>();
2023-11-12 09:12:34 +00:00
}
}
2023-11-12 14:04:00 +00:00
}