|
@@ -441,8 +441,8 @@ public class RyTask
|
|
|
.usePlaintext()
|
|
|
.build();
|
|
|
InferenceAPIsServiceGrpc.InferenceAPIsServiceBlockingStub stub = InferenceAPIsServiceGrpc.newBlockingStub(channel);
|
|
|
- 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 + "}}";
|
|
|
- System.out.println(dataJson);
|
|
|
+ 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 + "}}";
|
|
|
+ log.info("请求大模型的决策的参数为{}", dataJson);
|
|
|
PredictionsRequest request = PredictionsRequest.newBuilder()
|
|
|
.setModelName("slibra_bot")
|
|
|
.putInput("method", ByteString.copyFrom("decision_stream", "utf-8"))//推理
|
|
@@ -468,9 +468,9 @@ public class RyTask
|
|
|
chatReq.setSessionId(sessionId);
|
|
|
chatReq.setType(0);//0问答 1决策
|
|
|
chatReq.setModule(3);
|
|
|
- String userId = SecurityUtils.getUserId().toString();
|
|
|
- String username = SecurityUtils.getUsername();
|
|
|
- chatReq.setUserId(userId);
|
|
|
+ /*String userId = SecurityUtils.getUserId().toString();
|
|
|
+ String username = SecurityUtils.getUsername();*/
|
|
|
+ chatReq.setUserId(WARNING_DEFAULT_CREATE);
|
|
|
String showVal = this.buildShowValue(tXinyiWarningRecord, tXinyiIndustry, normConfig);
|
|
|
chatReq.setShowVal(showVal);//前端展示的数据和提问的数据不一致
|
|
|
chatReq.setQuestion(dataJson);
|
|
@@ -478,7 +478,7 @@ public class RyTask
|
|
|
chatReq.setWarningId(String.valueOf(tXinyiWarningRecord.getId()));
|
|
|
chatReq.setCounts(1);//问答次数
|
|
|
|
|
|
- chatReq.setCreateBy(username);
|
|
|
+ chatReq.setCreateBy(WARNING_DEFAULT_CREATE);
|
|
|
chatReq.setCreateTime(DateUtils.getNowDate());
|
|
|
this.xinyiChatRecordMapper.insertTXinyiChatRecord(chatReq);
|
|
|
// 关闭输出流
|