2024-11-04 22:44:41 +00:00
|
|
|
using BotSharp.Abstraction.Plugins;
|
|
|
|
|
using BotSharp.Abstraction.Settings;
|
|
|
|
|
using BotSharp.Core.SideCar.Services;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Core.SideCar;
|
|
|
|
|
|
|
|
|
|
public class BotSharpSideCarPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
|
|
|
|
public string Id => "06e5a276-bba0-45af-9625-889267c341c9";
|
2024-11-15 16:36:17 +00:00
|
|
|
public string Name => "Side Car";
|
2024-11-04 22:44:41 +00:00
|
|
|
public string Description => "Provides side car for calling agent cluster in conversation";
|
|
|
|
|
|
|
|
|
|
public SettingsMeta Settings => new SettingsMeta("SideCar");
|
|
|
|
|
public object GetNewSettingsInstance() => new SideCarSettings();
|
|
|
|
|
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
|
|
|
|
var settings = new SideCarSettings();
|
|
|
|
|
config.Bind("SideCar", settings);
|
|
|
|
|
services.AddSingleton(settings);
|
|
|
|
|
|
|
|
|
|
if (settings.Conversation.Provider == "botsharp")
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped<IConversationSideCar, BotSharpConversationSideCar>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|