api-config.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. {
  2. "name": "review-pain-point-extraction",
  3. "displayName": "差评痛点提取",
  4. "description": "从差评中提取用户痛点,按类别聚类,量化频率和严重度,找到竞品死穴",
  5. "category": "review-analysis",
  6. "version": "1.3.0",
  7. "type": "analysis",
  8. "parameters": {
  9. "reviewCorpus": {
  10. "type": "object",
  11. "required": true,
  12. "description": "review-batch-collection 输出的评论语料"
  13. },
  14. "targetAsins": {
  15. "type": "array",
  16. "items": {
  17. "type": "string"
  18. },
  19. "required": false,
  20. "description": "指定分析的ASIN列表"
  21. },
  22. "painCategories": {
  23. "type": "array",
  24. "items": {
  25. "type": "string"
  26. },
  27. "required": false,
  28. "default": [
  29. "产品质量",
  30. "尺寸规格",
  31. "功能缺陷",
  32. "外观",
  33. "物流包装",
  34. "性价比"
  35. ],
  36. "description": "预定义痛点类别"
  37. }
  38. },
  39. "pipeline": [
  40. {
  41. "step": 1,
  42. "name": "过滤差评",
  43. "type": "filter",
  44. "logic": "filterNegativeReviews(reviewCorpus.reviews, { stars: [1, 2], targetAsins })",
  45. "algorithm": {
  46. "filter": "star<=2 && (targetAsins.length==0 || targetAsins.includes(asin))",
  47. "implementation": "遍历reviews数组,保留star<=2的评论,可选按targetAsins进一步过滤"
  48. },
  49. "output": "negativeReviews"
  50. },
  51. {
  52. "step": 2,
  53. "name": "AI提取痛点主题",
  54. "type": "ai",
  55. "logic": "extractPainPoints(negativeReviews, { painCategories })",
  56. "aiConfig": {
  57. "systemPrompt": "你是跨境电商VOC分析师。只输出一个合法JSON对象。禁止输出Markdown、代码围栏、解释文字。",
  58. "userPromptTemplate": "以下是差评样本([星级][ASIN] 标题 | 摘要)。请归纳痛点主题,按严重度排序:\n${payload}",
  59. "outputFormat": "{\"painPoints\":[{\"topic\":\"尺码偏小\",\"score\":85,\"category\":\"尺码规格\",\"examples\":[\"偏小一码\"]}]}",
  60. "temperature": 0.2,
  61. "maxTokens": 2000,
  62. "payloadFormat": "每条评论格式化为 [star★][ASIN] title | content截取前200字,按batch发送给AI"
  63. },
  64. "output": "rawPainPoints"
  65. },
  66. {
  67. "step": 3,
  68. "name": "痛点聚类+严重度排序",
  69. "type": "compute",
  70. "logic": "clusterAndRank(rawPainPoints, negativeReviews)",
  71. "algorithm": {
  72. "severityScore": "severity = frequency*0.4 + negativeImpact*0.3 + competitorGap*0.3",
  73. "cluster": "语义相近的合并为一个topic,各最多8条",
  74. "implementation": "将AI返回的痛点按topic合并,统计frequency,用severity公式排序"
  75. },
  76. "output": "rankedPainPoints"
  77. },
  78. {
  79. "step": 4,
  80. "name": "识别差异化机会",
  81. "type": "compute",
  82. "logic": "identifyOpportunityGaps(rankedPainPoints, targetAsins)",
  83. "algorithm": {
  84. "crossCompare": "对比各竞品ASIN的痛点分布,找出共性痛点和竞品独有痛点",
  85. "opportunity": "共性高频痛点=整个品类机会;竞品独有痛点=针对性超越机会",
  86. "implementation": "按ASIN分组痛点,找出多个ASIN共有的痛点(品类机会)和单ASIN独有的痛点(超越机会)"
  87. },
  88. "output": "opportunities"
  89. },
  90. {
  91. "step": 5,
  92. "name": "VOC驱动优化建议",
  93. "type": "compute",
  94. "logic": "computeVocOptimization(rankedPainPoints, reviewCorpus)",
  95. "algorithm": {
  96. "ratingGapAnalysis": {
  97. "benchmark": 4.6,
  98. "formula": "ratingGap = 4.6 - avgRating",
  99. "conversionImpact": "ratingGap>0 → '差距X分约影响X*100%+的转化率'",
  100. "target": "将均分提升至4.6+进入第一梯队"
  101. },
  102. "themeExtraction": {
  103. "positiveThemes": "从正面评论中提取top5好评主题",
  104. "negativeThemes": "从负面评论中提取top5差评主题"
  105. },
  106. "listingAdvice": [
  107. "标题/五点优先植入好评词根",
  108. "针对差评痛点做针对性承诺,打消用户顾虑,预计提升转化率15%+",
  109. "A+页面突出差异化卖点与使用场景"
  110. ],
  111. "productIterationAdvice": [
  112. "产品升级重点解决top3差评痛点",
  113. "目标将均分提升至4.6+进入第一梯队"
  114. ],
  115. "afterSalesAdvice": [
  116. "建立差评快速响应机制,24小时内联系差评用户解决问题",
  117. "对到货用户精准售后跟进,引导好评",
  118. "针对核心痛点在包裹内放置说明卡片,预计降低退货率10%+"
  119. ]
  120. },
  121. "output": "vocOptimization"
  122. }
  123. ],
  124. "response": {
  125. "type": "object",
  126. "properties": {
  127. "painPoints": {
  128. "type": "array",
  129. "description": "按优先级排序的痛点列表",
  130. "items": {
  131. "type": "object",
  132. "properties": {
  133. "topic": {
  134. "type": "string"
  135. },
  136. "score": {
  137. "type": "integer",
  138. "description": "0-100严重度"
  139. },
  140. "category": {
  141. "type": "string"
  142. },
  143. "frequency": {
  144. "type": "integer"
  145. },
  146. "examples": {
  147. "type": "array",
  148. "items": {
  149. "type": "string"
  150. }
  151. },
  152. "affectedAsins": {
  153. "type": "array",
  154. "items": {
  155. "type": "string"
  156. }
  157. }
  158. }
  159. }
  160. },
  161. "categoryBreakdown": {
  162. "type": "object",
  163. "description": "按类别的痛点分布"
  164. },
  165. "competitorSpecific": {
  166. "type": "object",
  167. "description": "各竞品独有的痛点",
  168. "additionalProperties": {
  169. "type": "array"
  170. }
  171. },
  172. "opportunityGaps": {
  173. "type": "array",
  174. "description": "差异化机会点",
  175. "items": {
  176. "type": "object",
  177. "properties": {
  178. "painPoint": {
  179. "type": "string"
  180. },
  181. "severity": {
  182. "type": "integer"
  183. },
  184. "suggestion": {
  185. "type": "string"
  186. },
  187. "expectedImpact": {
  188. "type": "string",
  189. "enum": [
  190. "high",
  191. "medium",
  192. "low"
  193. ]
  194. }
  195. }
  196. }
  197. },
  198. "vocOptimization": {
  199. "type": "object",
  200. "description": "VOC驱动优化建议",
  201. "properties": {
  202. "ratingGap": {
  203. "type": "number",
  204. "description": "与标枆4.6的差距"
  205. },
  206. "conversionImpact": {
  207. "type": "string",
  208. "description": "差距对转化率的影响估算"
  209. },
  210. "topPositiveThemes": {
  211. "type": "array",
  212. "items": {
  213. "type": "string"
  214. }
  215. },
  216. "topNegativeThemes": {
  217. "type": "array",
  218. "items": {
  219. "type": "string"
  220. }
  221. },
  222. "listingAdvice": {
  223. "type": "array",
  224. "items": {
  225. "type": "string"
  226. }
  227. },
  228. "productIterationAdvice": {
  229. "type": "array",
  230. "items": {
  231. "type": "string"
  232. }
  233. },
  234. "afterSalesAdvice": {
  235. "type": "array",
  236. "items": {
  237. "type": "string"
  238. }
  239. }
  240. }
  241. }
  242. }
  243. },
  244. "timeout": 300000,
  245. "retry": {
  246. "maxAttempts": 2,
  247. "delay": 1000,
  248. "backoffMultiplier": 2
  249. },
  250. "tokenConfig": {
  251. "type": "bearer",
  252. "configFile": "~/.openclaw/voc-credentials.json",
  253. "tokenField": "vocToken",
  254. "resolutionOrder": [
  255. "configFile"
  256. ],
  257. "apigId": "7HwdQZk55B",
  258. "paymentUrlResolution": {
  259. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  260. "steps": [
  261. "1. 从 voc-credentials.json 获取当前 session token",
  262. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  263. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  264. "4. 将该URL展示给用户,引导扫码支付"
  265. ],
  266. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  267. "userResolveHeaders": {
  268. "X-Parse-Application-Id": "ncloudmaster",
  269. "X-Parse-Session-Token": "{vocToken}"
  270. },
  271. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  272. "paymentParams": {
  273. "user": "{resolvedUserId}",
  274. "apigid": "7HwdQZk55B",
  275. "fun_id": "HOkkX72PMF"
  276. },
  277. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  278. },
  279. "onMissing": {
  280. "action": "showPaymentQR",
  281. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  282. "title": "扫码开通 VOC-AI 数据服务",
  283. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  284. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  285. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  286. },
  287. "onBalanceInsufficient": {
  288. "action": "resolveUserThenShowPayment",
  289. "title": "VOC-AI Token 余额不足,请扫码充值",
  290. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  291. }
  292. },
  293. "errorHandling": {
  294. "balanceInsufficient": {
  295. "conditions": [
  296. {
  297. "responseField": "code",
  298. "operator": "in",
  299. "value": [
  300. -2,
  301. -3,
  302. -10,
  303. 402,
  304. 429
  305. ]
  306. },
  307. {
  308. "responseField": "msg",
  309. "operator": "contains",
  310. "value": [
  311. "余额不足",
  312. "insufficient",
  313. "balance",
  314. "quota",
  315. "没有开通",
  316. "权限或余额"
  317. ]
  318. },
  319. {
  320. "responseField": "mess",
  321. "operator": "contains",
  322. "value": [
  323. "余额不足",
  324. "insufficient",
  325. "balance",
  326. "quota",
  327. "没有开通",
  328. "权限或余额"
  329. ]
  330. },
  331. {
  332. "responseField": "message",
  333. "operator": "contains",
  334. "value": [
  335. "余额不足",
  336. "insufficient",
  337. "balance",
  338. "没有开通",
  339. "权限或余额"
  340. ]
  341. }
  342. ],
  343. "matchMode": "any",
  344. "trigger": "tokenConfig.onBalanceInsufficient"
  345. },
  346. "unauthorized": {
  347. "conditions": [
  348. {
  349. "responseField": "code",
  350. "operator": "in",
  351. "value": [
  352. 401,
  353. 403
  354. ]
  355. },
  356. {
  357. "responseField": "msg",
  358. "operator": "contains",
  359. "value": [
  360. "unauthorized",
  361. "token",
  362. "invalid",
  363. "auth"
  364. ]
  365. }
  366. ],
  367. "matchMode": "any",
  368. "trigger": "tokenConfig.onMissing"
  369. }
  370. }
  371. }