extract_workflow.schema.json 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "title": "extract_workflow_output_v7",
  4. "type": "object",
  5. "required": ["skip", "skip_reason", "workflow_groups"],
  6. "additionalProperties": false,
  7. "definitions": {
  8. "step": {
  9. "type": "object",
  10. "required": ["step_id", "order", "phase"],
  11. "additionalProperties": false,
  12. "properties": {
  13. "step_id": {
  14. "type": "string",
  15. "pattern": "^s[0-9]+$"
  16. },
  17. "order": {
  18. "type": "integer",
  19. "minimum": 1
  20. },
  21. "phase": {
  22. "type": "string",
  23. "enum": ["非制作", "预处理", "生成", "编辑"]
  24. }
  25. }
  26. },
  27. "workflow": {
  28. "type": "object",
  29. "required": ["workflow_id", "steps"],
  30. "additionalProperties": false,
  31. "properties": {
  32. "workflow_id": {
  33. "type": "string",
  34. "pattern": "^w[0-9]+$"
  35. },
  36. "steps": {
  37. "type": "array",
  38. "minItems": 1,
  39. "items": { "$ref": "#/definitions/step" }
  40. }
  41. }
  42. },
  43. "io_item": {
  44. "type": "object",
  45. "required": ["modality", "description", "relation"],
  46. "additionalProperties": false,
  47. "properties": {
  48. "modality": {
  49. "type": "string",
  50. "enum": ["文本", "图片", "视频", "音频", "特征点", "参数", "模型", "向量"]
  51. },
  52. "description": {
  53. "type": "string",
  54. "minLength": 1
  55. },
  56. "relation": {
  57. "type": "string",
  58. "pattern": "^\\[(来源|去向)\\..+\\]$"
  59. }
  60. }
  61. },
  62. "effect": {
  63. "type": "object",
  64. "required": ["statement", "criteria", "judge_method", "negative_examples"],
  65. "additionalProperties": false,
  66. "properties": {
  67. "statement": {
  68. "type": "string",
  69. "pattern": "^实现"
  70. },
  71. "criteria": {
  72. "type": "string",
  73. "minLength": 1
  74. },
  75. "judge_method": {
  76. "type": "string",
  77. "enum": ["llm", "vlm", "rule", "human"]
  78. },
  79. "negative_examples": {
  80. "type": "array",
  81. "items": {
  82. "type": "string",
  83. "minLength": 1
  84. },
  85. "default": []
  86. }
  87. }
  88. },
  89. "apply_to_draft": {
  90. "type": "object",
  91. "required": ["实质", "形式"],
  92. "additionalProperties": false,
  93. "properties": {
  94. "实质": {
  95. "type": "array",
  96. "items": { "type": "string" }
  97. },
  98. "形式": {
  99. "type": "array",
  100. "items": { "type": "string" }
  101. }
  102. }
  103. },
  104. "workflow_step_ref": {
  105. "anyOf": [
  106. { "type": "null" },
  107. {
  108. "type": "object",
  109. "required": ["workflow_id", "step_id"],
  110. "additionalProperties": false,
  111. "properties": {
  112. "workflow_id": {
  113. "type": "string",
  114. "pattern": "^w[0-9]+$"
  115. },
  116. "step_id": {
  117. "type": "string",
  118. "pattern": "^s[0-9]+$"
  119. }
  120. }
  121. }
  122. ]
  123. },
  124. "capability": {
  125. "type": "object",
  126. "required": [
  127. "capability_id",
  128. "action",
  129. "inputs",
  130. "outputs",
  131. "body",
  132. "effects",
  133. "control_target",
  134. "artifact_type",
  135. "tools",
  136. "apply_to_draft",
  137. "workflow_step_ref",
  138. "is_alternative_to"
  139. ],
  140. "additionalProperties": false,
  141. "properties": {
  142. "capability_id": {
  143. "type": "string",
  144. "pattern": "^c_w[0-9]+_(s[0-9]+_[0-9]+|standalone_[0-9]+)$"
  145. },
  146. "action": {
  147. "type": "object",
  148. "required": ["description", "reasoning"],
  149. "additionalProperties": false,
  150. "properties": {
  151. "description": {
  152. "type": "string",
  153. "minLength": 1
  154. },
  155. "reasoning": {
  156. "type": "string",
  157. "minLength": 1
  158. }
  159. }
  160. },
  161. "inputs": {
  162. "type": "array",
  163. "items": { "$ref": "#/definitions/io_item" }
  164. },
  165. "outputs": {
  166. "type": "array",
  167. "items": { "$ref": "#/definitions/io_item" }
  168. },
  169. "body": {
  170. "type": ["string", "null"]
  171. },
  172. "effects": {
  173. "type": "array",
  174. "minItems": 1,
  175. "items": { "$ref": "#/definitions/effect" }
  176. },
  177. "control_target": {
  178. "type": "array",
  179. "items": {
  180. "type": "string",
  181. "minLength": 1
  182. }
  183. },
  184. "artifact_type": {
  185. "type": ["string", "null"]
  186. },
  187. "tools": {
  188. "type": "array",
  189. "items": { "type": "string" }
  190. },
  191. "apply_to_draft": { "$ref": "#/definitions/apply_to_draft" },
  192. "workflow_step_ref": { "$ref": "#/definitions/workflow_step_ref" },
  193. "is_alternative_to": {
  194. "type": "array",
  195. "items": {
  196. "type": "string",
  197. "pattern": "^c_w[0-9]+_(s[0-9]+_[0-9]+|standalone_[0-9]+)$"
  198. }
  199. }
  200. }
  201. },
  202. "workflow_group": {
  203. "type": "object",
  204. "required": ["workflow_id", "workflow", "capability"],
  205. "additionalProperties": false,
  206. "properties": {
  207. "workflow_id": {
  208. "type": "string",
  209. "pattern": "^w[0-9]+$"
  210. },
  211. "workflow": { "$ref": "#/definitions/workflow" },
  212. "capability": {
  213. "type": "array",
  214. "minItems": 1,
  215. "items": { "$ref": "#/definitions/capability" }
  216. }
  217. }
  218. }
  219. },
  220. "properties": {
  221. "skip": {
  222. "type": "boolean"
  223. },
  224. "skip_reason": {
  225. "type": "string"
  226. },
  227. "workflow_groups": {
  228. "type": "array",
  229. "items": { "$ref": "#/definitions/workflow_group" }
  230. }
  231. }
  232. }