change param name

This commit is contained in:
Jicheng Lu 2024-10-07 16:42:20 -05:00
parent 1fcd93fd01
commit 3271ce65f7
2 changed files with 8 additions and 4 deletions

View file

@ -41,7 +41,7 @@ public interface IConversationService
PostbackMessageModel? replyMessage,
Func<RoleDialogModel, Task> onResponseReceived);
List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true, IEnumerable<string>? excludeMessageTypes = null);
List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true, IEnumerable<string>? includeMessageTypes = null);
Task CleanHistory(string agentId);
/// <summary>

View file

@ -106,7 +106,7 @@ public partial class ConversationService : IConversationService
throw new NotImplementedException();
}
public List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true, IEnumerable<string>? excludeMessageTypes = null)
public List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true, IEnumerable<string>? includeMessageTypes = null)
{
if (string.IsNullOrEmpty(_conversationId))
{
@ -115,9 +115,13 @@ public partial class ConversationService : IConversationService
var dialogs = _storage.GetDialogs(_conversationId);
if (!excludeMessageTypes.IsNullOrEmpty())
if (!includeMessageTypes.IsNullOrEmpty())
{
dialogs = dialogs.Where(x => !excludeMessageTypes.Contains(x.MessageType)).ToList();
dialogs = dialogs.Where(x => string.IsNullOrEmpty(x.MessageType) || includeMessageTypes.Contains(x.MessageType)).ToList();
}
else
{
dialogs = dialogs.Where(x => string.IsNullOrEmpty(x.MessageType) || x.MessageType.IsEqualTo(MessageTypeName.Plain)).ToList();
}
if (fromBreakpoint)