【解决todo】如果默认选择了 role ,则使用 role 作为 title

This commit is contained in:
cherishsince 2024-05-21 17:18:33 +08:00
parent 19bd0c66ff
commit 041a00b27f

View File

@ -56,8 +56,9 @@ public class AiChatConversationServiceImpl implements AiChatConversationService
validateChatModel(model);
// 2. 创建 AiChatConversationDO 聊天对话
String title = createReqVO.getRoleId() == null ? AiChatConversationDO.TITLE_DEFAULT : role.getName();
AiChatConversationDO conversation = new AiChatConversationDO()
.setUserId(userId).setTitle(AiChatConversationDO.TITLE_DEFAULT).setPinned(false)
.setUserId(userId).setTitle(title).setPinned(false)
.setRoleId(role.getId()).setModelId(model.getId()).setModel(model.getModel()).setSystemMessage(role.getSystemMessage())
.setTemperature(model.getTemperature()).setMaxTokens(model.getMaxTokens()).setMaxContexts(model.getMaxContexts());
chatConversationMapper.insert(conversation);