temp save

This commit is contained in:
Jicheng Lu 2024-04-22 14:29:21 -05:00
parent a1adcdd9e8
commit f09c22b90c
5 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,7 @@
namespace BotSharp.Abstraction.Translation.Attributes;
public class TranslationAttribute : Attribute
{
}

View file

@ -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>;
}

View file

@ -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>();

View file

@ -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;
}
}

View file

@ -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;