|
|
|
@ -3,10 +3,12 @@ package com.supervision.rasa.service.impl;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.supervision.model.RasaModelInfo;
|
|
|
|
|
import com.supervision.rasa.config.ThreadPoolExecutorConfig;
|
|
|
|
|
import com.supervision.rasa.pojo.vo.RasaArgument;
|
|
|
|
|
import com.supervision.rasa.service.RasaCmdService;
|
|
|
|
|
import com.supervision.model.User;
|
|
|
|
|
import com.supervision.service.RasaModeService;
|
|
|
|
|
import com.supervision.service.UserService;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -50,7 +52,7 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
@Value("${rasa.shell.work:/home/rasa_manage/}")
|
|
|
|
|
private String shellWork;
|
|
|
|
|
|
|
|
|
|
private final UserService userService;
|
|
|
|
|
private final RasaModeService rasaModeService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String trainExec(RasaArgument argument) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
@ -80,6 +82,10 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
return messageList.stream().anyMatch(s->StrUtil.isNotEmpty(s) && s.contains(keyWord));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean containKey(List<String> messageList,String key){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -94,13 +100,6 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
return String.join("\r\n",execCmd(cmds,s-> StrUtil.isNotBlank(s)&& s.contains("Rasa server is up and running"),90));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void test() {
|
|
|
|
|
List<User> list = userService.list();
|
|
|
|
|
//RasaModelInfo rasaModelInfo = rasaModeService.queryByModelId("1");
|
|
|
|
|
|
|
|
|
|
System.out.println(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> execCmd(List<String> cmds, Predicate<String> endPredicate, long timeOut) throws InterruptedException, ExecutionException, TimeoutException {
|
|
|
|
|