api-config.json 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {
  2. "name": "brand-profile",
  3. "displayName": "品牌六维画像",
  4. "description": "生成品牌六维量化画像,标注机会/风险标签、识别核心短板、输出竞争定位建议和《品牌认知校准卡》",
  5. "category": "synthesis",
  6. "version": "1.1.0",
  7. "type": "orchestration",
  8. "parameters": {
  9. "brandName": {
  10. "type": "string",
  11. "required": true,
  12. "description": "品牌名称"
  13. },
  14. "brandAsins": {
  15. "type": "array",
  16. "items": { "type": "string" },
  17. "required": true,
  18. "description": "品牌核心ASIN列表"
  19. },
  20. "categoryKeyword": {
  21. "type": "string",
  22. "required": true,
  23. "description": "品类关键词(用于品类基准对比)"
  24. },
  25. "categoryLandscape": {
  26. "type": "object",
  27. "required": false,
  28. "description": "category-landscape 输出(如有则跳过重复查询)"
  29. },
  30. "domain": {
  31. "type": "integer",
  32. "required": false,
  33. "default": 1,
  34. "description": "Amazon站点(1=美国)"
  35. }
  36. },
  37. "pipeline": [
  38. {
  39. "step": 1,
  40. "name": "批量获取品牌产品详情",
  41. "forEach": "brandAsins",
  42. "api": {
  43. "service": "SorftimeApiService.getProductDetail",
  44. "endpoint": "/api/ProductRequest",
  45. "method": "POST",
  46. "forwardUrl": "https://server.fmode.cn/api/voc/forward",
  47. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  48. "requestBody": { "ASIN": "${asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" },
  49. "queryParams": { "domain": "${domain}" }
  50. },
  51. "output": "productDetails",
  52. "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, MonthlySales, fiveStartRatings, fourStartRatings, threeStartRatings, twoStartRatings, oneStartRatings }"
  53. },
  54. {
  55. "step": 2,
  56. "name": "批量获取销量数据",
  57. "forEach": "brandAsins",
  58. "api": {
  59. "service": "SorftimeApiService.getAsinSalesVolume",
  60. "endpoint": "/api/AsinSalesVolume",
  61. "method": "POST",
  62. "requestBody": { "ASIN": "${asin}" },
  63. "queryParams": { "domain": "${domain}" }
  64. },
  65. "output": "salesData"
  66. },
  67. {
  68. "step": 3,
  69. "name": "采样获取评论概况",
  70. "forEach": "brandAsins",
  71. "api": {
  72. "service": "SorftimeApiService.getProductReviews",
  73. "endpoint": "/api/ProductReviewsQuery",
  74. "method": "POST",
  75. "forwardUrl": "https://server.fmode.cn/api/voc/forward",
  76. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  77. "requestBody": { "ASIN": "${asin}", "PageIndex": "1" },
  78. "queryParams": { "domain": "${domain}" }
  79. },
  80. "output": "reviewSamples"
  81. },
  82. {
  83. "step": 4,
  84. "name": "获取品类基准数据(如未传入categoryLandscape)",
  85. "condition": "!categoryLandscape",
  86. "api": {
  87. "service": "SorftimeApiService.searchProductsByQuery",
  88. "endpoint": "/api/ProductQuery",
  89. "method": "POST",
  90. "forwardUrl": "https://server.fmode.cn/api/voc/forward",
  91. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  92. "requestBody": { "Page": 1, "Query": "1", "QueryType": "7", "Pattern": "${categoryKeyword}" },
  93. "queryParams": { "domain": "${domain}" }
  94. },
  95. "output": "categoryBaseline"
  96. },
  97. {
  98. "step": 5,
  99. "name": "六维评分计算",
  100. "type": "compute",
  101. "logic": "calcSixDimensions(productDetails, salesData, reviewSamples, categoryBaseline || categoryLandscape)",
  102. "algorithm": {
  103. "pricing": { "weight": 0.20, "method": "品牌均价 vs 品类中位价的偏离度" },
  104. "rating": { "weight": 0.20, "method": "平均评分 + 差评率(1-2星占比)" },
  105. "traffic": { "weight": 0.15, "method": "BSR中位数在品类中的百分位" },
  106. "salesEfficiency": { "weight": 0.15, "method": "品牌月销量 vs 品类均值" },
  107. "growthPotential": { "weight": 0.15, "method": "新品比例 + 销量趋势 + 品类CR5位置" },
  108. "vocReputation": { "weight": 0.15, "method": "好评率 + 评论增速 + Helpful比例" }
  109. },
  110. "output": "dimensions"
  111. },
  112. {
  113. "step": 6,
  114. "name": "竞争定位+标签+建议",
  115. "type": "compute",
  116. "logic": "generatePositioning(dimensions, productDetails, brandName)",
  117. "algorithm": {
  118. "quadrant": "四象限图坐标(价格-评分)",
  119. "opportunityTags": "从每个维度评分提取优势机会",
  120. "riskTags": "识别低分维度作为风险点",
  121. "coreShortcoming": "最低分维度的具体诊断和改进建议",
  122. "priorityActions": "按紧迫度排序的改进任务"
  123. },
  124. "output": "positioning"
  125. }
  126. ],
  127. "response": {
  128. "type": "object",
  129. "properties": {
  130. "brandName": { "type": "string" },
  131. "dimensions": {
  132. "type": "object",
  133. "description": "六维评分",
  134. "properties": {
  135. "pricing": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } },
  136. "rating": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } },
  137. "traffic": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } },
  138. "salesEfficiency": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } },
  139. "growthPotential": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } },
  140. "vocReputation": { "type": "object", "properties": { "score": { "type": "integer" }, "label": { "type": "string" }, "detail": { "type": "string" } } }
  141. }
  142. },
  143. "overallScore": { "type": "number" },
  144. "positioning": {
  145. "type": "object",
  146. "properties": {
  147. "quadrant": { "type": "string" },
  148. "x": { "type": "number" },
  149. "y": { "type": "number" },
  150. "xLabel": { "type": "string" },
  151. "yLabel": { "type": "string" }
  152. }
  153. },
  154. "strengths": { "type": "array", "items": { "type": "string" } },
  155. "weaknesses": { "type": "array", "items": { "type": "string" } },
  156. "opportunityTags": { "type": "array", "items": { "type": "string" } },
  157. "riskTags": { "type": "array", "items": { "type": "string" } },
  158. "coreShortcoming": {
  159. "type": "object",
  160. "properties": {
  161. "dimension": { "type": "string" },
  162. "score": { "type": "integer" },
  163. "diagnosis": { "type": "string" },
  164. "advice": { "type": "string" }
  165. }
  166. },
  167. "priorityActions": {
  168. "type": "array",
  169. "items": {
  170. "type": "object",
  171. "properties": {
  172. "action": { "type": "string" },
  173. "priority": { "type": "integer" }
  174. }
  175. }
  176. },
  177. "calibrationCard": { "type": "string", "description": "品牌认知校准卡(Markdown格式)" }
  178. }
  179. },
  180. "timeout": 90000,
  181. "retry": {
  182. "maxAttempts": 2,
  183. "delay": 2000,
  184. "backoffMultiplier": 2
  185. }
  186. }