workflow.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. const translation = {
  2. common: {
  3. editing: 'Editing',
  4. autoSaved: 'Auto-Saved',
  5. unpublished: 'Unpublished',
  6. published: 'Published',
  7. publish: 'Publish',
  8. update: 'Update',
  9. run: 'Run',
  10. running: 'Running',
  11. inRunMode: 'In Run Mode',
  12. inPreview: 'In Preview',
  13. inPreviewMode: 'In Preview Mode',
  14. preview: 'Preview',
  15. viewRunHistory: 'View run history',
  16. runHistory: 'Run History',
  17. goBackToEdit: 'Go back to editor',
  18. conversationLog: 'Conversation Log',
  19. features: 'Features',
  20. debugAndPreview: 'Debug and Preview',
  21. restart: 'Restart',
  22. currentDraft: 'Current Draft',
  23. currentDraftUnpublished: 'Current Draft Unpublished',
  24. latestPublished: 'Latest Published',
  25. publishedAt: 'Published',
  26. restore: 'Restore',
  27. runApp: 'Run App',
  28. batchRunApp: 'Batch Run App',
  29. accessAPIReference: 'Access API Reference',
  30. embedIntoSite: 'Embed Into Site',
  31. addTitle: 'Add title...',
  32. addDescription: 'Add description...',
  33. noVar: 'No variable',
  34. searchVar: 'Search variable',
  35. variableNamePlaceholder: 'Variable name',
  36. setVarValuePlaceholder: 'Set variable',
  37. needConnecttip: 'This step is not connected to anything',
  38. maxTreeDepth: 'Maximum limit of {{depth}} nodes per branch',
  39. needEndNode: 'The End block must be added',
  40. needAnswerNode: 'The Answer block must be added',
  41. workflowProcess: 'Workflow Process',
  42. notRunning: 'Not running yet',
  43. previewPlaceholder: 'Enter content in the box below to start debugging the Chatbot',
  44. effectVarConfirm: {
  45. title: 'Remove Variable',
  46. content: 'The variable is used in other nodes. Do you still want to remove it?',
  47. },
  48. insertVarTip: 'Press the \'/\' key to insert quickly',
  49. },
  50. errorMsg: {
  51. fieldRequired: '{{field}} is required',
  52. authRequired: 'Authorization is required',
  53. invalidJson: '{{field}} is invalid JSON',
  54. fields: {
  55. variable: 'Variable Name',
  56. variableValue: 'Variable Value',
  57. code: 'Code',
  58. model: 'Model',
  59. rerankModel: 'Rerank Model',
  60. },
  61. invalidVariable: 'Invalid variable',
  62. },
  63. singleRun: {
  64. testRun: 'Test Run ',
  65. startRun: 'Start Run',
  66. running: 'Running',
  67. },
  68. tabs: {
  69. 'searchBlock': 'Search block',
  70. 'blocks': 'Blocks',
  71. 'builtInTool': 'Built-in Tool',
  72. 'customTool': 'Custom Tool',
  73. 'question-understand': 'Question Understand',
  74. 'logic': 'Logic',
  75. 'transform': 'Transform',
  76. 'utilities': 'Utilities',
  77. 'noResult': 'No match found',
  78. },
  79. blocks: {
  80. 'start': 'Start',
  81. 'end': 'End',
  82. 'answer': 'Answer',
  83. 'llm': 'LLM',
  84. 'knowledge-retrieval': 'Knowledge Retrieval',
  85. 'question-classifier': 'Question Classifier',
  86. 'if-else': 'IF/ELSE',
  87. 'code': 'Code',
  88. 'template-transform': 'Template',
  89. 'http-request': 'HTTP Request',
  90. 'variable-assigner': 'Variable Assigner',
  91. },
  92. blocksAbout: {
  93. 'start': 'Define the initial parameters for launching a workflow',
  94. 'end': 'Define the end and result type of a workflow',
  95. 'answer': 'Define the reply content of a chat conversation',
  96. 'llm': 'Invoking large language models to answer questions or process natural language',
  97. 'knowledge-retrieval': 'Allows you to query text content related to user questions from the Knowledge',
  98. 'question-classifier': 'Define the classification conditions of user questions, LLM can define how the conversation progresses based on the classification description',
  99. 'if-else': 'Allows you to split the workflow into two branches based on if/else conditions',
  100. 'code': 'Execute a piece of Python or NodeJS code to implement custom logic',
  101. 'template-transform': 'Convert data to string using Jinja template syntax',
  102. 'http-request': 'Allow server requests to be sent over the HTTP protocol',
  103. 'variable-assigner': 'Assign variables in different branches to the same variable to achieve unified configuration of post-nodes',
  104. },
  105. operator: {
  106. zoomIn: 'Zoom In',
  107. zoomOut: 'Zoom Out',
  108. zoomTo50: 'Zoom to 50%',
  109. zoomTo100: 'Zoom to 100%',
  110. zoomToFit: 'Zoom to Fit',
  111. },
  112. panel: {
  113. userInputField: 'User Input Field',
  114. changeBlock: 'Change Block',
  115. helpLink: 'Help Link',
  116. about: 'About',
  117. createdBy: 'Created By ',
  118. nextStep: 'Next Step',
  119. addNextStep: 'Add the next block in this workflow',
  120. selectNextStep: 'Select Next Block',
  121. runThisStep: 'Run this step',
  122. checklist: 'Checklist',
  123. checklistTip: 'Make sure all issues are resolved before publishing',
  124. checklistResolved: 'All issues are resolved',
  125. organizeBlocks: 'Organize blocks',
  126. change: 'Change',
  127. },
  128. nodes: {
  129. common: {
  130. outputVars: 'Output Variables',
  131. insertVarTip: 'Insert Variable',
  132. memory: {
  133. memory: 'Memory',
  134. memoryTip: 'Chat memory settings',
  135. windowSize: 'Window Size',
  136. conversationRoleName: 'Conversation Role Name',
  137. user: 'User prefix',
  138. assistant: 'Assistant prefix',
  139. },
  140. memories: {
  141. title: 'Memories',
  142. tip: 'Chat memory',
  143. builtIn: 'Built-in',
  144. },
  145. },
  146. start: {
  147. required: 'required',
  148. inputField: 'Input Field',
  149. builtInVar: 'Built-in Variables',
  150. outputVars: {
  151. query: 'User input',
  152. memories: {
  153. des: 'Conversation history',
  154. type: 'message type',
  155. content: 'message content',
  156. },
  157. files: 'File list',
  158. },
  159. noVarTip: 'Set inputs that can be used in the Workflow',
  160. },
  161. end: {
  162. outputs: 'Outputs',
  163. output: {
  164. type: 'output type',
  165. variable: 'output variable',
  166. },
  167. type: {
  168. 'none': 'None',
  169. 'plain-text': 'Plain Text',
  170. 'structured': 'Structured',
  171. },
  172. },
  173. answer: {
  174. answer: 'Answer',
  175. outputVars: 'Output Variables',
  176. },
  177. llm: {
  178. model: 'model',
  179. variables: 'variables',
  180. context: 'context',
  181. contextTooltip: 'You can import Knowledge as context',
  182. notSetContextInPromptTip: 'To enable the context feature, please fill in the context variable in PROMPT.',
  183. prompt: 'prompt',
  184. roleDescription: {
  185. system: 'Give high level instructions for the conversation',
  186. user: 'Provide instructions, queries, or any text-based input to the model',
  187. assistant: 'The model’s responses based on the user messages',
  188. },
  189. addMessage: 'Add Message',
  190. vision: 'vision',
  191. files: 'Files',
  192. resolution: {
  193. name: 'Resolution',
  194. high: 'High',
  195. low: 'Low',
  196. },
  197. outputVars: {
  198. output: 'Generate content',
  199. usage: 'Model Usage Information',
  200. },
  201. singleRun: {
  202. variable: 'Variable',
  203. },
  204. },
  205. knowledgeRetrieval: {
  206. queryVariable: 'Query Variable',
  207. knowledge: 'Knowledge',
  208. outputVars: {
  209. output: 'Retrieval segmented data',
  210. content: 'Segmented content',
  211. title: 'Segmented title',
  212. icon: 'Segmented icon',
  213. url: 'Segmented URL',
  214. metadata: 'Other metadata',
  215. },
  216. },
  217. http: {
  218. inputVars: 'Input Variables',
  219. api: 'API',
  220. apiPlaceholder: 'Enter URL, type ‘/’ insert variable',
  221. notStartWithHttp: 'API should start with http:// or https://',
  222. key: 'Key',
  223. value: 'Value',
  224. bulkEdit: 'Bulk Edit',
  225. keyValueEdit: 'Key-Value Edit',
  226. headers: 'Headers',
  227. params: 'Params',
  228. body: 'Body',
  229. outputVars: {
  230. body: 'Response Content',
  231. statusCode: 'Response Status Code',
  232. headers: 'Response Header List JSON',
  233. files: 'Files List',
  234. },
  235. authorization: {
  236. 'authorization': 'Authorization',
  237. 'authorizationType': 'Authorization Type',
  238. 'no-auth': 'None',
  239. 'api-key': 'API-Key',
  240. 'auth-type': 'Auth Type',
  241. 'basic': 'Basic',
  242. 'bearer': 'Bearer',
  243. 'custom': 'Custom',
  244. 'api-key-title': 'API Key',
  245. 'header': 'Header',
  246. },
  247. insertVarPlaceholder: 'type \'/\' to insert variable',
  248. },
  249. code: {
  250. inputVars: 'Input Variables',
  251. outputVars: 'Output Variables',
  252. },
  253. templateTransform: {
  254. inputVars: 'Input Variables',
  255. code: 'Code',
  256. codeSupportTip: 'Only supports Jinja2',
  257. outputVars: {
  258. output: 'Transformed content',
  259. },
  260. },
  261. ifElse: {
  262. if: 'If',
  263. else: 'Else',
  264. elseDescription: 'Used to define the logic that should be executed when the if condition is not met.',
  265. and: 'and',
  266. or: 'or',
  267. operator: 'Operator',
  268. notSetVariable: 'Please set variable first',
  269. comparisonOperator: {
  270. 'contains': 'contains',
  271. 'not contains': 'not contains',
  272. 'start with': 'start with',
  273. 'end with': 'end with',
  274. 'is': 'is',
  275. 'is not': 'is not',
  276. 'empty': 'is empty',
  277. 'not empty': 'is not empty',
  278. 'null': 'is null',
  279. 'not null': 'is not null',
  280. },
  281. enterValue: 'Enter value',
  282. addCondition: 'Add Condition',
  283. conditionNotSetup: 'Condition NOT setup',
  284. },
  285. variableAssigner: {
  286. title: 'Assign variables',
  287. outputType: 'Output Type',
  288. outputVarType: 'Output Variable Type',
  289. varNotSet: 'Variable not set',
  290. noVarTip: 'Add the variables to be assigned',
  291. type: {
  292. string: 'String',
  293. number: 'Number',
  294. object: 'Object',
  295. array: 'Array',
  296. },
  297. outputVars: {
  298. output: 'Assigned variable value',
  299. },
  300. },
  301. tool: {
  302. toAuthorize: 'To authorize',
  303. inputVars: 'Input Variables',
  304. outputVars: {
  305. text: 'tool generated content',
  306. files: {
  307. title: 'tool generated files',
  308. type: 'Support type. Now only support image',
  309. transfer_method: 'Transfer method.Value is remote_url or local_file',
  310. url: 'Image url',
  311. upload_file_id: 'Upload file id',
  312. },
  313. },
  314. },
  315. questionClassifiers: {
  316. model: 'model',
  317. inputVars: 'Input Variables',
  318. class: 'Class',
  319. classNamePlaceholder: 'Write your class name',
  320. advancedSetting: 'Advanced Setting',
  321. topicName: 'Topic Name',
  322. topicPlaceholder: 'Write your topic name',
  323. addClass: 'Add Class',
  324. instruction: 'Instruction',
  325. instructionPlaceholder: 'Write your instruction',
  326. },
  327. },
  328. tracing: {
  329. stopBy: 'Stop by {{user}}',
  330. },
  331. }
  332. export default translation