rasa: 设置modelId默认为1

dev_2.0.0
xueqingkun 1 year ago
parent b5377bb305
commit 497a5a0ebc

@ -25,11 +25,7 @@ public class RasaCmdController {
@PostMapping("/trainExec")
public String trainExec(@RequestBody RasaCmdArgumentVo argument) throws IOException, ExecutionException, InterruptedException, TimeoutException {
if (StrUtil.isEmpty(argument.getModelId())){
throw new BusinessException("modelId参数不能为空! ");
}
argument.setModelId("1");
return rasaCmdService.trainExec(argument);
}
@ -38,9 +34,7 @@ public class RasaCmdController {
@PostMapping("/runExec")
public String runExec(@RequestBody RasaCmdArgumentVo argument) throws ExecutionException, InterruptedException, TimeoutException {
if (StrUtil.isEmpty(argument.getModelId())){
throw new BusinessException("modelId参数不能为空! ");
}
argument.setModelId("1");
String outString = rasaCmdService.runExec(argument);
if (StrUtil.isEmptyIfStr(outString) || !outString.contains(RasaConstant.RUN_SUCCESS_MESSAGE)){
throw new BusinessException("任务执行异常。详细日志:"+outString);

@ -69,6 +69,7 @@ public class HumanUtil {
String res = HttpUtil.get(TEXT_DRIVEN_URL, param);
HumanRes resDTO = JSONUtil.toBean(res, HumanRes.class);
if (!"200".equals(resDTO.code)) {
log.info("播放结果:{}",res);
throw HumanException.humanError("播放语音失败");
}
}

Loading…
Cancel
Save