feat: flowise 调整

This commit is contained in:
stream 2025-12-12 15:20:22 +08:00
parent 2f852ead1f
commit f6af284363

View File

@ -57,7 +57,7 @@ public class FlowiseActionService {
private String chatId = null; private String chatId = null;
public String start(FlowiseStartRequestVO request) { public String start(FlowiseStartRequestVO request) {
log.info("flowise start"); log.info("flowise start: {}", System.currentTimeMillis());
abort(); abort();
synchronized (lock) { synchronized (lock) {
if (chatId != null) { if (chatId != null) {
@ -91,9 +91,7 @@ public class FlowiseActionService {
public String abort() { public String abort() {
CallAPIUtil.doPostJson(flowiseTts + "stop", null, null); CallAPIUtil.doPostJson(flowiseTts + "stop", null, null);
Map<String, TaskContext> instContextMap = taskContextManager.getInstContextMap(); Map<String, TaskContext> instContextMap = taskContextManager.getInstContextMap();
instContextMap.forEach((key, value) -> { instContextMap.forEach((key, value) -> flowControlService.stop(key));
flowControlService.stop(key);
});
synchronized (lock) { synchronized (lock) {
if (chatId == null) { if (chatId == null) {
@ -114,7 +112,7 @@ public class FlowiseActionService {
} }
public String command(FlowiseActionRequestVO request) { public String command(FlowiseActionRequestVO request) {
log.info("command start"); log.info("command start: {}", System.currentTimeMillis());
String action = request.getAction(); String action = request.getAction();
FlowiseActionEnum actionEnum = FlowiseActionEnum.fromAction(action); FlowiseActionEnum actionEnum = FlowiseActionEnum.fromAction(action);
String terminalId = "4ed1246c465b97975f96c9ef8371a3bd"; String terminalId = "4ed1246c465b97975f96c9ef8371a3bd";
@ -142,7 +140,7 @@ public class FlowiseActionService {
} }
public String chat(FlowiseChatRequestVO requestVO) { public String chat(FlowiseChatRequestVO requestVO) {
log.info("chat start"); log.info("chat start: {}", System.currentTimeMillis());
Map<String, String> body = new HashMap<>(); Map<String, String> body = new HashMap<>();
body.put("text", requestVO.getText()); body.put("text", requestVO.getText());
body.put("voice", "x4_yezi"); body.put("voice", "x4_yezi");