Ver Fonte

定时任务调用决策时 bug修改

wangmiaomiao há 9 meses atrás
pai
commit
a4df1fca9d

+ 5 - 4
slibra-quartz/src/main/java/com/slibra/quartz/task/AsyncTask.java

@@ -857,7 +857,7 @@ public class AsyncTask {
         List<String> resultData = new ArrayList<>();
         //决策和问答不一样 没有历史的概念 所以sessionId都是新的  次数都是1
         String sessionId = IdUtils.simpleUUID();
-        String feedback = chatReq.getFeedback();
+//        String feedback = chatReq.getFeedback();
         //决策请求的业务参数
 //        List<HashMap<String, Object>> list = this.xinyiIndustryMapper.selectLast10RecordsForDecision();
         //2024年5月21日15:23:07 这里不能用关联查询处理,日报要获取最新的一条而不是今日的数据。
@@ -926,9 +926,10 @@ public class AsyncTask {
 //            dataJson = "{\"bot_id\":\"b00001\",\"exp_id\":\"721\",\"norm\":\"" + tXinyiWarningRecord.getCategory() + "\",\"feedback\":" + feedback + ",\"session_id\":" + "\"" + sessionId + "\"" + ",\"generate_args\":{\"max_new_tokens\":1024,\"max_length\":4096,\"num_beams\":1,\"do_sample\":true,\"top_p\":0.7,\"temperature\":0.95},\"extra\":{\"rows\":" +  rows + "}}";
             //2024年6月24日17:59:17  优化,不再拼接JSON字符串
             PolicyReq policyReq = new PolicyReq();
-            policyReq.setNorm(chatReq.getCategory());
-            policyReq.setFeedback(StringUtils.isBlank(feedback) ? null : JSON.parseObject(feedback, Map.class));
-//            policyReq.setSimulate(StringUtils.isBlank(simulate) ? null : JSON.parseObject(simulate, Map.class));
+            policyReq.setNorm(tXinyiWarningRecord.getCategory());
+            HashMap<String, Object> hashMap = new HashMap<>();
+            policyReq.setFeedback(hashMap);//不能传null
+            policyReq.setSimulate(hashMap);//不能传null
             policyReq.setSessionId(sessionId);
             HashMap<String, Object> map = new HashMap<>();
             map.put("rows", decisionReqs);