temp save
This commit is contained in:
parent
a1adcdd9e8
commit
f09c22b90c
|
|
@ -0,0 +1,7 @@
|
|||
namespace BotSharp.Abstraction.Translation.Attributes;
|
||||
|
||||
public class TranslationAttribute : Attribute
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
using BotSharp.Abstraction.Messaging.Models.RichContent;
|
||||
using BotSharp.Abstraction.Messaging;
|
||||
|
||||
namespace BotSharp.Abstraction.Translation;
|
||||
|
||||
public interface ITranslationService
|
||||
{
|
||||
|
||||
T Translate<T>(T data, string language) where T : RichContent<IRichMessage>;
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ using BotSharp.Core.Instructs;
|
|||
using BotSharp.Core.Messaging;
|
||||
using BotSharp.Core.Routing.Planning;
|
||||
using BotSharp.Core.Templating;
|
||||
using BotSharp.Core.Translation;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace BotSharp.Core.Conversations;
|
||||
|
|
@ -35,6 +36,7 @@ public class ConversationPlugin : IBotSharpPlugin
|
|||
services.AddScoped<IConversationService, ConversationService>();
|
||||
services.AddScoped<IConversationStateService, ConversationStateService>();
|
||||
services.AddScoped<IConversationAttachmentService, ConversationAttachmentService>();
|
||||
services.AddScoped<ITranslationService, TranslationService>();
|
||||
|
||||
// Rich content messaging
|
||||
services.AddScoped<IRichContentService, RichContentService>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
using BotSharp.Abstraction.Messaging;
|
||||
using BotSharp.Abstraction.Messaging.Models.RichContent;
|
||||
|
||||
namespace BotSharp.Core.Translation;
|
||||
|
||||
public class TranslationService : ITranslationService
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly ILogger<TranslationService> _logger;
|
||||
|
||||
public TranslationService(IServiceProvider services,
|
||||
ILogger<TranslationService> logger)
|
||||
{
|
||||
_services = services;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public T Translate<T>(T data, string language) where T : RichContent<IRichMessage>
|
||||
{
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ global using BotSharp.Abstraction.Agents.Models;
|
|||
global using BotSharp.Abstraction.Functions.Models;
|
||||
global using BotSharp.Abstraction.Repositories;
|
||||
global using BotSharp.Abstraction.Repositories.Filters;
|
||||
global using BotSharp.Abstraction.Translation;
|
||||
global using BotSharp.Core.Repository;
|
||||
global using BotSharp.Core.Routing;
|
||||
global using BotSharp.Core.Agents.Services;
|
||||
|
|
|
|||
Loading…
Reference in a new issue