2023-06-23 04:43:00 +00:00
|
|
|
using BotSharp.Abstraction.Conversations;
|
2023-06-17 02:42:35 +00:00
|
|
|
using BotSharp.Abstraction.MLTasks;
|
|
|
|
|
using BotSharp.Abstraction.Plugins;
|
2023-06-17 13:32:39 +00:00
|
|
|
using BotSharp.Plugin.AzureOpenAI.Providers;
|
2023-06-19 18:32:49 +00:00
|
|
|
using BotSharp.Plugin.AzureOpenAI.Services;
|
|
|
|
|
using BotSharp.Plugin.AzureOpenAI.Settings;
|
2023-06-17 02:42:35 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Platform.AzureAi;
|
|
|
|
|
|
|
|
|
|
public class AzureOpenAiPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
|
|
|
|
var settings = new AzureOpenAiSettings();
|
|
|
|
|
config.Bind("AzureOpenAi", settings);
|
|
|
|
|
services.AddSingleton(x => settings);
|
|
|
|
|
|
|
|
|
|
services.AddSingleton<ITextCompletion, TextCompletionProvider>();
|
2023-06-19 18:32:49 +00:00
|
|
|
services.AddScoped<IChatCompletion, ChatCompletionProvider>();
|
2023-06-26 23:08:24 +00:00
|
|
|
services.AddScoped<IChatServiceZone, ChatService>();
|
2023-06-17 02:42:35 +00:00
|
|
|
}
|
|
|
|
|
}
|