Browse Source

打印 看看大模型返回结果为什么解析失败

wangmiaomiao 10 months ago
parent
commit
8b1a059e0d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

+ 2 - 2
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -451,7 +451,7 @@ public class RyTask
             Iterator<PredictionResponse> predictions = stub.streamPredictions(request);
             while (predictions.hasNext()) {
                 String responseStr = predictions.next().getPrediction().toStringUtf8();
-                System.out.println(responseStr);
+                log.info("决策流式返回的结果是{}", responseStr);
                 responseStr = JSON.parseObject(responseStr).getString("message");
                 if("complete".equals(responseStr)){
                     System.out.println("结尾语句并且是非JSON,无需处理");
@@ -459,7 +459,7 @@ public class RyTask
                     sb.append(responseStr);
                 }
             }
-        } catch (IOException e) {
+        } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
             System.out.println(sb.toString());