-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathworkflow.ts
More file actions
533 lines (530 loc) · 17.9 KB
/
workflow.ts
File metadata and controls
533 lines (530 loc) · 17.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
export default {
node: '節點',
nodeName: '節點名稱',
baseComponent: '基礎組件',
nodeSetting: '節點設置',
workflow: '工作流',
knowledgeWorkflow: '知識庫工作流',
info: {
previewVersion: '預覽版本:',
saveTime: '保存時間:',
},
operation: {
toImportDoc: '去導入文檔',
importWorkflow: '導入工作流',
exportWorkflow: '導出工作流',
},
setting: {
restoreVersion: '恢復版本',
restoreCurrentVersion: '恢復此版本',
addComponent: '添加組件',
releaseHistory: '發布歷史',
autoSave: '自動保存',
latestRelease: '最近發布',
copyParam: '複製參數',
exit: '直接退出',
exitSave: '保存並退出',
templateCenter: '模板中心',
},
tip: {
noData: '沒有找到相關結果',
nameMessage: '名字不能為空!',
onlyRight: '只允許從右邊的錨點連出',
notRecyclable: '不可循環連線',
onlyLeft: '只允許連接左邊的錨點',
applicationNodeError: '該智能體不可用',
toolNodeError: '該函數不可用',
repeatedNodeError: '節點名稱已存在!',
cannotCopy: '不能被複製',
copyError: '已複製節點',
paramErrorMessage: '參數已存在: ',
saveMessage: '當前修改未保存,是否保存後退出?',
searchPlaceholder: '請輸入節點名稱',
},
delete: {
confirmTitle: '確定刪除該節點?',
deleteMessage: '節點不允許刪除',
},
control: {
zoomOut: '縮小',
zoomIn: '放大',
fitView: '適應',
retract: '收起全部節點',
extend: '展開全部節點',
beautify: '一鍵美化',
},
variable: {
global: '全局變量',
chat: '會話變量',
Referencing: '引用變量',
ReferencingRequired: '引用變量必填',
ReferencingError: '引用變量錯誤',
NoReferencing: '不存在的引用變量',
placeholder_key: '請輸入鍵名',
placeholder: '請選擇變量',
inputPlaceholder: '請輸入變量',
loop: '循環變量',
},
condition: {
title: '執行條件',
front: '前置',
AND: '所有',
OR: '任一',
text: '連線節點執行完,執行當前節點',
},
validate: {
startNodeRequired: '開始節點必填',
startNodeOnly: '開始節點只能有一個',
baseNodeRequired: '基本信息節點必填',
baseNodeOnly: '基本信息節點只能有一個',
notInWorkFlowNode: '未在流程中的節點',
noNextNode: '不存在的下一個節點',
nodeUnavailable: '節點不可用',
needConnect1: '節點的',
needConnect2: '分支需要連接',
cannotEndNode: '節點不能當做結束節點',
loopNodeBreakNodeRequired: '無限循環必須存在 Break 節點',
},
nodes: {
knowledgeWriteNode: {
label: '知識庫寫入',
text: '將輸入的分段列表寫入當前知識庫,並完成向量化處理',
},
dataSourceWebNode: {
label: 'Web 網站',
text: '輸入根地址自動抓取Web數據(單鏈接對應單文檔),輸出含內容的文檔列表',
field_label: '文件列表',
},
dataSourceLocalNode: {
label: '本地文件',
text: '上傳本地文件,輸出文件列表(不解析內容,需配合 “文檔內容提取” 節點解析)',
fileList: '文件列表',
fileFormat: {
label: '支持的文件格式',
requiredMessage: '請選擇文件格式',
},
maxFileNumber: {
label: '每次上傳最大文件數',
},
maxFileCountNumber: {
label: '上傳的每個文檔最大(MB)',
},
},
classify: {
aiCapability: 'AI 能力',
businessLogic: '業務邏輯',
other: '其他',
dataProcessing: '數據處理',
},
startNode: {
label: '開始',
question: '用戶問題',
currentTime: '當前時間',
},
baseNode: {
fileUpload: {
label: '文件上傳',
tooltip: '開啟後,問答頁面會顯示上傳文件的按鈕。',
},
FileUploadSetting: {
title: '文件上傳設置',
maxFiles: '單次上傳最多文件數',
fileLimit: '每個文件最大(MB)',
fileUploadType: {
label: '上傳的文件類型',
documentText: '需要使用「文檔內容提取」節點解析文檔內容',
imageText: '需要使用「圖片理解」節點解析圖片內容',
videoText: '需要使用「視頻理解」節點解析視頻內容',
audioText: '需要使用「語音轉文本」節點解析音頻內容',
uploadMethod: '上傳方式',
},
},
},
KnowledgeBaseNode: {
DocumentSetting: '文檔處理設置',
},
aiChatNode: {
label: 'AI 對話',
text: '與 AI 大模型進行對話',
answer: 'AI 回答內容',
returnContent: {
label: '返回內容',
tooltip: `關閉後該節點的內容則不輸出給用戶。
如果你想讓用戶看到該節點的輸出內容,請打開開關。`,
},
defaultPrompt: '已知信息',
think: '思考過程',
historyMessage: '歷史聊天記錄',
},
searchKnowledgeNode: {
label: '知識庫檢索',
text: '關聯知識庫,查找與問題相關的分段',
paragraph_list: '檢索結果的分段列表',
is_hit_handling_method_list: '滿足直接回答的分段列表',
result: '檢索結果',
directly_return: '滿足直接回答的分段內容',
searchParam: '檢索參數',
showKnowledge: {
label: '結果顯示在知識來源',
requiredMessage: '請設定參數',
},
searchQuestion: {
label: '檢索問題',
placeholder: '請選擇檢索問題',
requiredMessage: '請選擇檢索問題',
},
},
searchDocumentNode: {
label: '文檔標籤檢索',
text: '從設定的檢索範圍中,根據文檔標籤檢索出符合條件的文檔',
selectKnowledge: '檢索範圍',
searchSetting: '檢索設定',
custom: '手動',
customTooltip: '手動設置標籤過濾條件',
auto: '自動',
autoTooltip: '根據檢索問題自動匹配文檔標簽',
documentList: '文檔列表',
knowledgeList: '知識庫列表',
result: '檢索結果',
searchParam: '檢索參數',
select_variable: '選擇變數',
valueMessage: `值或變量`,
searchQuestion: {
label: '檢索問題',
placeholder: '請選擇檢索問題',
requiredMessage: '請選擇檢索問題',
},
},
questionNode: {
label: '問題優化',
text: '根據歷史聊天記錄優化完善當前問題,更利於匹配知識庫分段',
result: '問題優化結果',
systemDefault: `# 角色
妳是壹位問題優化大師,擅長根據上下文精準揣測用戶意圖,並對用戶提出的問題進行優化。
## 技能
### 技能 1: 優化問題
2. 接收用戶輸入的問題。
3. 依據上下文仔細分析問題含義。
4. 輸出優化後的問題。
## 限制:
- 僅返回優化後的問題,不進行額外解釋或說明。
- 確保優化後的問題準確反映原始問題意圖,不得改變原意。`,
},
conditionNode: {
label: '判斷器',
text: '根據不同條件執行不同的節點',
branch_name: '分支名稱',
conditions: {
label: '條件',
info: '符合以下',
requiredMessage: '請選擇條件',
},
valueMessage: '請輸入值',
addCondition: '添加條件',
addBranch: '添加分支',
},
replyNode: {
label: '指定回覆',
text: '指定回覆內容,引用變量會轉換為字符串進行輸出',
replyContent: '回覆內容',
},
rerankerNode: {
label: '多路召回',
text: '使用重排模型對多個知識庫的檢索結果進行二次召回',
result_list: '重排結果列表',
result: '重排結果',
rerankerContent: {
label: '重排內容',
requiredMessage: '請選擇重排內容',
},
higher: '高於',
ScoreTooltip: 'Score 越高相關性越強。',
max_paragraph_char_number: '最大引用字符數',
reranker_model: {
label: '重排模型',
placeholder: '請選擇重排模型',
},
},
formNode: {
label: '表單收集',
text: '在問答過程中用於收集用戶信息,可以根據收集到表單數據執行後續流程',
form_content_format1: '你好,請先填寫下面表單內容:',
form_content_format2: '填寫後請點擊【提交】按鈕進行提交。',
form_data: '表單全部內容',
formContent: {
label: '表單輸出內容',
requiredMessage: '請表單輸出內容',
tooltip: '設置執行該節點輸出的內容,{ form } 為表單的佔位符。',
},
formAllContent: '表單全部內容',
formSetting: '表單配置',
},
documentExtractNode: {
label: '文檔內容提取',
text: '解析輸入文檔,輸出結構化文檔內容',
content: '文檔內容',
},
documentSplitNode: {
label: '文檔拆分',
text: '按分段策略拆分輸入文檔內容,輸出分段文本列表',
paragraphList: '分段列表',
splitStrategy: {
label: '分段策略',
placeholder: '請選擇分段策略',
requiredMessage: '請選擇分段策略',
},
chunk_length: {
label: '子分塊長度',
tooltip1: '核心目標是平衡檢索精度與召回效率',
tooltip2:
'避免過短拆分:單塊<50 字易導致語義碎片化,檢索時可能因缺少上下文無法匹配查詢意圖',
tooltip3:
'避免過長拆分:單塊>500 字會增加冗餘信息,降低檢索精准度,且佔用更多存儲和計算資源',
},
title1: '分段標題設置為分段的關聯問題',
title2: '文檔名稱設置為分段的關聯問題',
},
videoUnderstandNode: {
label: '视频理解',
text: '识别出视频中的对象、场景等信息回答用户问题',
answer: 'AI 回答内容',
model: {
label: '视觉模型',
requiredMessage: '请选择视觉模型',
},
video: {
label: '选择视频',
requiredMessage: '请选择视频',
},
},
imageUnderstandNode: {
label: '圖片理解',
text: '識別出圖片中的物件、場景等信息回答用戶問題',
answer: 'AI 回答內容',
model: {
label: '視覺模型',
requiredMessage: '請選擇視覺模型',
},
image: {
label: '選擇圖片',
requiredMessage: '請選擇圖片',
},
},
variableAssignNode: {
label: '變數賦值',
text: '更新全域變數的值',
assign: '賦值',
},
variableAggregationNode: {
label: '變量聚合',
text: '按聚合策略聚合每組的變量',
Strategy: '聚合策略',
placeholder: '返回每組的第一個非空值',
placeholder1: '返回每組變量的數組(Array)',
placeholder2: '返回每組變量的字典(Dict)',
group: {
noneError: '名稱不能為空',
dupError: '名稱不能重複',
},
addGroup: '添加分組',
editGroup: '編輯分組',
},
mcpNode: {
label: 'MCP 調用',
text: '通過 SSE/Streamable HTTP 方式執行 MCP 服務中的工具',
getToolsSuccess: '獲取工具成功',
getTool: '獲取工具',
toolParam: '工具參數',
mcpServerTip: '請輸入 JSON 格式的 MCP 服務器配置',
mcpToolTip: '請選擇工具',
configLabel: 'MCP Server Config (僅支持SSE/Streamable HTTP 調用方式)',
reference: '引用MCP',
},
imageGenerateNode: {
label: '圖片生成',
text: '根據提供的文本內容生成圖片',
answer: 'AI 回答內容',
model: {
label: '圖片生成模型',
requiredMessage: '請選擇圖片生成模型',
},
prompt: {
label: '提示詞(正向)',
tooltip: '正向提示詞,用來描述生成圖像中期望包含的元素和視覺特點',
},
negative_prompt: {
label: '提示詞(負向)',
tooltip: '反向提示詞,用來描述不希望在畫面中看到的內容,可以對畫面進行限制。',
placeholder: '請描述不想生成的圖片內容,比如:顏色、血腥內容',
},
},
textToVideoGenerate: {
label: '文生影片',
text: '根據提供的文字內容生成影片',
answer: 'AI 回答內容',
model: {
label: '文生影片模型',
requiredMessage: '請選擇文生影片模型',
},
prompt: {
label: '提示詞(正向)',
tooltip: '正向提示詞,用來描述生成影片中期望包含的元素和視覺特點',
},
negative_prompt: {
label: '提示詞(負向)',
tooltip: '反向提示詞,用來描述不希望在影片中看到的內容,可以對影片進行限制。',
placeholder: '請描述不想生成的影片內容,例如:顏色、血腥內容',
},
},
imageToVideoGenerate: {
label: '圖生影片',
text: '根據提供的圖片生成影片',
answer: 'AI 回答內容',
model: {
label: '圖生影片模型',
requiredMessage: '請選擇圖生影片模型',
},
prompt: {
label: '提示詞(正向)',
tooltip: '正向提示詞,用來描述生成影片中期望包含的元素和視覺特點',
},
negative_prompt: {
label: '提示詞(負向)',
tooltip: '反向提示詞,用來描述不希望在影片中看到的內容,可以對影片進行限制。',
placeholder: '請描述不想生成的影片內容,例如:顏色、血腥內容',
},
first_frame: {
label: '首幀圖片',
requiredMessage: '請選擇首幀圖片',
},
last_frame: {
label: '尾幀圖片',
requiredMessage: '請選擇尾幀圖片',
},
},
speechToTextNode: {
label: '語音轉文本',
text: '將音頻通過語音識別模型轉換為文本',
stt_model: {
label: '語音識別模型',
},
audio: {
label: '選擇語音文件',
placeholder: '請選擇語音文件',
},
},
textToSpeechNode: {
label: '文本轉語音',
text: '將文本通過語音合成模型轉換為音頻',
tts_model: {
label: '語音合成模型',
},
content: {
label: '選擇文本內容',
},
},
toolNode: {
label: '自定義工具',
text: '通過執行自定義腳本,實現數據處理',
},
intentNode: {
label: '意圖識別',
text: '將用戶問題與用戶預設的意圖分類進行匹配',
other: '其他',
error2: '意圖重複',
placeholder: '請選擇分類項',
classify: {
label: '意圖分類',
},
input: {
label: '輸入',
},
},
applicationNode: {
label: '智能體節點',
},
loopNode: {
label: '循環節點',
text: '通過設置循環次數和邏輯,重複執行一系列任務',
loopType: {
label: '循環類型',
requiredMessage: '請選擇循環類型',
arrayLoop: '數組循環',
numberLoop: '指定次數循環',
infiniteLoop: '無限循環',
},
loopNumber: {
label: '循環次數',
requiredMessage: '請填寫循環次數',
},
loopArray: {
label: '循環數組',
requiredMessage: '循環數組必填',
placeholder: '請選擇循環數組',
},
loopSetting: '循環設置',
loopDetail: '循環詳情',
},
loopStartNode: {
label: '循環開始',
loopIndex: '下標',
loopItem: '循環元素',
},
loopBodyNode: { label: '循環體', text: '循環體' },
loopContinueNode: {
label: 'Continue',
text: '用於終止當前循環,執行下次循環',
isContinue: 'Continue',
},
loopBreakNode: { label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break' },
variableSplittingNode: {
label: '變量拆分',
text: '通過配置 JSON Path 表達式,對輸入的 JSON 格式變量進行解析和拆分',
result: '結果',
splitVariables: '拆分變量',
inputVariables: '輸入變量',
addVariables: '添加變量',
editVariables: '編輯變量',
variableListPlaceholder: '請添加折開變數',
expression: {
label: '表達式',
placeholder: '請輸入表達式',
tooltip: '請使用 JSON Path 表達式拆分變量,例如:$.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">點擊查看詳情 ➜ pypi.org</a>',
},
},
parameterExtractionNode: {
label: '參數提取',
text: '利用 AI 模型提取結構化參數',
extractParameters: {
label: '提取參數',
variableListPlaceholder: '請添加選取參數',
parameterType: '參數類型',
},
},
},
compare: {
is_null: '為空',
is_not_null: '不為空',
contain: '包含',
not_contain: '不包含',
eq: '等於',
not_eq: '不等於',
ge: '大於等於',
gt: '大於',
le: '小於等於',
lt: '小於',
len_eq: '長度等於',
len_ge: '長度大於等於',
len_gt: '長度大於',
len_le: '長度小於等於',
len_lt: '長度小於',
is_true: '為真',
is_not_true: '不為真',
regex: '正則匹配',
wildcard: '通配符匹配',
},
SystemPromptPlaceholder: '系統提示詞,可以引用系統中的變量:如',
UserPromptPlaceholder: '用戶提示詞,可以引用系統中的變量:如',
initiator: '發起人',
abnormalInformation: '異常信息',
}