-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathworkflow.ts
More file actions
558 lines (555 loc) · 20.1 KB
/
Copy pathworkflow.ts
File metadata and controls
558 lines (555 loc) · 20.1 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
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
export default {
node: 'Node',
nodeName: 'Node Name',
baseComponent: 'Basic',
nodeSetting: 'Node Settings',
workflow: 'Workflow',
knowledgeWorkflow: 'Knowledge Workflow',
info: {
previewVersion: 'Preview Version:',
saveTime: 'Last Saved:',
},
operation: {
toImportDoc: 'Go to Import Documents',
importWorkflow: 'Import Workflow',
exportWorkflow: 'Export Workflow',
},
setting: {
restoreVersion: 'Restore Previous Version"',
restoreCurrentVersion: 'Restore to This Version',
addComponent: 'Add',
releaseHistory: 'Release History',
autoSave: 'Auto Save',
latestRelease: 'Latest Release',
copyParam: 'Copy Parameters',
debug: 'Run',
exit: 'Exit',
exitSave: 'Save & Exit',
templateCenter: 'Template Center',
},
tip: {
noData: 'No related results found',
nameMessage: 'Name cannot be empty!',
onlyRight: 'Connections can only be made from the right anchor',
notRecyclable: 'Loop connections are not allowed',
onlyLeft: 'Connections can only be made to the left anchor',
applicationNodeError: 'This agent is unavailable',
toolNodeError: 'This tool node is unavailable',
repeatedNodeError: 'A node with this name already exists',
cannotCopy: 'Cannot be copied',
copyError: 'Node already copied',
paramErrorMessage: 'Parameter already exists: ',
saveMessage: 'Current changes have not been saved. Save before exiting?',
searchPlaceholder: 'Please enter node name',
disabled: 'The node has been disabled',
},
delete: {
confirmTitle: 'Confirm to delete this node?',
deleteMessage: 'This node cannot be deleted',
},
control: {
zoomOut: 'Zoom Out',
zoomIn: 'Zoom In',
fitView: 'Fit to Screen',
retract: 'Collapse All',
extend: 'Expand All',
beautify: 'Auto-Arrange',
},
variable: {
global: 'Global Variable',
chat: 'Chat Variable',
Referencing: 'Referenced Variable',
ReferencingRequired: 'Referenced variable is required',
ReferencingError: 'Invalid referenced variable',
NoReferencing: 'Referenced variable does not exist',
placeholder_key: 'Enter key',
placeholder: 'Please select a variable',
inputPlaceholder: 'Please enter variable',
loop: 'Loop Variable',
},
condition: {
title: 'Execution Condition',
front: 'Precondition',
AND: 'All',
OR: 'Any',
text: 'After the connected node is executed, execute the current node',
},
validate: {
startNodeRequired: 'Start node is required',
startNodeOnly: 'Only one start node is allowed',
baseNodeRequired: 'Base information node is required',
baseNodeOnly: 'Only one base information node is allowed',
notInWorkFlowNode: 'Node not in workflow',
noNextNode: 'Next node does not exist',
nodeUnavailable: 'Node unavailable',
needConnect1: 'The branch of the node needs to be connected',
cannotEndNode: 'This node cannot be used as an end node',
loopNodeBreakNodeRequired: 'Wireless loop must have a Break node',
},
nodes: {
toolWorlflowNode: {
label: 'Workflow Tool',
text: 'Workflow Tool',
},
knowledgeWriteNode: {
label: 'Knowledge write',
text: 'Write the input paragraph list into the current knowledge base and complete vectorization processing',
},
dataSourceWebNode: {
label: 'Web Site',
text: 'Input the root URL to automatically crawl web data (single link corresponds to a single document), output a list of documents with content',
field_label: 'Document list',
},
dataSourceLocalNode: {
label: 'Local File',
text: 'Upload local documents, output document list (content not parsed, needs to be used with "Document Content Extraction" node to parse)',
fileList: 'File List',
fileFormat: {
label: 'Supported File Formats',
requiredMessage: 'Please select file formats',
},
maxFileNumber: {
label: 'Maximum Number of Files per Upload',
},
maxFileCountNumber: {
label: 'Maximum Size per File (MB)',
},
},
classify: {
aiCapability: 'AI capability',
businessLogic: 'Business logic',
dataProcessing: 'Data Processing',
},
startNode: {
label: 'Start',
question: 'User Question',
currentTime: 'Current Time',
},
baseNode: {
visibilitySetting: {
label: 'Visibility Setting',
showCondition: 'Show Condition',
hideCondition: 'Hide Condition',
},
fileUpload: {
label: 'File Upload',
tooltip: 'When enabled, the Q&A page will display a file upload button.',
},
FileUploadSetting: {
title: 'File Upload Settings',
maxFiles: 'Maximum number of files per upload',
fileLimit: 'Maximum size per file (MB)',
fileUploadType: {
label: 'File types allowed for upload',
documentText: 'Requires "Document Content Extraction" node to parse document content',
imageText: 'Requires "Image Understanding" node to parse image content',
videoText: 'Requires "Video Understanding" node to parse video content',
audioText: 'Requires "Speech-to-Text" node to parse audio content',
uploadMethod: 'Upload Method',
},
},
},
KnowledgeBaseNode: {
DocumentSetting: 'Document Processing Setting',
},
aiChatNode: {
label: 'AI Chat',
text: 'Chat with an AI model',
answer: 'AI Content',
returnContent: {
label: 'Return Content',
tooltip: `If turned off, the content of this node will not be output to the user.
If you want the user to see the output of this node, please turn on the switch.`,
},
defaultPrompt: 'Known Information',
think: 'Thinking Process',
historyMessage: 'Historical chat records',
},
searchKnowledgeNode: {
label: 'Knowledge Retrieval',
text: 'Allows you to query text content related to user questions from the Knowledge',
paragraph_list: 'List of retrieved segments',
is_hit_handling_method_list: 'List of segments that meet direct response criteria',
result: 'Search Result',
directly_return: 'Content of segments that meet direct response criteria',
searchParam: 'Retrieval Parameters',
showKnowledge: {
label: 'Results are displayed in the knowledge source',
requiredMessage: 'Please set parameters',
},
searchQuestion: {
label: 'Question',
placeholder: 'Please select a search question',
requiredMessage: 'Please select a search question',
},
},
searchDocumentNode: {
label: 'Document Tag Retrieval',
text: 'Search for documents that meet the conditions based on the document label within the specified search scope',
selectKnowledge: 'Search Scope',
searchSetting: 'Search Settings',
custom: 'Manual',
customTooltip: 'Manually set tag filtering conditions',
auto: 'Automatic',
autoTooltip: 'Automatically filter setting tag conditions based on the search question',
documentList: 'Document List',
knowledgeList: 'Knowledge Base List',
result: 'Search Results',
searchParam: 'Search Parameters',
select_variable: 'Select Variable',
valueMessage: 'Value or name',
searchQuestion: {
label: 'Search Question',
placeholder: 'Please select a search question',
requiredMessage: 'Please select a search question',
},
},
questionNode: {
label: 'Question Optimization',
text: 'Optimize and improve the current question based on historical chat records to better match knowledge segments',
result: 'Optimized Question Result',
systemDefault: `#Role
You are a master of problem optimization, adept at accurately inferring user intentions based on context and optimizing the questions raised by users.
##Skills
###Skill 1: Optimizing Problems
1. Receive user input questions.
2. Carefully analyze the meaning of the problem based on the context.
3. Output optimized problems.
##Limitations:
-Only return the optimized problem without any additional explanation or clarification.
-Ensure that the optimized problem accurately reflects the original problem intent and does not alter the original intention.`,
},
conditionNode: {
label: 'Conditional Branch',
text: 'Trigger different nodes based on conditions',
branch_name: 'Branch Name',
conditions: {
label: 'Conditions',
info: 'Meets the following',
requiredMessage: 'Please select conditions',
},
valueMessage: 'Please enter a value',
addCondition: 'Add Condition',
addBranch: 'Add Branch',
},
replyNode: {
label: 'Specified Reply',
text: 'Specify reply content, referenced variables will be converted to strings for output',
replyContent: 'Reply Content',
},
rerankerNode: {
label: 'Multi-path Recall',
text: 'Use a re-ranking model to refine retrieval results from multiple knowledge sources',
result_list: 'Re-ranked Results List',
result: 'Re-ranking Result',
rerankerContent: {
label: 'Re-ranking Content',
requiredMessage: 'Please select re-ranking content',
},
higher: 'Higher',
ScoreTooltip: 'The higher the Score, the stronger the relevance.',
max_paragraph_char_number: 'Maximum Character',
reranker_model: {
label: 'Rerank',
placeholder: 'Please select a rerank',
},
},
formNode: {
label: 'Form Input',
text: 'Collect user input during Q&A and use it in subsequent processes',
form_content_format1: 'Hello, please fill out the form below:',
form_content_format2: 'Click the [Submit] button after filling it out.',
form_data: 'All Form Content',
formContent: {
label: 'Form Output Content',
requiredMessage:
'Please set the output content of this node, { form } is a placeholder for the form.',
tooltip: 'Define the output content of this node. { form } is a placeholder for the form',
},
formAllContent: 'All Form Content',
formSetting: 'Form Configuration',
},
documentExtractNode: {
label: 'Document Content Extraction',
text: 'Parse input documents to output structured document content',
content: 'Document Content',
},
documentSplitNode: {
label: 'Document Splitting',
text: 'Split input document content according to the segmentation strategy, output a list of segmented texts',
paragraphList: 'List of split segments',
splitStrategy: {
label: 'Splitting Strategy',
placeholder: 'Please select a splitting strategy',
requiredMessage: 'Please select a splitting strategy',
},
chunk_length: {
label: 'Chunk length',
tooltip1: 'Core objective is to balance retrieval precision and recall efficiency',
tooltip2:
'Avoid excessively short segmentation: A single segment <50 characters may lead to semantic fragmentation, potentially failing to match query intent during retrieval due to lack of context.',
tooltip3:
'Avoid excessive segmentation: A single block exceeding 500 characters increases redundant information, reduces retrieval accuracy, and consumes more storage and computing resources.',
},
title1: 'Segment title set as the associated question of the segment',
title2: 'Document name set as the associated question of the segment',
},
imageUnderstandNode: {
label: 'Image Understanding',
text: 'Analyze images to identify objects, scenes, and provide answers',
answer: 'AI Content',
model: {
label: 'Vision Model',
requiredMessage: 'Please select a vision model',
},
image: {
label: 'Select Image',
requiredMessage: 'Please select an image',
},
},
videoUnderstandNode: {
label: 'Video Understanding',
text: 'Identify objects, scenes, and other information in videos to answer user questions',
answer: 'AI Response Content',
model: {
label: 'Vision Model',
requiredMessage: 'Please select a vision model',
},
video: {
label: 'Select Video',
requiredMessage: 'Please select a video',
},
},
variableAssignNode: {
label: 'Variable Assign',
text: 'Update the value of the global variable',
assign: 'Set Value',
},
variableAggregationNode: {
label: 'Variable Aggregation',
text: 'Aggregate variables of each group according to the aggregation strategy',
Strategy: 'Aggregation Strategy',
placeholder: 'Return the first non-null value of each group',
placeholder1: 'Return the array of variables for each group',
placeholder2: 'Return the dict of variables for each group',
group: {
noneError: 'Name cannot be empty',
dupError: 'Name cannot be duplicated',
},
addGroup: 'Add Group',
editGroup: 'Edit Group',
},
mcpNode: {
label: 'MCP Call',
text: 'Call external MCP services to process data',
getToolsSuccess: 'Tools fetched successfully',
getTool: 'Fetch Tools',
toolParam: 'Tool Parameters',
mcpServerTip: 'Please enter MCP server configuration in JSON format',
mcpToolTip: 'Please select a tool',
configLabel: 'MCP Server Config (Only SSE/Streamable HTTP calls are supported)',
reference: 'Reference MCP',
},
imageGenerateNode: {
label: 'Image Generation',
text: 'Generate images based on provided text content',
answer: 'AI Content',
model: {
label: 'Image Generation Model',
requiredMessage: 'Please select an image generation model',
},
prompt: {
label: 'Positive Prompt',
tooltip: 'Describe elements and visual features you want in the generated image',
},
negative_prompt: {
label: 'Negative Prompt',
tooltip: 'Describe elements you want to exclude from the generated image',
placeholder:
'Please describe content you do not want to generate, such as color, bloody content',
},
},
textToVideoGenerate: {
label: 'Text-to-Video',
text: 'Generate video based on provided text content',
answer: 'AI Response Content',
model: {
label: 'Text-to-Video Model',
requiredMessage: 'Please select a text-to-video model',
},
prompt: {
label: 'Prompt (Positive)',
tooltip:
'Positive prompt, used to describe elements and visual features expected in the generated video',
},
negative_prompt: {
label: 'Prompt (Negative)',
tooltip:
"Negative prompt, used to describe content you don't want to see in the video, which can restrict the video generation",
placeholder:
"Please describe video content you don't want to generate, such as: colors, bloody content",
},
},
imageToVideoGenerate: {
label: 'Image-to-Video',
text: 'Generate video based on provided images',
answer: 'AI Response Content',
model: {
label: 'Image-to-Video Model',
requiredMessage: 'Please select an image-to-video model',
},
prompt: {
label: 'Prompt (Positive)',
tooltip:
'Positive prompt, used to describe elements and visual features expected in the generated video',
},
negative_prompt: {
label: 'Prompt (Negative)',
tooltip:
"Negative prompt, used to describe content you don't want to see in the video, which can restrict the video generation",
placeholder:
"Please describe video content you don't want to generate, such as: colors, bloody content",
},
first_frame: {
label: 'First Frame Image',
requiredMessage: 'Please select the first frame image',
},
last_frame: {
label: 'Last Frame Image',
requiredMessage: 'Please select the last frame image',
},
},
speechToTextNode: {
label: 'Speech2Text',
text: 'Convert audio to text through speech recognition model',
stt_model: {
label: 'Speech Recognition Model',
},
audio: {
label: 'Select Audio File',
placeholder: 'Please select an audio file',
},
},
textToSpeechNode: {
label: 'TTS',
text: 'Convert text to audio through speech synthesis model',
tts_model: {
label: 'Speech Synthesis Model',
},
content: {
label: 'Select Text Content',
},
},
toolNode: {
label: 'Custom Tool',
text: 'Execute custom scripts to achieve data processing',
},
intentNode: {
label: 'IntentNode',
text: 'Match user questions with user-defined intent classifications',
error2: 'Repeated intent',
placeholder: 'Please choose a classification option',
classify: {
label: 'Intent classify',
},
output_reason: 'Output Reason',
input: {
label: 'Input',
},
},
applicationNode: {
label: 'Agent Node',
},
loopNode: {
label: 'Loop',
text: 'Repeat a series of tasks by setting the number of loops and logic',
loopType: {
label: 'Loop Type',
requiredMessage: 'Please select a loop type',
arrayLoop: 'Array Loop',
numberLoop: 'Loop for Specified Times',
infiniteLoop: 'Infinite Loop',
},
loopNumber: {
label: 'Loop Number',
requiredMessage: 'Please enter the number of loops',
},
loopArray: {
label: 'Circular Array',
requiredMessage: 'Circular Array is required',
placeholder: 'Please select a circular array',
},
loopSetting: 'Loop Settings',
loopDetail: 'Loop Details',
},
loopStartNode: {
label: 'Loop Start',
loopIndex: 'Index',
loopItem: 'Loop Element',
},
loopBodyNode: {
label: 'Loop Body',
text: 'Loop Body',
},
loopContinueNode: {
label: 'Continue',
text: 'Used to terminate the current loop and proceed to the next one.',
isContinue: 'Continue',
},
loopBreakNode: {
label: 'Break',
text: 'Terminate the current loop and exit the loop body',
isBreak: 'Break',
},
variableSplittingNode: {
label: 'Variable Splitting',
text: 'By configuring JSON Path expressions, parse and split the input JSON format variable',
result: 'Result',
splitVariables: 'Split Variables',
inputVariables: 'Input Variable',
addVariables: 'Add Variables',
editVariables: 'Edit Variables',
variableListPlaceholder: 'Please add split variables',
expression: {
label: 'Expression',
placeholder: 'Please enter expression',
tooltip:
'Please use JSON Path expressions to split variables, e.g.: $.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">Click for details ➜ pypi.org</a>',
},
},
parameterExtractionNode: {
label: 'Parameter Extraction',
text: 'Use AI models to extract structured parameters',
extractParameters: {
label: 'Extract Parameters',
variableListPlaceholder: 'Please add extraction parameters',
parameterType: 'Parameter Type',
},
},
},
compare: {
is_null: 'Is null',
is_not_null: 'Is not null',
contain: 'Contains',
not_contain: 'Does not contain',
eq: 'Equal to',
not_eq: 'Not equal to',
ge: 'Greater than or equal to',
gt: 'Greater than',
le: 'Less than or equal to',
lt: 'Less than',
len_eq: 'Length equal to',
len_ge: 'Length greater than or equal to',
len_gt: 'Length greater than',
len_le: 'Length less than or equal to',
len_lt: 'Length less than',
is_true: 'Is true',
is_not_true: 'Is not true',
regex: 'Regex matching',
wildcard: 'Wildcard matching',
},
SystemPromptPlaceholder: 'System Prompt, can reference variables in the system, such as',
UserPromptPlaceholder: 'User Prompt, can reference variables in the system, such as',
initiator: 'Iniiator',
abnormalInformation: 'Abnormal Information',
}