mirror of
https://github.com/vastxie/99AI.git
synced 2024-11-16 11:42:25 +08:00
fix: 修复更新标题失败导致后台崩溃的问题
This commit is contained in:
parent
5ffcf6beed
commit
661a6a95f5
6
dist/modules/chat/chat.service.js
vendored
6
dist/modules/chat/chat.service.js
vendored
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user