diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Agent/LINGYUN/Abp/AI/Agent/AgentService.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Agent/LINGYUN/Abp/AI/Agent/AgentService.cs index 046d714ce..63b090f4c 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Agent/LINGYUN/Abp/AI/Agent/AgentService.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Agent/LINGYUN/Abp/AI/Agent/AgentService.cs @@ -90,6 +90,10 @@ public class AgentService : IAgentService, IScopedDependency foreach (var chatMessage in historyMessages) { messages.Add(new AIChatMessage(chatMessage.Role, chatMessage.GetMessagePrompt())); + if (!chatMessage.ReplyMessage.IsNullOrWhiteSpace()) + { + messages.Add(new AIChatMessage(ChatRole.Assistant, chatMessage.ReplyMessage)); + } } }