Răsfoiți Sursa

增加开场白 过滤

zrd 3 săptămâni în urmă
părinte
comite
2d88ad1e37

+ 3 - 1
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java

@@ -331,7 +331,9 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
             AiChatConversationUpdateMyReqVO updateReqVO = new AiChatConversationUpdateMyReqVO();
             updateReqVO.setId(conversation.getId());
             updateReqVO.setDifyConversationId(difyId.toString());
-            updateReqVO.setTitle(StrUtil.subPre(sendReqVO.getContent(), 20));
+            if (!StrUtil.contains(assistantMessage.getContent(), "ecologicalValueCalculate")) {
+                updateReqVO.setTitle(StrUtil.subPre(sendReqVO.getContent(), 20));
+            }
             TenantUtils.executeIgnore(() ->
                     chatConversationService.updateConversation(updateReqVO));