diff --git a/dist/modules/chat/chat.service.js b/dist/modules/chat/chat.service.js index 8db4e66..c99aa82 100644 --- a/dist/modules/chat/chat.service.js +++ b/dist/modules/chat/chat.service.js @@ -659,6 +659,9 @@ let ChatService = class ChatService { if (modelType === 1) { try { chatTitle = await this.openAIChatService.chatFree(`根据用户提问{${prompt}},给这个对话取一个名字,不超过10个字`); + if (chatTitle.length > 15) { + chatTitle = chatTitle.slice(0, 15); + } } catch (error) { common_1.Logger.error(`调用 chatFree 出错: ${error}`); @@ -668,9 +671,6 @@ let ChatService = class ChatService { else { chatTitle = '创意 AI'; } - if (chatTitle.length > 15) { - chatTitle = chatTitle.slice(0, 15); - } this.chatGroupService .update({ groupId,