pipeline-task/wwwroot/api/task_modify.dspy
yumoqing 50a38e15e1 feat: pipeline-task 交互模块初始版本
- 纯薄交互层,无数据表,调用 pipeline-service 引擎函数
- 6个dspy API(submit/list/detail/node/modify/control)
- 4个UI页面(index/list/detail/submit)
- pipeline_task.js 交互辅助函数
- load_path.py RBAC 权限注册
- 完整 README 文档
2026-06-11 17:36:37 +08:00

26 lines
797 B
Plaintext

tenant_id = (await get_userorgid()) or '0'
task_id = params_kw.get('task_id', '')
step_name = params_kw.get('step_name', '')
content_raw = params_kw.get('content', '')
rerun_from = params_kw.get('rerun_from', 'node')
if not task_id or not step_name:
return json.dumps({"success": False, "message": "缺少task_id或step_name"}, ensure_ascii=False)
# Parse content
if isinstance(content_raw, str):
try:
content = json.loads(content_raw)
except Exception:
content = {"text": content_raw}
else:
content = content_raw
updates = {step_name: {"content": content}}
try:
result = await pipeline_modify(tenant_id, task_id, updates, rerun_from)
return result
except Exception as e:
return json.dumps({"success": False, "message": str(e)}, ensure_ascii=False)