diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationServiceImpl.java index 85dd57afdf..1e3bd52ced 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationServiceImpl.java @@ -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);