|
|
|
@@ -413,6 +413,7 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
if (StringUtils.isEmpty(category)) { |
|
|
|
category = "airport"; |
|
|
|
} |
|
|
|
String llmRoute = category; |
|
|
|
JSONObject joResult = new JSONObject(); |
|
|
|
joResult.put("msg",""); |
|
|
|
joResult.put("target",0); |
|
|
|
@@ -420,14 +421,14 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
vo.setCategory(category); |
|
|
|
vo.addDmLlm("user", intent.getContent()); |
|
|
|
JSONObject testJ = new JSONObject(); |
|
|
|
testJ.put("category","chaoyang"); |
|
|
|
testJ.put("category",category); |
|
|
|
JSONArray ja1 = new JSONArray(); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("role","user"); |
|
|
|
jo.put("content",intent.getContent()); |
|
|
|
ja1.add(jo); |
|
|
|
testJ.put("messages",ja1); |
|
|
|
JSONObject resultJson = remoteLandingLlmService.query("chaoyang",testJ); |
|
|
|
JSONObject resultJson = remoteLandingLlmService.query(llmRoute,testJ); |
|
|
|
log.info("北方大返回:{}",resultJson.toString()); |
|
|
|
if (resultJson.get("status").equals("success")) { |
|
|
|
JSONArray ja = resultJson.getJSONArray("data"); |
|
|
|
@@ -522,7 +523,7 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
String gatewayheader = LagiConfig.tenantLlmMap.get(enterpriseDtoR.getData().getName()); |
|
|
|
gatewayheader = StringUtils.isEmpty(gatewayheader) ? "": gatewayheader; |
|
|
|
log.info("北方大请求:{}",gatewayheader); |
|
|
|
JSONObject resultJson = remoteLandingLlmService.query("chaoyang",testJ); |
|
|
|
JSONObject resultJson = remoteLandingLlmService.query(gatewayheader,testJ); |
|
|
|
log.info("北方大返回:{}",resultJson.toString()); |
|
|
|
if (resultJson.get("status").equals("success")) { |
|
|
|
JSONArray ja = resultJson.getJSONArray("data"); |
|
|
|
@@ -1063,25 +1064,6 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
return AjaxResult.error(res); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/api/testforwelcome") |
|
|
|
public AjaxResult test(){ |
|
|
|
LocalDateTime dateTime = LocalDateTime.now(); |
|
|
|
String date = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
|
|
|
JSONObject jo = generativeWelcomeTemplate.handle("1", ""); |
|
|
|
JSONArray ja = jo.getJSONArray("data"); |
|
|
|
Long timeStamp = System.currentTimeMillis(); |
|
|
|
JSONObject timeJson = new JSONObject(); |
|
|
|
timeJson.put("timestamp", timeStamp); |
|
|
|
ja.add(timeJson); |
|
|
|
log.info(ja.toJSONString()); |
|
|
|
redisTemplate2.opsForHash().put("group:task" + ":generate", date, AjaxResult.success(ja).toJson().toJSONString()); |
|
|
|
Map<Object, Object> devices = redisTemplate2.opsForHash().entries("group:dgman:device:"); |
|
|
|
for(Object devId:devices.keySet()){ |
|
|
|
mqttTemplate.sendToMqtt("/" + activeProfile + "/" + "digital_man" + "/" + devId.toString() + "/" + "notify" + "/" + "generate-welcome", true, AjaxResult.success(ja).toJson().toJSONString()); |
|
|
|
} |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/inner/generateContextTask") |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult generateContextTask() { |
|
|
|
|