xueyiming преди 8 месеца
родител
ревизия
8fa9920d9b
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/OpenAIUtils.java

+ 3 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/OpenAIUtils.java

@@ -127,6 +127,9 @@ public class OpenAIUtils {
 //        responseFormat.put("type", "json_object");
 //        String content = DeepSeekAPI.chat(textPrompt + text, responseFormat);
         String content = KimiAPI.jsonChat(textPrompt + text);
+        if (StringUtils.isEmpty(content)) {
+            return null;
+        }
         return JSONObject.parseObject(content);
     }