固定开头和结尾内容

利用指定回复,创建固定的开头和结尾

固定开头和结尾内容 - 图1

固定开头和结尾内容 - 图2

如上图,可以通过指定回复编排一个固定的开头和结尾内容。

模块编排

复制下面配置,点击「高级编排」右上角的导入按键,导入该配置。

编排配置

  1. {
  2. "nodes": [
  3. {
  4. "nodeId": "7z5g5h",
  5. "name": "流程开始",
  6. "intro": "",
  7. "avatar": "/imgs/workflow/userChatInput.svg",
  8. "flowNodeType": "workflowStart",
  9. "position": {
  10. "x": -269.50851681351924,
  11. "y": 1657.6123698022448
  12. },
  13. "inputs": [
  14. {
  15. "key": "userChatInput",
  16. "renderTypeList": [
  17. "reference",
  18. "textarea"
  19. ],
  20. "valueType": "string",
  21. "label": "问题输入",
  22. "required": true,
  23. "toolDescription": "用户问题",
  24. "type": "systemInput",
  25. "showTargetInApp": false,
  26. "showTargetInPlugin": false,
  27. "connected": false,
  28. "selectedTypeIndex": 0,
  29. "value": [
  30. "7z5g5h",
  31. "userChatInput"
  32. ]
  33. }
  34. ],
  35. "outputs": [
  36. {
  37. "id": "userChatInput",
  38. "type": "static",
  39. "key": "userChatInput",
  40. "valueType": "string",
  41. "label": "core.module.input.label.user question"
  42. }
  43. ]
  44. },
  45. {
  46. "nodeId": "nlfwkc",
  47. "name": "AI 对话",
  48. "intro": "AI 大模型对话",
  49. "avatar": "/imgs/workflow/AI.png",
  50. "flowNodeType": "chatNode",
  51. "showStatus": true,
  52. "position": {
  53. "x": 907.2058332478431,
  54. "y": 1348.9992737142143
  55. },
  56. "inputs": [
  57. {
  58. "key": "model",
  59. "renderTypeList": [
  60. "settingLLMModel",
  61. "reference"
  62. ],
  63. "label": "core.module.input.label.aiModel",
  64. "valueType": "string",
  65. "type": "selectLLMModel",
  66. "required": true,
  67. "showTargetInApp": false,
  68. "showTargetInPlugin": false,
  69. "value": "gpt-3.5-turbo",
  70. "connected": false,
  71. "selectedTypeIndex": 0
  72. },
  73. {
  74. "key": "temperature",
  75. "renderTypeList": [
  76. "hidden"
  77. ],
  78. "label": "",
  79. "value": 0,
  80. "valueType": "number",
  81. "min": 0,
  82. "max": 10,
  83. "step": 1,
  84. "type": "hidden",
  85. "showTargetInApp": false,
  86. "showTargetInPlugin": false,
  87. "connected": false,
  88. "selectedTypeIndex": 0
  89. },
  90. {
  91. "key": "maxToken",
  92. "renderTypeList": [
  93. "hidden"
  94. ],
  95. "label": "",
  96. "value": 2000,
  97. "valueType": "number",
  98. "min": 100,
  99. "max": 4000,
  100. "step": 50,
  101. "type": "hidden",
  102. "showTargetInApp": false,
  103. "showTargetInPlugin": false,
  104. "connected": false,
  105. "selectedTypeIndex": 0
  106. },
  107. {
  108. "key": "isResponseAnswerText",
  109. "renderTypeList": [
  110. "hidden"
  111. ],
  112. "label": "",
  113. "value": true,
  114. "valueType": "boolean",
  115. "type": "hidden",
  116. "showTargetInApp": false,
  117. "showTargetInPlugin": false,
  118. "connected": false,
  119. "selectedTypeIndex": 0
  120. },
  121. {
  122. "key": "quoteTemplate",
  123. "renderTypeList": [
  124. "hidden"
  125. ],
  126. "label": "",
  127. "valueType": "string",
  128. "type": "hidden",
  129. "showTargetInApp": false,
  130. "showTargetInPlugin": false,
  131. "connected": false,
  132. "selectedTypeIndex": 0
  133. },
  134. {
  135. "key": "quotePrompt",
  136. "renderTypeList": [
  137. "hidden"
  138. ],
  139. "label": "",
  140. "valueType": "string",
  141. "type": "hidden",
  142. "showTargetInApp": false,
  143. "showTargetInPlugin": false,
  144. "connected": false,
  145. "selectedTypeIndex": 0
  146. },
  147. {
  148. "key": "systemPrompt",
  149. "renderTypeList": [
  150. "textarea",
  151. "reference"
  152. ],
  153. "max": 300,
  154. "valueType": "string",
  155. "label": "core.ai.Prompt",
  156. "description": "core.app.tip.chatNodeSystemPromptTip",
  157. "placeholder": "core.app.tip.chatNodeSystemPromptTip",
  158. "type": "textarea",
  159. "showTargetInApp": true,
  160. "showTargetInPlugin": true,
  161. "value": "",
  162. "connected": false,
  163. "selectedTypeIndex": 0
  164. },
  165. {
  166. "key": "history",
  167. "renderTypeList": [
  168. "numberInput",
  169. "reference"
  170. ],
  171. "valueType": "chatHistory",
  172. "label": "core.module.input.label.chat history",
  173. "required": true,
  174. "min": 0,
  175. "max": 30,
  176. "value": 6,
  177. "type": "numberInput",
  178. "showTargetInApp": true,
  179. "showTargetInPlugin": true,
  180. "connected": false,
  181. "selectedTypeIndex": 0
  182. },
  183. {
  184. "key": "userChatInput",
  185. "renderTypeList": [
  186. "reference",
  187. "textarea"
  188. ],
  189. "valueType": "string",
  190. "label": "问题输入",
  191. "required": true,
  192. "toolDescription": "用户问题",
  193. "type": "custom",
  194. "showTargetInApp": true,
  195. "showTargetInPlugin": true,
  196. "connected": true,
  197. "selectedTypeIndex": 0,
  198. "value": [
  199. "7z5g5h",
  200. "userChatInput"
  201. ]
  202. },
  203. {
  204. "key": "quoteQA",
  205. "renderTypeList": [
  206. "settingDatasetQuotePrompt"
  207. ],
  208. "label": "",
  209. "debugLabel": "知识库引用",
  210. "description": "core.module.Dataset quote.Input description",
  211. "valueType": "datasetQuote",
  212. "type": "target",
  213. "showTargetInApp": true,
  214. "showTargetInPlugin": true,
  215. "connected": true,
  216. "selectedTypeIndex": 0,
  217. "value": [
  218. "fljhzy",
  219. "quoteQA"
  220. ]
  221. }
  222. ],
  223. "outputs": [
  224. {
  225. "id": "answerText",
  226. "type": "static",
  227. "key": "answerText",
  228. "valueType": "string",
  229. "label": "core.module.output.label.Ai response content",
  230. "description": "core.module.output.description.Ai response content"
  231. },
  232. {
  233. "id": "history",
  234. "type": "static",
  235. "key": "history",
  236. "valueType": "chatHistory",
  237. "label": "core.module.output.label.New context",
  238. "description": "core.module.output.description.New context"
  239. }
  240. ]
  241. },
  242. {
  243. "nodeId": "q9equb",
  244. "name": "core.module.template.App system setting",
  245. "intro": "可以配置应用的系统参数。",
  246. "avatar": "/imgs/workflow/userGuide.png",
  247. "flowNodeType": "userGuide",
  248. "position": {
  249. "x": -275.92529567956024,
  250. "y": 1094.1001488133452
  251. },
  252. "inputs": [
  253. {
  254. "key": "welcomeText",
  255. "renderTypeList": [
  256. "hidden"
  257. ],
  258. "valueType": "string",
  259. "label": "core.app.Welcome Text",
  260. "type": "hidden",
  261. "showTargetInApp": false,
  262. "showTargetInPlugin": false,
  263. "value": "你好,我是电影《星际穿越》 AI 助手,有什么可以帮助你的?\n[导演是谁]\n[剧情介绍]\n[票房分析]",
  264. "connected": false,
  265. "selectedTypeIndex": 0
  266. },
  267. {
  268. "key": "variables",
  269. "renderTypeList": [
  270. "hidden"
  271. ],
  272. "valueType": "any",
  273. "label": "core.module.Variable",
  274. "value": [],
  275. "type": "hidden",
  276. "showTargetInApp": false,
  277. "showTargetInPlugin": false,
  278. "connected": false,
  279. "selectedTypeIndex": 0
  280. },
  281. {
  282. "key": "questionGuide",
  283. "valueType": "boolean",
  284. "renderTypeList": [
  285. "hidden"
  286. ],
  287. "label": "",
  288. "type": "switch",
  289. "showTargetInApp": false,
  290. "showTargetInPlugin": false,
  291. "connected": false,
  292. "selectedTypeIndex": 0
  293. },
  294. {
  295. "key": "tts",
  296. "renderTypeList": [
  297. "hidden"
  298. ],
  299. "valueType": "any",
  300. "label": "",
  301. "type": "hidden",
  302. "showTargetInApp": false,
  303. "showTargetInPlugin": false,
  304. "connected": false,
  305. "selectedTypeIndex": 0
  306. },
  307. {
  308. "key": "whisper",
  309. "renderTypeList": [
  310. "hidden"
  311. ],
  312. "valueType": "any",
  313. "label": ""
  314. },
  315. {
  316. "key": "scheduleTrigger",
  317. "renderTypeList": [
  318. "hidden"
  319. ],
  320. "valueType": "any",
  321. "label": "",
  322. "value": null
  323. }
  324. ],
  325. "outputs": []
  326. },
  327. {
  328. "nodeId": "tc90wz",
  329. "name": "指定回复",
  330. "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
  331. "avatar": "/imgs/workflow/reply.png",
  332. "flowNodeType": "answerNode",
  333. "position": {
  334. "x": 159.49274056478237,
  335. "y": 1621.4635230667668
  336. },
  337. "inputs": [
  338. {
  339. "key": "text",
  340. "renderTypeList": [
  341. "textarea",
  342. "reference"
  343. ],
  344. "valueType": "any",
  345. "label": "core.module.input.label.Response content",
  346. "description": "core.module.input.description.Response content",
  347. "placeholder": "core.module.input.description.Response content",
  348. "type": "textarea",
  349. "showTargetInApp": true,
  350. "showTargetInPlugin": true,
  351. "value": "这是开头\\n",
  352. "connected": false,
  353. "selectedTypeIndex": 0
  354. }
  355. ],
  356. "outputs": []
  357. },
  358. {
  359. "nodeId": "U5T3dMVY4wj7",
  360. "name": "指定回复",
  361. "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
  362. "avatar": "/imgs/workflow/reply.png",
  363. "flowNodeType": "answerNode",
  364. "position": {
  365. "x": 1467.0625486167608,
  366. "y": 1597.346243737531
  367. },
  368. "inputs": [
  369. {
  370. "key": "text",
  371. "renderTypeList": [
  372. "textarea",
  373. "reference"
  374. ],
  375. "valueType": "string",
  376. "label": "core.module.input.label.Response content",
  377. "description": "core.module.input.description.Response content",
  378. "placeholder": "core.module.input.description.Response content",
  379. "value": "这是结尾"
  380. }
  381. ],
  382. "outputs": []
  383. }
  384. ],
  385. "edges": [
  386. {
  387. "source": "7z5g5h",
  388. "target": "tc90wz",
  389. "sourceHandle": "7z5g5h-source-right",
  390. "targetHandle": "tc90wz-target-left"
  391. },
  392. {
  393. "source": "tc90wz",
  394. "target": "nlfwkc",
  395. "sourceHandle": "tc90wz-source-right",
  396. "targetHandle": "nlfwkc-target-left"
  397. },
  398. {
  399. "source": "nlfwkc",
  400. "target": "U5T3dMVY4wj7",
  401. "sourceHandle": "nlfwkc-source-right",
  402. "targetHandle": "U5T3dMVY4wj7-target-left"
  403. }
  404. ]
  405. }