process.json 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {
  2. "name": "GenerateNote",
  3. "description": "生成小红书图文笔记",
  4. "variables":
  5. {
  6. "article-prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记",
  7. "article": "",
  8. "img-prompt-arr":
  9. [
  10. "健康减脂餐 轻食沙拉 低卡高蛋白 摆盘",
  11. "居家有氧运动 女生健身 燃脂操"
  12. ],
  13. "download-path": "tmp",
  14. "img-url-arr": [],
  15. "idx": 0,
  16. "pos": "",
  17. "thumbRect": ""
  18. },
  19. "execute": [
  20. {
  21. "type": "echo",
  22. "inVars": ["开始生成小红书图文笔记"]
  23. },
  24. {
  25. "type": "ai",
  26. "method": "text2text",
  27. "inVars": ["根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{article-prompt}}", ""],
  28. "outVars": ["{article}"]
  29. },
  30. {
  31. "type": "for",
  32. "indexVariable": "{idx}",
  33. "items": "{img-prompt-arr}",
  34. "body": [
  35. {
  36. "type": "echo",
  37. "inVars": ["请根据描述词找一张确认可下载的图片 URL。描述词:{img-prompt-arr}[{idx}]"]
  38. },
  39. {
  40. "type": "try",
  41. "try":
  42. [
  43. {
  44. "type": "ai",
  45. "method": "text2text",
  46. "inVars":
  47. [
  48. "请根据以下描述词找一张图片,只返回一张确认过可以正常下载的图片 URL(必须是当前可访问、能直接 GET 下载的地址),不要任何说明、markdown 或换行。描述词:{img-prompt-arr}[{idx}]",
  49. "doubao"
  50. ],
  51. "outVars": ["{img-url-arr}"]
  52. },
  53. {
  54. "type": "download",
  55. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  56. "outVars": []
  57. }
  58. ],
  59. "fail":
  60. [
  61. {
  62. "type": "try",
  63. "try":
  64. [
  65. {
  66. "type": "ai",
  67. "method": "text2text",
  68. "inVars":
  69. [
  70. "请根据描述词找一张图片,只返回一个当前可访问、能直接 GET 下载的图片 URL(不要说明、markdown 或换行)。描述词:{img-prompt-arr}[{idx}]",
  71. "doubao"
  72. ],
  73. "outVars": ["{img-url-arr}"]
  74. },
  75. {
  76. "type": "download",
  77. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  78. "outVars": []
  79. }
  80. ],
  81. "fail":
  82. [
  83. {
  84. "type": "ai",
  85. "method": "text2text",
  86. "inVars":
  87. [
  88. "请根据描述词找一张图片,只返回一个可访问的图片 URL(仅 URL,无说明)。描述词:{img-prompt-arr}[{idx}]",
  89. "doubao"
  90. ],
  91. "outVars": ["{img-url-arr}"]
  92. },
  93. {
  94. "type": "download",
  95. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  96. "outVars": []
  97. }
  98. ]
  99. }
  100. ]
  101. },
  102. {
  103. "type": "adb",
  104. "method": "send-img-to-device",
  105. "inVars": ["tmp/pic{idx}.png"],
  106. "outVars": []
  107. }
  108. ]
  109. },
  110. {
  111. "type": "img-center-point-location",
  112. "inVars": ["添加笔记.png"],
  113. "outVars": ["{pos}"]
  114. },
  115. {
  116. "type": "adb",
  117. "method": "click",
  118. "inVars": ["{pos}"]
  119. },
  120. {
  121. "type": "ocr",
  122. "inVars": ["从相册选择"],
  123. "outVars": ["{pos}"]
  124. },
  125. {
  126. "type": "adb",
  127. "method": "click",
  128. "inVars": ["{pos}"]
  129. },
  130. {
  131. "type": "for",
  132. "indexVariable": "{idx}",
  133. "items": "{img-prompt-arr}",
  134. "body": [
  135. {
  136. "type": "img-center-point-location",
  137. "method": "template",
  138. "inVars": ["tmp/pic{idx}.png"],
  139. "outVars": ["{pos}"]
  140. },
  141. {
  142. "type": "adb",
  143. "method": "click",
  144. "inVars": ["{pos}"]
  145. },
  146. {
  147. "type": "img-center-point-location",
  148. "inVars": ["选中图片.png"],
  149. "outVars": ["{pos}"]
  150. },
  151. {
  152. "type": "adb",
  153. "method": "click",
  154. "inVars": ["{pos}"]
  155. },
  156. {
  157. "type": "adb",
  158. "method": "keyevent",
  159. "inVars": ["4"],
  160. "outVars": []
  161. }
  162. ]
  163. },
  164. {
  165. "type": "ocr",
  166. "inVars": ["下一步"],
  167. "outVars": ["{pos}"]
  168. },
  169. {
  170. "type": "adb",
  171. "method": "click",
  172. "inVars": ["{pos}"]
  173. },
  174. {
  175. "type": "ocr",
  176. "inVars": ["下一步"],
  177. "outVars": ["{pos}"]
  178. },
  179. {
  180. "type": "adb",
  181. "method": "click",
  182. "inVars": ["{pos}"]
  183. },
  184. {
  185. "type": "adb",
  186. "method": "input",
  187. "inVars": ["{article}"]
  188. },
  189. {
  190. "type": "ocr",
  191. "inVars": ["发布笔记"],
  192. "outVars": ["{pos}"]
  193. },
  194. {
  195. "type": "adb",
  196. "method": "click",
  197. "inVars": ["{pos}"]
  198. },
  199. {
  200. "type": "echo",
  201. "inVars": ["流程结束"]
  202. }
  203. ]
  204. }