feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,293 @@
{
"nodes": [
{
"blocks": [],
"data": {
"nodeMeta": {
"description": "",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
"subTitle": "",
"title": "start"
},
"outputs": [
{
"name": "input",
"required": false,
"type": "float"
},
{
"name": "obj",
"required": true,
"schema": [
{
"name": "field1",
"required": false,
"schema": {
"type": "string"
},
"type": "list"
}
],
"type": "object"
},
{
"name": "arr",
"required": true,
"schema": {
"type": "string"
},
"type": "list"
}
],
"trigger_parameters": []
},
"edges": null,
"id": "100001",
"meta": {
"position": {
"x": 0,
"y": 0
}
},
"type": "1"
},
{
"blocks": [],
"data": {
"inputs": {
"content": {
"type": "string",
"value": {
"content": "{{output}}_{{output_obj.field1}}",
"type": "literal"
}
},
"inputParameters": [
{
"input": {
"type": "string",
"value": {
"content": {
"blockID": "",
"name": "",
"path": [
"app_var"
],
"source": "global_variable_app"
},
"rawMeta": {
"type": 1
},
"type": "ref"
}
},
"name": "output"
},
{
"input": {
"schema": [
{
"name": "field1",
"required": false,
"schema": {
"assistType": 10000,
"type": "string"
},
"type": "list"
}
],
"type": "object",
"value": {
"content": {
"blockID": "100001",
"name": "obj",
"source": "block-output"
},
"rawMeta": {
"type": 6
},
"type": "ref"
}
},
"name": "output_obj"
},
{
"input": {
"schema": {
"assistType": 10000,
"type": "string"
},
"type": "list",
"value": {
"content": {
"blockID": "100001",
"name": "obj.field1",
"source": "block-output"
},
"rawMeta": {
"type": 116
},
"type": "ref"
}
},
"name": "output_field1"
},
{
"input": {
"schema": {
"type": "string"
},
"type": "list",
"value": {
"content": {
"blockID": "100001",
"name": "arr",
"source": "block-output"
},
"rawMeta": {
"type": 99
},
"type": "ref"
}
},
"name": "output_arr"
},
{
"input": {
"type": "string",
"value": {
"content": "literal_value",
"rawMeta": {
"type": 1
},
"type": "literal"
}
},
"name": "literal_key"
},
{
"input": {
"schema": [
{
"input": {
"type": "float",
"value": {
"content": {
"blockID": "100001",
"name": "input",
"source": "block-output"
},
"rawMeta": {
"type": 4
},
"type": "ref"
}
},
"name": "obj_container_1"
},
{
"input": {
"type": "string",
"value": {
"content": "sub_literal",
"rawMeta": {
"type": 1
},
"type": "literal"
}
},
"name": "obj_container_2"
}
],
"type": "object",
"value": {
"type": "object_ref"
}
},
"name": "obj_container"
},
{
"input": {
"schema": [],
"type": "object",
"value": {
"content": "{\"a\": \"b\"}",
"rawMeta": {
"type": 6
},
"type": "literal"
}
},
"name": "obj_literal"
},
{
"input": {
"schema": {
"type": "integer"
},
"type": "list",
"value": {
"content": "[1,2]",
"rawMeta": {
"type": 100
},
"type": "literal"
}
},
"name": "arr_literal"
}
],
"streamingOutput": true,
"terminatePlan": "useAnswerContent"
},
"nodeMeta": {
"description": "end",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
"subTitle": "",
"title": "end"
}
},
"edges": null,
"id": "900001",
"meta": {
"position": {
"x": 559,
"y": -13
}
},
"type": "2"
},
{
"blocks": [],
"data": {
"inputs": {
"note": "[{\"type\":\"paragraph\",\"children\":[{\"text\":\"this is a comment\",\"type\":\"text\"}]}]",
"schemaType": "slate"
},
"size": {
"height": 150,
"width": 240
}
},
"edges": null,
"id": "117701",
"meta": {
"position": {
"x": 292.5,
"y": 160
}
},
"type": "31"
}
],
"edges": [
{
"sourceNodeID": "100001",
"targetNodeID": "900001",
"sourcePortID": ""
}
],
"versions": {
"loop": "v2"
}
}

View File

