BotSharp/src/Infrastructure/BotSharp.Core/Evaluations/ExecutionLogger.cs

24 lines
683 B
C#
Raw Normal View History

2023-10-23 00:31:49 +00:00
using BotSharp.Abstraction.Evaluations;
using BotSharp.Abstraction.Repositories;
namespace BotSharp.Core.Evaluations;
public class ExecutionLogger : IExecutionLogger
{
private readonly BotSharpDatabaseSettings _dbSettings;
private readonly IServiceProvider _services;
public ExecutionLogger(
BotSharpDatabaseSettings dbSettings,
IServiceProvider services)
{
_dbSettings = dbSettings;
_services = services;
}
public void Append(string conversationId, string content)
{
2023-10-23 20:33:24 +00:00
var db = _services.GetRequiredService<IBotSharpRepository>();
db.AddExectionLogs(conversationId, new List<string> { content });
2023-10-23 00:31:49 +00:00
}
}