fix: 对话窗口的第一条对话丢失

This commit is contained in:
Chason
2024-05-14 20:32:11 +08:00
committed by GitHub
parent 0964a5ad5b
commit 02d7994bae

View File

@@ -330,22 +330,18 @@ namespace AntSK.Domain.Domain.Service
public async Task<ChatHistory> GetChatHistory(List<Chats> MessageList, ChatHistory history)
{
if (MessageList.Count > 1)
foreach (var item in MessageList)
{
foreach (var item in MessageList)
if (item.IsSend)
{
if (item.IsSend)
{
history.AddUserMessage(item.Context);
}
else
{
history.AddAssistantMessage(item.Context);
}
history.AddUserMessage(item.Context);
}
else
{
history.AddAssistantMessage(item.Context);
}
}
return history;
}
}
}
}