Commit 653cc2c7 authored by alex yao's avatar alex yao

fix: null

parent 20f7ab64
...@@ -264,11 +264,14 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -264,11 +264,14 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
} }
//判断最后是否为User,若是则删除。 //判断最后是否为User,若是则删除。
if (CollectionUtils.isNotEmpty(messages)) {
if (LLMRoleEnum.USER.getRole().equals(messages.get(messages.size() - 1).getRole())) { if (LLMRoleEnum.USER.getRole().equals(messages.get(messages.size() - 1).getRole())) {
Long recordId = recordEntities.get(recordEntities.size() - 1).getId(); Long recordId = recordEntities.get(recordEntities.size() - 1).getId();
bizAgentApplicationDialoguesRecordService.deletedById(recordId); bizAgentApplicationDialoguesRecordService.deletedById(recordId);
messages.remove(messages.size() - 1); messages.remove(messages.size() - 1);
} }
}
// 用户输入 // 用户输入
Message message = new Message(); Message message = new Message();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment