From 661a6a95f52bae8ba25d1331143d1e187a93c2a2 Mon Sep 17 00:00:00 2001 From: vastxie Date: Fri, 12 Jul 2024 11:56:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=A4=B1=E8=B4=A5=E5=AF=BC=E8=87=B4=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/modules/chat/chat.service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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,