【解决todo】如果默认选择了 role ,则使用 role 作为 title
This commit is contained in:
parent
19bd0c66ff
commit
041a00b27f
|
@ -56,8 +56,9 @@ public class AiChatConversationServiceImpl implements AiChatConversationService
|
||||||
validateChatModel(model);
|
validateChatModel(model);
|
||||||
|
|
||||||
// 2. 创建 AiChatConversationDO 聊天对话
|
// 2. 创建 AiChatConversationDO 聊天对话
|
||||||
|
String title = createReqVO.getRoleId() == null ? AiChatConversationDO.TITLE_DEFAULT : role.getName();
|
||||||
AiChatConversationDO conversation = new AiChatConversationDO()
|
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())
|
.setRoleId(role.getId()).setModelId(model.getId()).setModel(model.getModel()).setSystemMessage(role.getSystemMessage())
|
||||||
.setTemperature(model.getTemperature()).setMaxTokens(model.getMaxTokens()).setMaxContexts(model.getMaxContexts());
|
.setTemperature(model.getTemperature()).setMaxTokens(model.getMaxTokens()).setMaxContexts(model.getMaxContexts());
|
||||||
chatConversationMapper.insert(conversation);
|
chatConversationMapper.insert(conversation);
|
||||||
|
|
Loading…
Reference in New Issue