workflow.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. const translation = {
  2. common: {
  3. undo: 'Undo',
  4. redo: 'Redo',
  5. editing: 'Editing',
  6. autoSaved: 'Auto-Saved',
  7. unpublished: 'Unpublished',
  8. published: 'Published',
  9. publish: 'Publish',
  10. update: 'Update',
  11. run: 'Run',
  12. running: 'Running',
  13. inRunMode: 'In Run Mode',
  14. inPreview: 'In Preview',
  15. inPreviewMode: 'In Preview Mode',
  16. preview: 'Preview',
  17. viewRunHistory: 'View run history',
  18. runHistory: 'Run History',
  19. goBackToEdit: 'Go back to editor',
  20. conversationLog: 'Conversation Log',
  21. features: 'Features',
  22. debugAndPreview: 'Preview',
  23. restart: 'Restart',
  24. currentDraft: 'Current Draft',
  25. currentDraftUnpublished: 'Current Draft Unpublished',
  26. latestPublished: 'Latest Published',
  27. publishedAt: 'Published',
  28. restore: 'Restore',
  29. runApp: 'Run App',
  30. batchRunApp: 'Batch Run App',
  31. accessAPIReference: 'Access API Reference',
  32. embedIntoSite: 'Embed Into Site',
  33. addTitle: 'Add title...',
  34. addDescription: 'Add description...',
  35. noVar: 'No variable',
  36. searchVar: 'Search variable',
  37. variableNamePlaceholder: 'Variable name',
  38. setVarValuePlaceholder: 'Set variable',
  39. needConnectTip: 'This step is not connected to anything',
  40. maxTreeDepth: 'Maximum limit of {{depth}} nodes per branch',
  41. needEndNode: 'The End block must be added',
  42. needAnswerNode: 'The Answer block must be added',
  43. workflowProcess: 'Workflow Process',
  44. notRunning: 'Not running yet',
  45. previewPlaceholder: 'Enter content in the box below to start debugging the Chatbot',
  46. effectVarConfirm: {
  47. title: 'Remove Variable',
  48. content: 'The variable is used in other nodes. Do you still want to remove it?',
  49. },
  50. insertVarTip: 'Press the \'/\' key to insert quickly',
  51. processData: 'Process Data',
  52. input: 'Input',
  53. output: 'Output',
  54. jinjaEditorPlaceholder: 'Type \'/\' or \'{\' to insert variable',
  55. viewOnly: 'View Only',
  56. showRunHistory: 'Show Run History',
  57. enableJinja: 'Enable Jinja template support',
  58. learnMore: 'Learn More',
  59. copy: 'Copy',
  60. duplicate: 'Duplicate',
  61. addBlock: 'Add Block',
  62. pasteHere: 'Paste Here',
  63. pointerMode: 'Pointer Mode',
  64. handMode: 'Hand Mode',
  65. model: 'Model',
  66. workflowAsTool: 'Workflow as Tool',
  67. configureRequired: 'Configure Required',
  68. configure: 'Configure',
  69. manageInTools: 'Manage in Tools',
  70. workflowAsToolTip: 'Tool reconfiguration is required after the workflow update.',
  71. viewDetailInTracingPanel: 'View details',
  72. syncingData: 'Syncing data, just a few seconds.',
  73. importDSL: 'Import DSL',
  74. importDSLTip: 'Current draft will be overwritten. Export workflow as backup before importing.',
  75. backupCurrentDraft: 'Backup Current Draft',
  76. chooseDSL: 'Choose DSL(yml) file',
  77. overwriteAndImport: 'Overwrite and Import',
  78. importFailure: 'Import failure',
  79. importSuccess: 'Import success',
  80. },
  81. env: {
  82. envPanelTitle: 'Environment Variables',
  83. envDescription: 'Environment variables can be used to store private information and credentials. They are read-only and can be separated from the DSL file during export.',
  84. envPanelButton: 'Add Variable',
  85. modal: {
  86. title: 'Add Environment Variable',
  87. editTitle: 'Edit Environment Variable',
  88. type: 'Type',
  89. name: 'Name',
  90. namePlaceholder: 'env name',
  91. value: 'Value',
  92. valuePlaceholder: 'env value',
  93. secretTip: 'Used to define sensitive information or data, with DSL settings configured for leak prevention.',
  94. },
  95. export: {
  96. title: 'Export Secret environment variables?',
  97. checkbox: 'Export secret values',
  98. ignore: 'Export DSL',
  99. export: 'Export DSL with secret values ',
  100. },
  101. },
  102. chatVariable: {
  103. panelTitle: 'Conversation Variables',
  104. panelDescription: 'Conversation Variables are used to store interactive information that LLM needs to remember, including conversation history, uploaded files, user preferences. They are read-write. ',
  105. docLink: 'Visit our docs to learn more.',
  106. button: 'Add Variable',
  107. modal: {
  108. title: 'Add Conversation Variable',
  109. editTitle: 'Edit Conversation Variable',
  110. name: 'Name',
  111. namePlaceholder: 'Variable name',
  112. type: 'Type',
  113. value: 'Default Value',
  114. valuePlaceholder: 'Default value, leave blank to not set',
  115. description: 'Description',
  116. descriptionPlaceholder: 'Describe the variable',
  117. editInJSON: 'Edit in JSON',
  118. oneByOne: 'Add one by one',
  119. editInForm: 'Edit in Form',
  120. arrayValue: 'Value',
  121. addArrayValue: 'Add Value',
  122. objectKey: 'Key',
  123. objectType: 'Type',
  124. objectValue: 'Default Value',
  125. },
  126. storedContent: 'Stored content',
  127. updatedAt: 'Updated at ',
  128. },
  129. changeHistory: {
  130. title: 'Change History',
  131. placeholder: 'You haven\'t changed anything yet',
  132. clearHistory: 'Clear History',
  133. hint: 'Hint',
  134. hintText: 'Your editing actions are tracked in a change history, which is stored on your device for the duration of this session. This history will be cleared when you leave the editor.',
  135. stepBackward_one: '{{count}} step backward',
  136. stepBackward_other: '{{count}} steps backward',
  137. stepForward_one: '{{count}} step forward',
  138. stepForward_other: '{{count}} steps forward',
  139. sessionStart: 'Session Start',
  140. currentState: 'Current State',
  141. nodeTitleChange: 'Block title changed',
  142. nodeDescriptionChange: 'Block description changed',
  143. nodeDragStop: 'Block moved',
  144. nodeChange: 'Block changed',
  145. nodeConnect: 'Block connected',
  146. nodePaste: 'Block pasted',
  147. nodeDelete: 'Block deleted',
  148. nodeAdd: 'Block added',
  149. nodeResize: 'Block resized',
  150. noteAdd: 'Note added',
  151. noteChange: 'Note changed',
  152. noteDelete: 'Note deleted',
  153. edgeDelete: 'Block disconnected',
  154. },
  155. errorMsg: {
  156. fieldRequired: '{{field}} is required',
  157. authRequired: 'Authorization is required',
  158. invalidJson: '{{field}} is invalid JSON',
  159. fields: {
  160. variable: 'Variable Name',
  161. variableValue: 'Variable Value',
  162. code: 'Code',
  163. model: 'Model',
  164. rerankModel: 'Rerank Model',
  165. },
  166. invalidVariable: 'Invalid variable',
  167. },
  168. singleRun: {
  169. testRun: 'Test Run ',
  170. startRun: 'Start Run',
  171. running: 'Running',
  172. testRunIteration: 'Test Run Iteration',
  173. back: 'Back',
  174. iteration: 'Iteration',
  175. },
  176. tabs: {
  177. 'searchBlock': 'Search block',
  178. 'blocks': 'Blocks',
  179. 'searchTool': 'Search tool',
  180. 'tools': 'Tools',
  181. 'allTool': 'All',
  182. 'builtInTool': 'Built-in',
  183. 'customTool': 'Custom',
  184. 'workflowTool': 'Workflow',
  185. 'question-understand': 'Question Understand',
  186. 'logic': 'Logic',
  187. 'transform': 'Transform',
  188. 'utilities': 'Utilities',
  189. 'noResult': 'No match found',
  190. },
  191. blocks: {
  192. 'start': 'Start',
  193. 'end': 'End',
  194. 'answer': 'Answer',
  195. 'llm': 'LLM',
  196. 'knowledge-retrieval': 'Knowledge Retrieval',
  197. 'question-classifier': 'Question Classifier',
  198. 'if-else': 'IF/ELSE',
  199. 'code': 'Code',
  200. 'template-transform': 'Template',
  201. 'http-request': 'HTTP Request',
  202. 'variable-assigner': 'Variable Aggregator',
  203. 'variable-aggregator': 'Variable Aggregator',
  204. 'assigner': 'Variable Assigner',
  205. 'iteration-start': 'Iteration Start',
  206. 'iteration': 'Iteration',
  207. 'parameter-extractor': 'Parameter Extractor',
  208. },
  209. blocksAbout: {
  210. 'start': 'Define the initial parameters for launching a workflow',
  211. 'end': 'Define the end and result type of a workflow',
  212. 'answer': 'Define the reply content of a chat conversation',
  213. 'llm': 'Invoking large language models to answer questions or process natural language',
  214. 'knowledge-retrieval': 'Allows you to query text content related to user questions from the Knowledge',
  215. 'question-classifier': 'Define the classification conditions of user questions, LLM can define how the conversation progresses based on the classification description',
  216. 'if-else': 'Allows you to split the workflow into two branches based on if/else conditions',
  217. 'code': 'Execute a piece of Python or NodeJS code to implement custom logic',
  218. 'template-transform': 'Convert data to string using Jinja template syntax',
  219. 'http-request': 'Allow server requests to be sent over the HTTP protocol',
  220. 'variable-assigner': 'Aggregate multi-branch variables into a single variable for unified configuration of downstream nodes.',
  221. 'assigner': 'The variable assignment node is used for assigning values to writable variables(like conversation variables).',
  222. 'variable-aggregator': 'Aggregate multi-branch variables into a single variable for unified configuration of downstream nodes.',
  223. 'iteration': 'Perform multiple steps on a list object until all results are outputted.',
  224. 'parameter-extractor': 'Use LLM to extract structured parameters from natural language for tool invocations or HTTP requests.',
  225. },
  226. operator: {
  227. zoomIn: 'Zoom In',
  228. zoomOut: 'Zoom Out',
  229. zoomTo50: 'Zoom to 50%',
  230. zoomTo100: 'Zoom to 100%',
  231. zoomToFit: 'Zoom to Fit',
  232. },
  233. panel: {
  234. userInputField: 'User Input Field',
  235. changeBlock: 'Change Block',
  236. helpLink: 'Help Link',
  237. about: 'About',
  238. createdBy: 'Created By ',
  239. nextStep: 'Next Step',
  240. addNextStep: 'Add the next block in this workflow',
  241. selectNextStep: 'Select Next Block',
  242. runThisStep: 'Run this step',
  243. checklist: 'Checklist',
  244. checklistTip: 'Make sure all issues are resolved before publishing',
  245. checklistResolved: 'All issues are resolved',
  246. organizeBlocks: 'Organize blocks',
  247. change: 'Change',
  248. optional: '(optional)',
  249. },
  250. nodes: {
  251. common: {
  252. outputVars: 'Output Variables',
  253. insertVarTip: 'Insert Variable',
  254. memory: {
  255. memory: 'Memory',
  256. memoryTip: 'Chat memory settings',
  257. windowSize: 'Window Size',
  258. conversationRoleName: 'Conversation Role Name',
  259. user: 'User prefix',
  260. assistant: 'Assistant prefix',
  261. },
  262. memories: {
  263. title: 'Memories',
  264. tip: 'Chat memory',
  265. builtIn: 'Built-in',
  266. },
  267. },
  268. start: {
  269. required: 'required',
  270. inputField: 'Input Field',
  271. builtInVar: 'Built-in Variables',
  272. outputVars: {
  273. query: 'User input',
  274. memories: {
  275. des: 'Conversation history',
  276. type: 'message type',
  277. content: 'message content',
  278. },
  279. files: 'File list',
  280. },
  281. noVarTip: 'Set inputs that can be used in the Workflow',
  282. },
  283. end: {
  284. outputs: 'Outputs',
  285. output: {
  286. type: 'output type',
  287. variable: 'output variable',
  288. },
  289. type: {
  290. 'none': 'None',
  291. 'plain-text': 'Plain Text',
  292. 'structured': 'Structured',
  293. },
  294. },
  295. answer: {
  296. answer: 'Answer',
  297. outputVars: 'Output Variables',
  298. },
  299. llm: {
  300. model: 'model',
  301. variables: 'variables',
  302. context: 'context',
  303. contextTooltip: 'You can import Knowledge as context',
  304. notSetContextInPromptTip: 'To enable the context feature, please fill in the context variable in PROMPT.',
  305. prompt: 'prompt',
  306. roleDescription: {
  307. system: 'Give high level instructions for the conversation',
  308. user: 'Provide instructions, queries, or any text-based input to the model',
  309. assistant: 'The model’s responses based on the user messages',
  310. },
  311. addMessage: 'Add Message',
  312. vision: 'vision',
  313. files: 'Files',
  314. resolution: {
  315. name: 'Resolution',
  316. high: 'High',
  317. low: 'Low',
  318. },
  319. outputVars: {
  320. output: 'Generate content',
  321. usage: 'Model Usage Information',
  322. },
  323. singleRun: {
  324. variable: 'Variable',
  325. },
  326. sysQueryInUser: 'sys.query in user message is required',
  327. },
  328. knowledgeRetrieval: {
  329. queryVariable: 'Query Variable',
  330. knowledge: 'Knowledge',
  331. outputVars: {
  332. output: 'Retrieval segmented data',
  333. content: 'Segmented content',
  334. title: 'Segmented title',
  335. icon: 'Segmented icon',
  336. url: 'Segmented URL',
  337. metadata: 'Other metadata',
  338. },
  339. },
  340. http: {
  341. inputVars: 'Input Variables',
  342. api: 'API',
  343. apiPlaceholder: 'Enter URL, type ‘/’ insert variable',
  344. notStartWithHttp: 'API should start with http:// or https://',
  345. key: 'Key',
  346. value: 'Value',
  347. bulkEdit: 'Bulk Edit',
  348. keyValueEdit: 'Key-Value Edit',
  349. headers: 'Headers',
  350. params: 'Params',
  351. body: 'Body',
  352. outputVars: {
  353. body: 'Response Content',
  354. statusCode: 'Response Status Code',
  355. headers: 'Response Header List JSON',
  356. files: 'Files List',
  357. },
  358. authorization: {
  359. 'authorization': 'Authorization',
  360. 'authorizationType': 'Authorization Type',
  361. 'no-auth': 'None',
  362. 'api-key': 'API-Key',
  363. 'auth-type': 'Auth Type',
  364. 'basic': 'Basic',
  365. 'bearer': 'Bearer',
  366. 'custom': 'Custom',
  367. 'api-key-title': 'API Key',
  368. 'header': 'Header',
  369. },
  370. insertVarPlaceholder: 'type \'/\' to insert variable',
  371. timeout: {
  372. title: 'Timeout',
  373. connectLabel: 'Connection Timeout',
  374. connectPlaceholder: 'Enter connection timeout in seconds',
  375. readLabel: 'Read Timeout',
  376. readPlaceholder: 'Enter read timeout in seconds',
  377. writeLabel: 'Write Timeout',
  378. writePlaceholder: 'Enter write timeout in seconds',
  379. },
  380. },
  381. code: {
  382. inputVars: 'Input Variables',
  383. outputVars: 'Output Variables',
  384. advancedDependencies: 'Advanced Dependencies',
  385. advancedDependenciesTip: 'Add some preloaded dependencies that take more time to consume or are not default built-in here',
  386. searchDependencies: 'Search Dependencies',
  387. },
  388. templateTransform: {
  389. inputVars: 'Input Variables',
  390. code: 'Code',
  391. codeSupportTip: 'Only supports Jinja2',
  392. outputVars: {
  393. output: 'Transformed content',
  394. },
  395. },
  396. ifElse: {
  397. if: 'If',
  398. else: 'Else',
  399. elseDescription: 'Used to define the logic that should be executed when the if condition is not met.',
  400. and: 'and',
  401. or: 'or',
  402. operator: 'Operator',
  403. notSetVariable: 'Please set variable first',
  404. comparisonOperator: {
  405. 'contains': 'contains',
  406. 'not contains': 'not contains',
  407. 'start with': 'start with',
  408. 'end with': 'end with',
  409. 'is': 'is',
  410. 'is not': 'is not',
  411. 'empty': 'is empty',
  412. 'not empty': 'is not empty',
  413. 'null': 'is null',
  414. 'not null': 'is not null',
  415. 'regex match': 'regex match',
  416. },
  417. enterValue: 'Enter value',
  418. addCondition: 'Add Condition',
  419. conditionNotSetup: 'Condition NOT setup',
  420. selectVariable: 'Select variable...',
  421. },
  422. variableAssigner: {
  423. title: 'Assign variables',
  424. outputType: 'Output Type',
  425. varNotSet: 'Variable not set',
  426. noVarTip: 'Add the variables to be assigned',
  427. type: {
  428. string: 'String',
  429. number: 'Number',
  430. object: 'Object',
  431. array: 'Array',
  432. },
  433. aggregationGroup: 'Aggregation Group',
  434. aggregationGroupTip: 'Enabling this feature allows the variable aggregator to aggregate multiple sets of variables.',
  435. addGroup: 'Add Group',
  436. outputVars: {
  437. varDescribe: '{{groupName}} output',
  438. },
  439. setAssignVariable: 'Set assign variable',
  440. },
  441. assigner: {
  442. 'assignedVariable': 'Assigned Variable',
  443. 'writeMode': 'Write Mode',
  444. 'writeModeTip': 'Append mode: Available for array variables only.',
  445. 'over-write': 'Overwrite',
  446. 'append': 'Append',
  447. 'plus': 'Plus',
  448. 'clear': 'Clear',
  449. 'setVariable': 'Set Variable',
  450. 'variable': 'Variable',
  451. },
  452. tool: {
  453. toAuthorize: 'To authorize',
  454. inputVars: 'Input Variables',
  455. outputVars: {
  456. text: 'tool generated content',
  457. files: {
  458. title: 'tool generated files',
  459. type: 'Support type. Now only support image',
  460. transfer_method: 'Transfer method.Value is remote_url or local_file',
  461. url: 'Image url',
  462. upload_file_id: 'Upload file id',
  463. },
  464. json: 'tool generated json',
  465. },
  466. },
  467. questionClassifiers: {
  468. model: 'model',
  469. inputVars: 'Input Variables',
  470. outputVars: {
  471. className: 'Class Name',
  472. },
  473. class: 'Class',
  474. classNamePlaceholder: 'Write your class name',
  475. advancedSetting: 'Advanced Setting',
  476. topicName: 'Topic Name',
  477. topicPlaceholder: 'Write your topic name',
  478. addClass: 'Add Class',
  479. instruction: 'Instruction',
  480. instructionTip: 'Input additional instructions to help the question classifier better understand how to categorize questions.',
  481. instructionPlaceholder: 'Write your instruction',
  482. },
  483. parameterExtractor: {
  484. inputVar: 'Input Variable',
  485. extractParameters: 'Extract Parameters',
  486. importFromTool: 'Import from tools',
  487. addExtractParameter: 'Add Extract Parameter',
  488. addExtractParameterContent: {
  489. name: 'Name',
  490. namePlaceholder: 'Extract Parameter Name',
  491. type: 'Type',
  492. typePlaceholder: 'Extract Parameter Type',
  493. description: 'Description',
  494. descriptionPlaceholder: 'Extract Parameter Description',
  495. required: 'Required',
  496. requiredContent: 'Required is only used as a reference for model inference, and not for mandatory validation of parameter output.',
  497. },
  498. extractParametersNotSet: 'Extract Parameters not setup',
  499. instruction: 'Instruction',
  500. instructionTip: 'Input additional instructions to help the parameter extractor understand how to extract parameters.',
  501. advancedSetting: 'Advanced Setting',
  502. reasoningMode: 'Reasoning Mode',
  503. reasoningModeTip: 'You can choose the appropriate reasoning mode based on the model\'s ability to respond to instructions for function calling or prompts.',
  504. isSuccess: 'Is Success.On success the value is 1, on failure the value is 0.',
  505. errorReason: 'Error Reason',
  506. },
  507. iteration: {
  508. deleteTitle: 'Delete Iteration Node?',
  509. deleteDesc: 'Deleting the iteration node will delete all child nodes',
  510. input: 'Input',
  511. output: 'Output Variables',
  512. iteration_one: '{{count}} Iteration',
  513. iteration_other: '{{count}} Iterations',
  514. currentIteration: 'Current Iteration',
  515. },
  516. note: {
  517. addNote: 'Add Note',
  518. editor: {
  519. placeholder: 'Write your note...',
  520. small: 'Small',
  521. medium: 'Medium',
  522. large: 'Large',
  523. bold: 'Bold',
  524. italic: 'Italic',
  525. strikethrough: 'Strikethrough',
  526. link: 'Link',
  527. openLink: 'Open',
  528. unlink: 'Unlink',
  529. enterUrl: 'Enter URL...',
  530. invalidUrl: 'Invalid URL',
  531. bulletList: 'Bullet List',
  532. showAuthor: 'Show Author',
  533. },
  534. },
  535. },
  536. tracing: {
  537. stopBy: 'Stop by {{user}}',
  538. },
  539. }
  540. export default translation