bugfix
This commit is contained in:
parent
d50744af4e
commit
ca46f7735b
10
SKILL.md
10
SKILL.md
@ -7,8 +7,18 @@ description: 根据用户输入创建工作流
|
||||
|
||||
## 流程引擎
|
||||
流程引擎具体说明请看[README.md](README.md)
|
||||
## 查找所有现有流程
|
||||
执行下面的命令
|
||||
```
|
||||
CALL: {"function": "get_exists_workflows"}
|
||||
```
|
||||
|
||||
## 新建流程
|
||||
将用户输入拆解为流程引擎添加流程的json数据,然后调用以下函数
|
||||
```
|
||||
CALL:{ "function": "add_new_workflow", "params":{"name":流程名字,"description": 用户输入的"dsl":YAML格式的符合上述流程规范的流程定义}
|
||||
```
|
||||
|
||||
## 查找或新建流程
|
||||
首先查找所有流程,用户输入和查询结果一起组成:”输入输入:用户实际输入,
|
||||
现有流程:查询所有流程返回的数据,选择可以实现的模型id, 可以多个,也可以为NONE,表示没有找到合适的流程“, 交给大模型选择, 如果返回结果一到多个流程id
|
||||
|
||||
@ -12,6 +12,7 @@ Features:
|
||||
- Query APIs for UI
|
||||
"""
|
||||
import asyncio
|
||||
import yaml
|
||||
from random import randint
|
||||
from appPublic.log import debug
|
||||
from appPublic.timeUtils import timestampstr
|
||||
@ -158,8 +159,9 @@ where backid=${backid}$
|
||||
|
||||
async def create_definition(self, org_id, name, description, version, dsl_text, ctxfields):
|
||||
env = ServerEnv()
|
||||
data = yaml.safe_load(dsl_text)
|
||||
async with get_sor_context(env, 'dagflow') as sor:
|
||||
fid = env.uuid()
|
||||
fid = data['id']
|
||||
await sor.C('flow_definition', {
|
||||
'id': fid,
|
||||
'org_id': org_id,
|
||||
@ -504,6 +506,15 @@ def get_engine():
|
||||
id = randint(0, cnt-1)
|
||||
return env.flow_engines[id]
|
||||
|
||||
async def get_exists_workflows(request):
|
||||
env = request._run_ns
|
||||
orgid = await env.get_userorgid()
|
||||
orgids = ['0', orgid]
|
||||
sql = "select * from flow_definition where org_id in ${orgids}$"
|
||||
async with get_sor_context(env, 'dagflow') as sor:
|
||||
recs = await sor.sqlExe(sql, {'orgids': orgids})
|
||||
return recs
|
||||
return []
|
||||
async def add_new_workflow(request, params_kw={}):
|
||||
name = params_kw.name
|
||||
dsl = params_kw.dsl
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user