|
@@ -491,8 +491,7 @@ public class GRPCController extends BaseController {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
String sessionId = chatReq.getSessionId();
|
|
|
int isStrong = Objects.isNull(chatReq.getIsStrong()) ? 0 : chatReq.getIsStrong();
|
|
|
- String tools = null;
|
|
|
- boolean toolsFlag = true;//问答因为不确认是否走工具,所以传true; 但是工单一定是不用工具的,传false
|
|
|
+ String tools = "true";//问答因为不确认是否走工具,所以传true; 但是工单一定是走工具的,传工具名称
|
|
|
boolean useRag = true;//只有问答才传true,其他默认都false
|
|
|
//如果是工单,需要特殊处理一下showVal和question
|
|
|
if(1 == module){
|
|
@@ -548,9 +547,9 @@ public class GRPCController extends BaseController {
|
|
|
//2024年6月20日16:48:08 如果是自定义工单,需要处理图表 放到remark中
|
|
|
// chatReq.setRemark(JSON.toJSONString(frontService.customWorkOrderHandleByData(workOrderReq, workOrderRes), JSONWriter.Feature.WriteNulls));
|
|
|
}
|
|
|
- isStrong = 1;
|
|
|
- toolsFlag = false;
|
|
|
+ isStrong = 0;//2024年7月29日14:15:47 工单不走文心一言了
|
|
|
useRag = false;
|
|
|
+ tools = TOOLS_WORK_ORDER;
|
|
|
}
|
|
|
String ipAddr = IpUtils.getIpAddr();//获取用户的ip地址 传给大模型
|
|
|
int counts = 1;//默认是第一次
|
|
@@ -581,16 +580,18 @@ public class GRPCController extends BaseController {
|
|
|
//2024年6月25日18:12:23 优化,不再使用拼接JSON字符串
|
|
|
//2024年7月27日18:13:47 前端传过来tools
|
|
|
String toolsReq = chatReq.getTools();
|
|
|
- if(StringUtils.isNotBlank(toolsReq)){
|
|
|
- useRag = false;//2024年7月27日18:20:23 走本地工具,不需要文本增强
|
|
|
- isStrong = 0;
|
|
|
- tools = toolsReq;
|
|
|
+ //2024年7月29日14:20:22 先判断是不是走本地工具,再判断前端工具
|
|
|
+ if(StringUtils.isBlank(tools)){
|
|
|
+ if(StringUtils.isNotBlank(toolsReq)){
|
|
|
+ useRag = false;//2024年7月27日18:20:23 走本地工具,不需要文本增强
|
|
|
+ isStrong = 0;
|
|
|
+ tools = toolsReq;
|
|
|
+ }
|
|
|
+// else
|
|
|
+// tools = tools;
|
|
|
}
|
|
|
- else
|
|
|
- tools = String.valueOf(toolsFlag);
|
|
|
-
|
|
|
String dataJson = buildBigModelReqForChat(sessionId, historyDates, ipAddr, isStrong, chatReq.getTopP(), chatReq.getTemperature(), tools, useRag);
|
|
|
-// log.info("请求大模型的问答参数为{}", dataJson);
|
|
|
+ log.info("******请求大模型的问答参数为{}", dataJson);
|
|
|
PredictionsRequest request = PredictionsRequest.newBuilder()
|
|
|
.setModelName("slibra_bot")
|
|
|
.putInput("method", ByteString.copyFrom("infer_stream", "utf-8"))//推理
|