@@ -0,0 +1,121 @@
{
"nodes": [
{
"id": "100001",
"type": "1",
"meta": {
"position": {
"x": 67.71685761047468,
"y": -139.00163666121114
}
},
"data": {
"nodeMeta": {
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
"subTitle": "",
"title": "开始"
},
"outputs": [
{
"type": "string",
"name": "input",
"required": false
}
],
"trigger_parameters": []
}
},
{
"id": "900001",
"type": "2",
"meta": {
"position": {
"x": 932.7168576104747,
"y": -124.33715220949264
}
},
"data": {
"nodeMeta": {
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
"subTitle": "",
"title": "结束"
},
"inputs": {
"terminatePlan": "returnVariables",
"inputParameters": [
{
"name": "output",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
},
"rawMeta": {
"type": 1
}
}
}
}
]
}
}
},
{
"id": "125662",
"type": "9",
"meta": {
"position": {
"x": 500.2168576104747,
"y": -207.00163666121114
}
},
"data": {
"nodeMeta": {
"title": "cc1",
"description": "cc1",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
"isImageflow": false
},
"inputs": {
"workflowId": "7511616004728815618",
"spaceId": "666",
"workflowVersion": "",
"inputDefs": [
{
"name": "input",
"type": "string"
}
],
"type": 0,
"inputParameters": [],
"settingOnError": {}
},
"outputs": [
{
"type": "string",
"name": "output"
}
]
}
}
],
"edges": [
{
"sourceNodeID": "100001",
"targetNodeID": "125662"
},
{
"sourceNodeID": "125662",
"targetNodeID": "900001"
}
],
"versions": {
"loop": "v2"
}
}

View File

@@ -0,0 +1,79 @@
{
"nodes": [
{
"id": "100001",
"type": "1",
"meta": {
"position": {
"x": -73,
"y": -133
}
},
"data": {
"nodeMeta": {
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
"subTitle": "",
"title": "开始"
},
"outputs": [
{
"type": "string",
"name": "input",
"required": false
}
],
"trigger_parameters": []
}
},
{
"id": "900001",
"type": "2",
"meta": {
"position": {
"x": 592.9579414039315,
"y": -197.80451970288303
}
},
"data": {
"nodeMeta": {
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
"subTitle": "",
"title": "结束"
},
"inputs": {
"terminatePlan": "returnVariables",
"inputParameters": [
{
"name": "output",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
},
"rawMeta": {
"type": 1
}
}
}
}
]
}
}
}
],
"edges": [
{
"sourceNodeID": "100001",
"targetNodeID": "900001"
}
],
"versions": {
"loop": "v2"
}
}

View File

