2023-11-12 09:12:34 +00:00
|
|
|
using BotSharp.Abstraction.MLTasks;
|
|
|
|
|
using BotSharp.Abstraction.Plugins;
|
2023-11-16 13:12:33 +00:00
|
|
|
using BotSharp.Abstraction.VectorStorage;
|
2023-11-12 09:12:34 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Plugin.SemanticKernel
|
|
|
|
|
{
|
2023-11-19 13:34:13 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Use Semantic Kernel as BotSharp plugin
|
|
|
|
|
/// </summary>
|
2023-11-12 09:12:34 +00:00
|
|
|
public class SemanticKernelPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
2024-01-12 22:20:22 +00:00
|
|
|
public string Id => "849e5ab9-276f-4cf1-8041-c089fe1a1aeb";
|
2023-11-19 13:34:13 +00:00
|
|
|
/// <inheritdoc/>
|
2023-11-12 09:12:34 +00:00
|
|
|
public string Name => "Semantic Kernel";
|
2023-11-19 13:34:13 +00:00
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
2023-11-12 09:12:34 +00:00
|
|
|
public string Description => "Semantic Kernel Service";
|
2023-11-12 14:04:00 +00:00
|
|
|
|
2023-11-19 13:34:13 +00:00
|
|
|
/// <inheritdoc/>
|
2023-11-12 09:12:34 +00:00
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
2023-12-18 20:14:14 +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
|
|
|
}
|