Преглед изворни кода

1.提交新ai回复长度异常问题

jzp пре 1 недеља
родитељ
комит
78d7087af6

+ 10 - 7
fs-service/src/main/java/com/fs/fastGpt/service/impl/AiHookServiceImpl.java

@@ -673,14 +673,17 @@ public class AiHookServiceImpl implements AiHookService {
                     }
 
                 }else {
-                    String sa = contentKh.replaceAll("】\n", "】").replaceAll("\n【", "【");
-                    String nr = replace(sa);
-                    String[] split = nr.split("\n");
-                    if (split.length>6){
-                        log.info("回复长度异常:"+role.getRoleId()+":"+qwExternalContacts.getName());
-                        notifyArtificial(fastGptChatSession.getSessionId(),user,qwExternalContacts.getName(),"回复长度异常",qwExternalContacts.getId(),sender);
-                        return R.ok();
+                    if(!isNewVersion){
+                        String sa = contentKh.replaceAll("】\n", "】").replaceAll("\n【", "【");
+                        String nr = replace(sa);
+                        String[] split = nr.split("\n");
+                        if (split.length>6){
+                            log.info("回复长度异常:"+role.getRoleId()+":"+qwExternalContacts.getName());
+                            notifyArtificial(fastGptChatSession.getSessionId(),user,qwExternalContacts.getName(),"回复长度异常",qwExternalContacts.getId(),sender);
+                            return R.ok();
+                        }
                     }
+
                     List<String> countList = countString(content);
                     //新增用户信息
                     addUserInfo(contentKh, qwExternalContacts.getId(),fastGptChatSession);