@@ -0,0 +1,357 @@
{
"nodes": [
{
"id": "100001",
"type": "1",
"meta": {
"position": {
"x": 0,
"y": 0
}
},
"data": {
"nodeMeta": {
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
"subTitle": "",
"title": "开始"
},
"outputs": [
{
"type": "string",
"name": "input",
"required": false
}
],
"trigger_parameters": []
}
},
{
"id": "900001",
"type": "2",
"meta": {
"position": {
"x": 1360,
"y": -206.75
}
},
"data": {
"nodeMeta": {
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
"subTitle": "",
"title": "结束"
},
"inputs": {
"terminatePlan": "returnVariables",
"inputParameters": [
{
"name": "output",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "167992",
"name": "output"
},
"rawMeta": {
"type": 1
}
}
}
}
]
}
}
},
{
"id": "167992",
"type": "15",
"meta": {
"position": {
"x": 855,
"y": -261.1
}
},
"data": {
"nodeMeta": {
"title": "文本处理",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
"description": "用于处理多个字符串类型变量的格式",
"mainColor": "#3071F2",
"subTitle": "文本处理"
},
"inputs": {
"method": "concat",
"inputParameters": [
{
"name": "String1",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
},
"rawMeta": {
"type": 1
}
}
}
}
],
"concatParams": [
{
"name": "concatResult",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "{{String1}}",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "arrayItemConcatChar",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "allArrayItemConcatChars",
"input": {
"type": "list",
"schema": {
"type": "object",
"schema": [
{
"type": "string",
"name": "label",
"required": true
},
{
"type": "string",
"name": "value",
"required": true
},
{
"type": "boolean",
"name": "isDefault",
"required": true
}
]
},
"value": {
"type": "literal",
"content": [
{
"label": "Line Break",
"value": "\n",
"isDefault": true
},
{
"label": "Tab Break",
"value": "\t",
"isDefault": true
},
{
"label": "Period",
"value": "。",
"isDefault": true
},
{
"label": "Comma",
"value": "",
"isDefault": true
},
{
"label": "Semicolon",
"value": "",
"isDefault": true
},
{
"label": "Space",
"value": " ",
"isDefault": true
}
]
}
}
}
]
},
"outputs": [
{
"type": "string",
"name": "output",
"required": true
}
]
}
},
{
"id": "151138",
"type": "5",
"meta": {
"position": {
"x": 1289,
"y": -504.1
}
},
"data": {
"nodeMeta": {
"title": "代码",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Code-v2.jpg",
"description": "编写代码,处理输入变量来生成返回值",
"mainColor": "#00B2B2",
"subTitle": "代码"
},
"inputs": {
"inputParameters": [
{
"name": "input",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "167992",
"name": "output"
},
"rawMeta": {
"type": 1
}
}
}
}
],
"code": "workflow_code_py_illustrate_all\n\nasync def main(args: Args) -> Output:\n params = args.params\n workflow_code_py_illustrate_output\n ret: Output = {\n \"key0\": params['input'] + params['input'], workflow_code_py_illustrate_output_param\n \"key1\": [\"hello\", \"world\"], workflow_code_py_illustrate_output_arr\n \"key2\": { workflow_code_py_illustrate_output_obj\n \"key21\": \"hi\"\n },\n }\n return ret",
"language": 3,
"settingOnError": {
"processType": 1,
"timeoutMs": 60000,
"retryTimes": 0
}
},
"outputs": [
{
"type": "string",
"name": "key0"
},
{
"type": "list",
"name": "key1",
"schema": {
"type": "string"
}
},
{
"type": "object",
"name": "key2",
"schema": [
{
"type": "string",
"name": "key21"
}
]
}
]
}
},
{
"id": "148912",
"type": "8",
"meta": {
"position": {
"x": 410,
"y": -165.05
}
},
"data": {
"nodeMeta": {
"title": "选择器",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Condition-v2.jpg",
"description": "连接多个下游分支,若设定的条件成立则仅运行对应的分支,若均不成立则只运行“否则”分支",
"mainColor": "#00B2B2",
"subTitle": "选择器"
},
"inputs": {
"branches": [
{
"condition": {
"logic": 2,
"conditions": [
{
"operator": 1,
"left": {
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
}
}
}
},
"right": {
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "123",
"rawMeta": {
"type": 1
}
}
}
}
}
]
}
}
]
}
}
}
],
"edges": [
{
"sourceNodeID": "100001",
"targetNodeID": "148912"
},
{
"sourceNodeID": "167992",
"targetNodeID": "900001"
},
{
"sourceNodeID": "148912",
"targetNodeID": "167992",
"sourcePortID": "true"
},
{
"sourceNodeID": "167992",
"targetNodeID": "151138"
}
],
"versions": {
"loop": "v2"
}
}

View File

