Merge pull request #447 from hchen2020/master

Fix translation plugin.
This commit is contained in:
C. Oceania 2024-05-09 11:10:10 -05:00 committed by GitHub
commit e18f2fa69d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,16 @@
using BotSharp.Logger.Hooks;
using Microsoft.Extensions.Configuration;
namespace BotSharp.Core.Translation;
public class TranslationPlugin : IBotSharpPlugin
{
public string Id => "a81997c3-5d3a-4f18-bae0-be7a81d233ba";
public string Name => "Multi-language Translator";
public string Description => "Output the corresponding language response according to the user language";
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
services.AddScoped<IConversationHook, TranslationResponseHook>();
}
}

View file

@ -14,7 +14,6 @@ public static class BotSharpLoggerExtensions
services.AddScoped<IContentGeneratingHook, TokenStatsConversationHook>();
services.AddScoped<IContentGeneratingHook, VerboseLogHook>();
services.AddScoped<IConversationHook, RateLimitConversationHook>();
services.AddScoped<IConversationHook, TranslationResponseHook>();
return services;
}
}