api-config.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. {
  2. "name": "transcript-to-video",
  3. "displayName": "閫愬瓧绋緼I瑙嗛鐢熸垚宸ヤ綔娴?,
  4. "description": "杈撳叆閫愬瓧绋挎枃鏈紝AI鑷姩鎷嗗垎闀滆剼鏈紝鎵归噺璋冪敤鍗虫ⅵ瑙嗛鐢熸垚锛岃緭鍑鸿棰戠墖娈礥RL鍒楄〃+SRT瀛楀箷鏂囦欢銆傛敮鎸佹枃鐢熻棰戝拰鍏堝浘鍚庤棰戜袱绉嶆ā寮忋€?,
  5. "category": "video-creation",
  6. "version": "1.0.0",
  7. "type": "orchestration",
  8. "parameters": {
  9. "type": "object",
  10. "required": ["transcript"],
  11. "properties": {
  12. "transcript": {
  13. "type": "string",
  14. "description": "閫愬瓧绋垮叏鏂囷紙涓枃锛夛紝Agent灏嗚嚜鍔ㄦ媶鍒嗕负鍒嗛暅娈?
  15. },
  16. "segmentDuration": {
  17. "type": "number",
  18. "description": "姣忔鐩爣鏃堕暱锛堢锛夛紝褰卞搷鍒嗛暅鎷嗗垎绮掑害",
  19. "default": 15
  20. },
  21. "videoModel": {
  22. "type": "string",
  23. "enum": ["720p", "1080p", "pro"],
  24. "description": "瑙嗛鐢熸垚妯″瀷璐ㄩ噺绛夌骇",
  25. "default": "720p"
  26. },
  27. "videoMethod": {
  28. "type": "string",
  29. "enum": ["text2video", "img2video"],
  30. "description": "text2video=绾枃鐢熻棰戯紙蹇€燂級锛宨mg2video=鍏堢敓鍥惧啀鍥剧敓瑙嗛锛堟晥鏋滄洿鍙帶锛?,
  31. "default": "text2video"
  32. },
  33. "aspectRatio": {
  34. "type": "string",
  35. "enum": ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"],
  36. "description": "瑙嗛鐢婚潰姣斾緥",
  37. "default": "16:9"
  38. },
  39. "frames": {
  40. "type": "integer",
  41. "enum": [121, 241],
  42. "description": "瑙嗛甯ф暟锛?21=5绉掞紝241=10绉?,
  43. "default": 121
  44. }
  45. }
  46. },
  47. "pipeline": [
  48. {
  49. "step": 1,
  50. "name": "AI鍒嗛暅鑴氭湰鐢熸垚",
  51. "type": "ai",
  52. "description": "Agent灏嗛€愬瓧绋挎媶鍒嗕负鍒嗛暅JSON鍜孲RT瀛楀箷",
  53. "aiConfig": {
  54. "systemPrompt": "浣犳槸涓撲笟鐨勮棰戝垎闀滆剼鏈紪鍐欎笓瀹躲€傚皢閫愬瓧绋挎媶鍒嗕负鍒嗛暅娈碉紝姣忔绾?0-45涓腑鏂囧瓧锛堢害15绉掕閫燂級銆備负姣忔鐢熸垚鑻辨枃瑙嗛鐢熸垚鎻愮ず璇嶏紙prompt锛夛紝鎻忚堪鐢婚潰鍐呭銆侀暅澶寸被鍨嬨€佹皼鍥村拰鐢昏川銆?,
  55. "userPromptTemplate": "璇峰皢浠ヤ笅閫愬瓧绋挎媶鍒嗕负鍒嗛暅鑴氭湰锛屾瘡娈电害${segmentDuration}绉掋€俓n\n閫愬瓧绋匡細\n${transcript}\n\n杈撳嚭JSON鏁扮粍鏍煎紡锛歕n[{\"id\":\"S-01\",\"act\":\"娈佃惤鍚峔",\"narration\":\"涓枃鏃佺櫧鍘熸枃\",\"type\":\"ai-gen\",\"prompt\":\"English video generation prompt with scene, camera, mood, quality keywords\",\"duration\":\"15s\"}]\n\n鍚屾椂杈撳嚭SRT瀛楀箷鏂囦欢鍐呭銆?,
  56. "outputFormat": {
  57. "storyboard": "Array<{id, act, narration, type, prompt, duration}>",
  58. "srt": "String (SRT format subtitle content)"
  59. },
  60. "temperature": 0.3
  61. },
  62. "output": {
  63. "storyboard": "鍒嗛暅JSON鏁扮粍",
  64. "srt": "SRT瀛楀箷鏂囦欢鍐呭"
  65. }
  66. },
  67. {
  68. "step": 2,
  69. "name": "鎵归噺鐢熸垚瑙嗛绱犳潗",
  70. "type": "api",
  71. "description": "瀵规瘡涓垎闀滄骞惰璋冪敤鍗虫ⅵ瑙嗛鐢熸垚API",
  72. "forEach": "storyboard",
  73. "forEachAs": "segment",
  74. "parallel": {
  75. "maxConcurrent": 5,
  76. "delayMs": 1000
  77. },
  78. "branches": {
  79. "text2video": {
  80. "condition": "videoMethod === 'text2video'",
  81. "steps": [
  82. {
  83. "id": "2a",
  84. "name": "鏂囩敓瑙嗛",
  85. "skill": "jimeng/jimeng-video-v3-720p",
  86. "skillVariants": {
  87. "720p": "jimeng/jimeng-video-v3-720p",
  88. "1080p": "jimeng/jimeng-video-v3-1080p",
  89. "pro": "jimeng/jimeng-video-v3-pro"
  90. },
  91. "input": {
  92. "prompt": "${segment.prompt}",
  93. "method": "1",
  94. "frames": "${frames}",
  95. "config": {
  96. "aspect_ratio": "${aspectRatio}"
  97. }
  98. },
  99. "output": "workIds[${segment.id}]"
  100. }
  101. ]
  102. },
  103. "img2video": {
  104. "condition": "videoMethod === 'img2video'",
  105. "steps": [
  106. {
  107. "id": "2b-1",
  108. "name": "鏂囩敓鍥撅紙棣栧抚锛?,
  109. "skill": "jimeng/jimeng-img-v4",
  110. "input": {
  111. "prompt": "${segment.prompt}",
  112. "sizeDate": {
  113. "width": "${aspectRatio === '16:9' ? 2560 : aspectRatio === '9:16' ? 1440 : 2048}",
  114. "height": "${aspectRatio === '16:9' ? 1440 : aspectRatio === '9:16' ? 2560 : 2048}"
  115. }
  116. },
  117. "output": "imageWorkIds[${segment.id}]"
  118. },
  119. {
  120. "id": "2b-2",
  121. "name": "杞鍥剧墖缁撴灉",
  122. "skill": "jimeng/jimeng-task-query",
  123. "dependsOn": ["2b-1"],
  124. "input": {
  125. "workId": "${imageWorkIds[segment.id]}",
  126. "routerName": "getImgV4"
  127. },
  128. "pollingConfig": {
  129. "intervalMs": 3000,
  130. "maxAttempts": 30,
  131. "completionCondition": "data.isFinish === true"
  132. }
  133. },
  134. {
  135. "id": "2b-3",
  136. "name": "鑾峰彇鍥剧墖URL",
  137. "skill": "jimeng/jimeng-work-result",
  138. "dependsOn": ["2b-2"],
  139. "input": {
  140. "workId": "${imageWorkIds[segment.id]}"
  141. },
  142. "output": "imageUrls[${segment.id}]",
  143. "responseExtract": "images[0]"
  144. },
  145. {
  146. "id": "2b-4",
  147. "name": "鍥剧敓瑙嗛锛堥甯э級",
  148. "skill": "jimeng/jimeng-video-v3-720p",
  149. "dependsOn": ["2b-3"],
  150. "input": {
  151. "prompt": "${segment.prompt}",
  152. "method": "2",
  153. "frames": "${frames}",
  154. "config": {
  155. "image_urls": ["${imageUrls[segment.id]}"]
  156. }
  157. },
  158. "output": "workIds[${segment.id}]"
  159. }
  160. ]
  161. }
  162. }
  163. },
  164. {
  165. "step": 3,
  166. "name": "杞瑙嗛鐢熸垚缁撴灉",
  167. "type": "api",
  168. "forEach": "workIds",
  169. "forEachAs": "workId",
  170. "parallel": {
  171. "maxConcurrent": 10,
  172. "delayMs": 500
  173. },
  174. "steps": [
  175. {
  176. "id": "3a",
  177. "name": "杞浠诲姟鐘舵€?,
  178. "skill": "jimeng/jimeng-task-query",
  179. "input": {
  180. "workId": "${workId}",
  181. "routerName": "${videoModel === '720p' ? 'getVideoV3_720p' : videoModel === '1080p' ? 'getVideoV3_1080p' : 'getVideoV3_Pro'}"
  182. },
  183. "pollingConfig": {
  184. "intervalMs": 5000,
  185. "maxAttempts": 60,
  186. "completionCondition": "data.isFinish === true",
  187. "timeoutMs": 300000
  188. }
  189. },
  190. {
  191. "id": "3b",
  192. "name": "鑾峰彇瑙嗛URL",
  193. "skill": "jimeng/jimeng-work-result",
  194. "dependsOn": ["3a"],
  195. "input": {
  196. "workId": "${workId}"
  197. },
  198. "output": "videoResults[${segmentId}]",
  199. "responseExtract": {
  200. "videoUrl": "videos[0]",
  201. "images": "images"
  202. }
  203. }
  204. ]
  205. },
  206. {
  207. "step": 4,
  208. "name": "缁撴灉姹囨€?,
  209. "type": "compute",
  210. "logic": "aggregateResults(storyboard, srt, videoResults)",
  211. "algorithm": {
  212. "merge": "灏嗗垎闀淛SON涓庤棰慤RL鍚堝苟",
  213. "stats": "缁熻鎴愬姛/澶辫触鏁伴噺",
  214. "failedRetry": "澶辫触鐨勫垎闀滄鏍囪涓篺ailedIds锛屽彲閲嶈瘯"
  215. },
  216. "output": "finalOutput"
  217. },
  218. {
  219. "step": 5,
  220. "name": "鍙€夛細涓€閿垚鐗?,
  221. "type": "api",
  222. "optional": true,
  223. "condition": "user requests quick compilation && successCount <= 50 && totalDuration <= 30",
  224. "skill": "video-creation/quickly-video-create",
  225. "input": {
  226. "material_list": "${videoResults.map(r => ({ type: 'video', value: r.videoUrl }))}",
  227. "tags": "${extractKeywords(transcript)}",
  228. "proportion": "${aspectRatio === '9:16' ? '9:16' : aspectRatio === '1:1' ? '1:1' : '9:16'}",
  229. "video_duration": { "min": 15, "max": 30 },
  230. "pre_id": "${Date.now().toString()}",
  231. "ai_voice": 1,
  232. "ai_bgm": 1,
  233. "ai_subtitle": 1
  234. },
  235. "output": "quicklyTaskId",
  236. "downstream": "video-creation/quickly-video-query"
  237. }
  238. ],
  239. "response": {
  240. "type": "object",
  241. "properties": {
  242. "storyboard": {
  243. "type": "array",
  244. "description": "鍒嗛暅鑴氭湰JSON",
  245. "items": {
  246. "type": "object",
  247. "properties": {
  248. "id": { "type": "string" },
  249. "act": { "type": "string" },
  250. "narration": { "type": "string" },
  251. "prompt": { "type": "string" },
  252. "duration": { "type": "string" },
  253. "videoUrl": { "type": "string", "description": "鐢熸垚鐨勮棰慤RL锛堟案涔呮湁鏁堬級" },
  254. "imageUrl": { "type": "string", "description": "鐢熸垚鐨勯甯у浘URL锛坕mg2video妯″紡锛? }
  255. }
  256. }
  257. },
  258. "srt": {
  259. "type": "string",
  260. "description": "SRT瀛楀箷鏂囦欢鍐呭"
  261. },
  262. "segments": {
  263. "type": "array",
  264. "description": "瑙嗛鐗囨姹囨€?,
  265. "items": {
  266. "type": "object",
  267. "properties": {
  268. "id": { "type": "string" },
  269. "videoUrl": { "type": "string" },
  270. "duration": { "type": "number" },
  271. "prompt": { "type": "string" }
  272. }
  273. }
  274. },
  275. "totalSegments": { "type": "integer" },
  276. "successCount": { "type": "integer" },
  277. "failedCount": { "type": "integer" },
  278. "failedIds": { "type": "array", "items": { "type": "string" } }
  279. }
  280. },
  281. "relatedSkills": [
  282. "jimeng/jimeng-video-v3-720p",
  283. "jimeng/jimeng-video-v3-1080p",
  284. "jimeng/jimeng-video-v3-pro",
  285. "jimeng/jimeng-img-v4",
  286. "jimeng/jimeng-task-query",
  287. "jimeng/jimeng-work-result",
  288. "video-creation/quickly-video-create",
  289. "video-creation/quickly-video-query"
  290. ],
  291. "pricing": {
  292. "text2video_720p_5s": {
  293. "perSegment": 1.4,
  294. "unit": "CNY",
  295. "formula": "0.28鍏?绉?脳 5绉?
  296. },
  297. "text2video_720p_10s": {
  298. "perSegment": 2.8,
  299. "unit": "CNY",
  300. "formula": "0.28鍏?绉?脳 10绉?
  301. },
  302. "img2video_720p_5s": {
  303. "perSegment": 1.62,
  304. "unit": "CNY",
  305. "formula": "0.22鍏?鍥? + 0.28鍏?绉捗?绉?瑙嗛)"
  306. },
  307. "example_71segments_5s": {
  308. "text2video": "鈮?9鍏?,
  309. "img2video": "鈮?15鍏?
  310. }
  311. },
  312. "limitations": {
  313. "videoDuration": "浠呮敮鎸?绉?121甯?鎴?0绉?241甯?锛屾棤娉曠簿纭尮閰峉RT鏃堕棿鎴?,
  314. "noTTS": "鏃燭TS閰嶉煶鑳藉姏锛岄渶鐢ㄦ埛鍦ㄥ壀鏄犱腑閰嶉煶",
  315. "noAutoStitch": "鏃犺嚜鍔ㄦ嫾鎺ラ暱瑙嗛鑳藉姏锛宷uickly鏈€闀?0绉?,
  316. "parallelLimit": "鍗虫ⅵAPI寤鸿鈮?骞惰锛岄伩鍏嶉鐜囬檺鍒?
  317. },
  318. "futureExtensions": [
  319. {
  320. "name": "tts-voiceover",
  321. "description": "TTS閰嶉煶Skill锛氭寜閫愬瓧绋跨敓鎴愯闊抽煶棰?,
  322. "status": "planned"
  323. },
  324. {
  325. "name": "video-stitch",
  326. "description": "瑙嗛鎷兼帴Skill锛欶Fmpeg鏈嶅姟绔寜SRT鏃堕棿杞寸簿纭嫾鎺?,
  327. "status": "planned"
  328. },
  329. {
  330. "name": "seeddance-video",
  331. "description": "seeddance2.0妯″瀷鎺ュ叆锛氭洿楂樿川閲忚棰戠敓鎴?,
  332. "status": "planned"
  333. }
  334. ],
  335. "tokenConfig": {
  336. "type": "body",
  337. "tokenField": "token",
  338. "format": "Bearer r:{{jimengToken}}",
  339. "configFile": "~/.openclaw/voc-credentials.json",
  340. "currentToken": "Bearer r:f0333969e312a40e4703e8fe4ed1c600",
  341. "resolutionOrder": ["configFile", "currentToken"],
  342. "onMissing": {
  343. "action": "showPaymentQR",
  344. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?authid=T0iOotHcDX&fun_id=HOkkX72PMF",
  345. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  346. "pollingIntervalMs": 3000,
  347. "pollingTimeoutMs": 300000,
  348. "onPaymentSuccess": "retrySkillWithNewToken",
  349. "title": "鎵爜寮€閫氬嵆姊I瑙嗛鐢熸垚鏈嶅姟",
  350. "message": "璇锋壂鎻忎笅鏂逛簩缁寸爜瀹屾垚鏀粯锛屾敮浠樻垚鍔熷悗灏嗚嚜鍔ㄨ幏鍙?Token 骞剁户缁墽琛屻€?
  351. },
  352. "onBalanceInsufficient": {
  353. "action": "showPaymentQR",
  354. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?authid=T0iOotHcDX&fun_id=HOkkX72PMF",
  355. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  356. "pollingIntervalMs": 3000,
  357. "pollingTimeoutMs": 300000,
  358. "onPaymentSuccess": "retrySkillWithNewToken",
  359. "title": "鍗虫ⅵAI Token 浣欓涓嶈冻锛岃鎵爜鍏呭€?,
  360. "message": "褰撳墠 Token 浣欓涓嶈冻锛岃鎵弿浜岀淮鐮佸厖鍊硷紝鏀粯瀹屾垚鍚庡皢鑷姩缁х画鎵ц銆?
  361. }
  362. },
  363. "errorHandling": {
  364. "balanceInsufficient": {
  365. "conditions": [
  366. { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
  367. { "responseField": "msg", "operator": "contains", "value": ["浣欓涓嶈冻", "insufficient", "balance", "quota"] }
  368. ],
  369. "matchMode": "any",
  370. "trigger": "tokenConfig.onBalanceInsufficient"
  371. },
  372. "segmentFailed": {
  373. "action": "markFailed",
  374. "description": "鍗曚釜鍒嗛暅娈电敓鎴愬け璐ユ椂鏍囪涓篺ailed锛屼笉闃诲鍏朵粬娈碉紝鏈€鍚庢眹鎬诲け璐ュ垪琛ㄤ緵閲嶈瘯"
  375. }
  376. },
  377. "timeout": 600000,
  378. "retry": {
  379. "maxAttempts": 2,
  380. "delay": 3000,
  381. "backoffMultiplier": 2
  382. }
  383. }