@@ -0,0 +1,527 @@
{
"nodes": [
{
"id": "100001",
"type": "1",
"meta": {
"position": {
"x": -480.76936241417366,
"y": -827.3429928800074
}
},
"data": {
"nodeMeta": {
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
"subTitle": "",
"title": "开始"
},
"outputs": [
{
"type": "string",
"name": "input",
"required": false
}
],
"trigger_parameters": []
}
},
{
"id": "900001",
"type": "2",
"meta": {
"position": {
"x": 1074.4690350659453,
"y": -1405.100726522103
}
},
"data": {
"nodeMeta": {
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
"subTitle": "",
"title": "结束"
},
"inputs": {
"terminatePlan": "returnVariables",
"inputParameters": [
{
"name": "output",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
},
"rawMeta": {
"type": 1
}
}
}
}
]
}
}
},
{
"id": "138145",
"type": "9",
"meta": {
"position": {
"x": -337.08518741667314,
"y": -1143.5656083443255
}
},
"data": {
"nodeMeta": {
"title": "c1",
"description": "c1",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
"isImageflow": false
},
"inputs": {
"workflowId": "7511615200781402118",
"spaceId": "666",
"workflowVersion": "",
"inputDefs": [
{
"name": "input",
"type": "string"
}
],
"type": 0,
"inputParameters": [],
"settingOnError": {}
},
"outputs": [
{
"type": "string",
"name": "output"
}
]
}
},
{
"id": "162612",
"type": "4",
"meta": {
"position": {
"x": 541.3322143572306,
"y": -1280.9656083443256
}
},
"data": {
"nodeMeta": {
"title": "top_news",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
"subtitle": "pl:top_news",
"description": "帮助用户获取搜狐网上的每日热闻"
},
"inputs": {
"apiParam": [
{
"name": "apiID",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "7511617581250248704",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "apiName",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "pl",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "pluginID",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "7511616454588891136",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "pluginName",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "pl",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "pluginVersion",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "0",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "tips",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "outDocLink",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "",
"rawMeta": {
"type": 1
}
}
}
}
],
"inputParameters": [
{
"name": "count",
"input": {
"type": "integer",
"value": {
"type": "literal",
"content": 12,
"rawMeta": {
"type": 2
}
}
}
},
{
"name": "q",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "12",
"rawMeta": {
"type": 1
}
}
}
}
],
"settingOnError": {
"processType": 1,
"timeoutMs": 180000,
"retryTimes": 0
}
},
"outputs": [
{
"type": "string",
"name": "traceId"
},
{
"type": "float",
"name": "code"
},
{
"type": "object",
"name": "data",
"schema": [
{
"type": "object",
"name": "coze_ark_001",
"schema": [
{
"type": "list",
"name": "list",
"schema": {
"type": "object",
"schema": [
{
"type": "string",
"name": "brief"
},
{
"type": "string",
"name": "title"
},
{
"type": "string",
"name": "url"
}
]
}
}
]
}
]
},
{
"type": "float",
"name": "total"
},
{
"type": "string",
"name": "message"
},
{
"type": "boolean",
"name": "success"
}
]
}
},
{
"id": "199400",
"type": "3",
"meta": {
"position": {
"x": 51.00828691811297,
"y": -1320.3134331225874
}
},
"data": {
"nodeMeta": {
"title": "大模型",
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
"description": "调用大语言模型,使用变量和提示词生成回复",
"mainColor": "#5C62FF",
"subTitle": "大模型"
},
"inputs": {
"inputParameters": [
{
"name": "input",
"input": {
"type": "string",
"value": {
"type": "ref",
"content": {
"source": "block-output",
"blockID": "100001",
"name": "input"
},
"rawMeta": {
"type": 1
}
}
}
}
],
"llmParam": [
{
"name": "modelType",
"input": {
"type": "integer",
"value": {
"type": "literal",
"content": "1",
"rawMeta": {
"type": 2
}
}
}
},
{
"name": "modleName",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "豆包·1.5·Pro·32k",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "generationDiversity",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "balance",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "temperature",
"input": {
"type": "float",
"value": {
"type": "literal",
"content": "0.8",
"rawMeta": {
"type": 4
}
}
}
},
{
"name": "maxTokens",
"input": {
"type": "integer",
"value": {
"type": "literal",
"content": "4096",
"rawMeta": {
"type": 2
}
}
}
},
{
"name": "responseFormat",
"input": {
"type": "integer",
"value": {
"type": "literal",
"content": "2",
"rawMeta": {
"type": 2
}
}
}
},
{
"name": "prompt",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "{{input}}",
"rawMeta": {
"type": 1
}
}
}
},
{
"name": "enableChatHistory",
"input": {
"type": "boolean",
"value": {
"type": "literal",
"content": false,
"rawMeta": {
"type": 3
}
}
}
},
{
"name": "chatHistoryRound",
"input": {
"type": "integer",
"value": {
"type": "literal",
"content": "3",
"rawMeta": {
"type": 2
}
}
}
},
{
"name": "systemPrompt",
"input": {
"type": "string",
"value": {
"type": "literal",
"content": "you are go coder",
"rawMeta": {
"type": 1
}
}
}
}
],
"fcParam": {
"pluginFCParam": {
"pluginList": [
{
"plugin_id": "7511616454588891136",
"api_id": "7511617581250248704",
"api_name": "top_news",
"plugin_version": "0",
"is_draft": false
}
]
}
},
"settingOnError": {
"processType": 1,
"timeoutMs": 180000,
"retryTimes": 0
}
},
"outputs": [
{
"type": "string",
"name": "output"
}
],
"version": "3"
}
}
],
"edges": [
{
"sourceNodeID": "100001",
"targetNodeID": "138145"
},
{
"sourceNodeID": "162612",
"targetNodeID": "900001"
},
{
"sourceNodeID": "138145",
"targetNodeID": "199400"
},
{
"sourceNodeID": "199400",
"targetNodeID": "162612"
}
],
"versions": {
"loop": "v2"
}
}