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

fix: null

parent 20f7ab64
...@@ -264,12 +264,15 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -264,12 +264,15 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
} }
//判断最后是否为User,若是则删除。 //判断最后是否为User,若是则删除。
if (LLMRoleEnum.USER.getRole().equals(messages.get(messages.size() - 1).getRole())) { if (CollectionUtils.isNotEmpty(messages)) {
Long recordId = recordEntities.get(recordEntities.size() - 1).getId(); if (LLMRoleEnum.USER.getRole().equals(messages.get(messages.size() - 1).getRole())) {
bizAgentApplicationDialoguesRecordService.deletedById(recordId); Long recordId = recordEntities.get(recordEntities.size() - 1).getId();
messages.remove(messages.size() - 1); bizAgentApplicationDialoguesRecordService.deletedById(recordId);
messages.remove(messages.size() - 1);
}
} }
// 用户输入 // 用户输入
Message message = new Message(); Message message = new Message();
message.setContent(input); message.setContent(input);
......
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