feat: 支持工作流代码节点 Python 执行引擎

- easyflow-module-ai: 新增 PythonRuntimeEngine、不可用引擎降级实现与引擎能力服务

- easyflow-module-ai: 在 TinyFlowConfigService 注册 python/py 引擎并增加启动探测与可用性日志

- easyflow-api: 新增 /api/v1/workflow/supportedCodeEngines 能力查询接口

- easyflow-starter: 增加 node.code-engine.python 配置项默认值

- Dockerfile: 安装 python3 运行时以支持容器内执行

- test: 增加 PythonRuntimeEngineTest 覆盖成功、语法错误、超时、输出限制、命令缺失场景

- chore(ui-admin): 更新 cspell 词典
This commit is contained in:
2026-03-01 19:59:53 +08:00
parent ac8de7dbb8
commit 29f82ed1f0
11 changed files with 631 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import tech.easyflow.ai.entity.Workflow;
import tech.easyflow.ai.easyagentsflow.service.CodeEngineCapabilityService;
import tech.easyflow.ai.service.BotWorkflowService;
import tech.easyflow.ai.service.ModelService;
import tech.easyflow.ai.service.WorkflowService;
@@ -55,6 +56,8 @@ public class WorkflowController extends BaseCurdController<WorkflowService, Work
private ChainParser chainParser;
@Resource
private TinyFlowService tinyFlowService;
@Resource
private CodeEngineCapabilityService codeEngineCapabilityService;
public WorkflowController(WorkflowService service, ModelService modelService) {
super(service);
@@ -160,6 +163,12 @@ public class WorkflowController extends BaseCurdController<WorkflowService, Work
return Result.ok(res);
}
@GetMapping("/supportedCodeEngines")
@SaCheckPermission("/api/v1/workflow/query")
public Result<?> supportedCodeEngines() {
return Result.ok(codeEngineCapabilityService.listSupportedCodeEngines());
}
@Override
public Result<Workflow> detail(String id) {
Workflow workflow = service.getDetail(id);
@@ -210,4 +219,4 @@ public class WorkflowController extends BaseCurdController<WorkflowService, Work
}
return null;
}
}
}