-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jicheng Lu
committed
Feb 20, 2025
1 parent
8048524
commit 816abe9
Showing
10 changed files
with
10 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
src/Infrastructure/BotSharp.Core/Evaluations/ExecutionLogger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
using BotSharp.Abstraction.Evaluations; | ||
using BotSharp.Abstraction.Repositories; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace BotSharp.Core.Evaluations; | ||
|
||
public class ExecutionLogger : IExecutionLogger | ||
{ | ||
private readonly BotSharpDatabaseSettings _dbSettings; | ||
private readonly IServiceProvider _services; | ||
private readonly ILogger<ExecutionLogger> _logger; | ||
|
||
public ExecutionLogger( | ||
BotSharpDatabaseSettings dbSettings, | ||
IServiceProvider services) | ||
IServiceProvider services, | ||
ILogger<ExecutionLogger> logger) | ||
{ | ||
_dbSettings = dbSettings; | ||
_services = services; | ||
_logger = logger; | ||
} | ||
|
||
public void Append(string conversationId, string content) | ||
{ | ||
content = content.Replace("\r\n", " ").Replace("\n", " "); | ||
content = Regex.Replace(content, @"\s+", " "); | ||
var db = _services.GetRequiredService<IBotSharpRepository>(); | ||
db.AddExecutionLogs(conversationId, new List<string> { content }); | ||
_logger.LogInformation($"Execution Log: {content}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
src/Infrastructure/BotSharp.Core/Repository/FileRepository/FileRepository.Log.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/Plugins/BotSharp.Plugin.MongoStorage/Collections/ExecutionLogDocument.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters