Skip to content

Commit f97cb0e

Browse files
author
Haiping Chen
committed
Fix translation plugin.
1 parent 8fd5c80 commit f97cb0e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using BotSharp.Logger.Hooks;
2+
using Microsoft.Extensions.Configuration;
3+
4+
namespace BotSharp.Core.Translation;
5+
6+
public class TranslationPlugin : IBotSharpPlugin
7+
{
8+
public string Id => "a81997c3-5d3a-4f18-bae0-be7a81d233ba";
9+
public string Name => "Multi-language Translator";
10+
public string Description => "Output the corresponding language response according to the user language";
11+
12+
public void RegisterDI(IServiceCollection services, IConfiguration config)
13+
{
14+
services.AddScoped<IConversationHook, TranslationResponseHook>();
15+
}
16+
}

src/Infrastructure/BotSharp.Logger/BotSharpLoggerExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public static IServiceCollection AddBotSharpLogger(this IServiceCollection servi
1414
services.AddScoped<IContentGeneratingHook, TokenStatsConversationHook>();
1515
services.AddScoped<IContentGeneratingHook, VerboseLogHook>();
1616
services.AddScoped<IConversationHook, RateLimitConversationHook>();
17-
services.AddScoped<IConversationHook, TranslationResponseHook>();
1817
return services;
1918
}
2019
}

0 commit comments

Comments
 (0)