api-config.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. {
  2. "name": "review-highlight-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. "highlightCategories": {
  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": "filterPositiveReviews(reviewCorpus.reviews, { stars: [4, 5], targetAsins })",
  45. "algorithm": {
  46. "filter": "star>=4 && (targetAsins.length==0 || targetAsins.includes(asin))",
  47. "implementation": "遍历reviews数组,保留star>=4的评论,可选按targetAsins进一步过滤"
  48. },
  49. "output": "positiveReviews"
  50. },
  51. {
  52. "step": 2,
  53. "name": "AI提取亮点主题",
  54. "type": "ai",
  55. "logic": "extractHighlights(positiveReviews, { highlightCategories })",
  56. "aiConfig": {
  57. "systemPrompt": "你是跨境电商VOC分析师。只输出一个合法JSON对象。禁止输出Markdown、代码围栏、解释文字。",
  58. "userPromptTemplate": "以下是好评样本([星级][ASIN] 标题 | 摘要)。请归纳产品亮点主题,按用户认可度排序:\n${payload}",
  59. "outputFormat": "{\"highlights\":[{\"topic\":\"穿着舒适\",\"score\":90,\"category\":\"使用体验\",\"examples\":[\"超级舒服\"]}]}",
  60. "temperature": 0.2,
  61. "maxTokens": 2000,
  62. "payloadFormat": "每条评论格式化为 [star★][ASIN] title | content截取前200字,按batch发送给AI"
  63. },
  64. "output": "rawHighlights"
  65. },
  66. {
  67. "step": 3,
  68. "name": "亮点聚类+热度排序",
  69. "type": "compute",
  70. "logic": "clusterAndRank(rawHighlights, positiveReviews)",
  71. "algorithm": {
  72. "cluster": "语义相近的合并为一个topic,各最多8条",
  73. "hotScore": "score = frequency*0.5 + sentimentIntensity*0.3 + helpfulCount*0.2",
  74. "implementation": "将AI返回的亮点按topic合并,统计frequency,用hotScore公式排序"
  75. },
  76. "output": "rankedHighlights"
  77. },
  78. {
  79. "step": 4,
  80. "name": "识别竞品核心卖点",
  81. "type": "compute",
  82. "logic": "identifyCompetitorAdvantages(rankedHighlights, targetAsins)",
  83. "algorithm": {
  84. "perAsin": "每个ASIN的top3亮点 = 该竞品核心卖点",
  85. "shared": "多个竞品共有的亮点 = 品类基本需求",
  86. "unique": "某竞品独有亮点 = 其差异化优势",
  87. "implementation": "按ASIN分组亮点,找出多个ASIN共有的(品类基本需求)和单ASIN独有的(差异化优势)"
  88. },
  89. "output": "competitorAdvantages"
  90. },
  91. {
  92. "step": 5,
  93. "name": "Listing卖点植入建议",
  94. "type": "compute",
  95. "logic": "generateListingSellpointAdvice(rankedHighlights, competitorAdvantages)",
  96. "algorithm": {
  97. "titleAdvice": {
  98. "rule": "将top3亮点词根植入标题前65字符",
  99. "format": "核心词前置 + 用户意图补充 + 中文意图提示"
  100. },
  101. "bulletAdvice": {
  102. "rule": "前1-2个bullet自然融入高频亮点词",
  103. "highlight": "突出用户意图,与竞品做差异化"
  104. },
  105. "aplusAdvice": "A+页面突出好评主题场景化展示,强化用户信任",
  106. "sellpointPriority": "品类共有亮点(必备基础) > 本品独有亮点(差异化) > 竞品独有亮点(跟进参考)"
  107. },
  108. "output": "listingSellpointAdvice"
  109. }
  110. ],
  111. "response": {
  112. "type": "object",
  113. "properties": {
  114. "highlights": {
  115. "type": "array",
  116. "description": "按频率排序的亮点列表",
  117. "items": {
  118. "type": "object",
  119. "properties": {
  120. "topic": {
  121. "type": "string"
  122. },
  123. "score": {
  124. "type": "integer",
  125. "description": "0-100热度"
  126. },
  127. "category": {
  128. "type": "string"
  129. },
  130. "frequency": {
  131. "type": "integer"
  132. },
  133. "examples": {
  134. "type": "array",
  135. "items": {
  136. "type": "string"
  137. }
  138. }
  139. }
  140. }
  141. },
  142. "competitorAdvantages": {
  143. "type": "object",
  144. "description": "各竞品的独有亮点",
  145. "additionalProperties": {
  146. "type": "array"
  147. }
  148. },
  149. "actionableInsights": {
  150. "type": "array",
  151. "description": "可执行的产品策略建议",
  152. "items": {
  153. "type": "object",
  154. "properties": {
  155. "insight": {
  156. "type": "string"
  157. },
  158. "action": {
  159. "type": "string"
  160. },
  161. "priority": {
  162. "type": "string",
  163. "enum": [
  164. "high",
  165. "medium",
  166. "low"
  167. ]
  168. }
  169. }
  170. }
  171. },
  172. "listingSellpointAdvice": {
  173. "type": "object",
  174. "description": "Listing卖点植入建议",
  175. "properties": {
  176. "titleKeywords": {
  177. "type": "array",
  178. "items": {
  179. "type": "string"
  180. },
  181. "description": "建议植入标题的亮点词根"
  182. },
  183. "bulletHighlights": {
  184. "type": "array",
  185. "items": {
  186. "type": "string"
  187. },
  188. "description": "建议在bullet中突出的卖点"
  189. },
  190. "aplusThemes": {
  191. "type": "array",
  192. "items": {
  193. "type": "string"
  194. },
  195. "description": "A+页面建议展示的场景主题"
  196. },
  197. "sellpointPriority": {
  198. "type": "array",
  199. "items": {
  200. "type": "object",
  201. "properties": {
  202. "sellpoint": {
  203. "type": "string"
  204. },
  205. "type": {
  206. "type": "string",
  207. "enum": [
  208. "required",
  209. "differentiation",
  210. "reference"
  211. ]
  212. },
  213. "source": {
  214. "type": "string"
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "timeout": 300000,
  224. "retry": {
  225. "maxAttempts": 2,
  226. "delay": 1000,
  227. "backoffMultiplier": 2
  228. },
  229. "tokenConfig": {
  230. "type": "bearer",
  231. "configFile": "~/.openclaw/voc-credentials.json",
  232. "tokenField": "vocToken",
  233. "resolutionOrder": [
  234. "configFile"
  235. ],
  236. "apigId": "7HwdQZk55B",
  237. "paymentUrlResolution": {
  238. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  239. "steps": [
  240. "1. 从 voc-credentials.json 获取当前 session token",
  241. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  242. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  243. "4. 将该URL展示给用户,引导扫码支付"
  244. ],
  245. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  246. "userResolveHeaders": {
  247. "X-Parse-Application-Id": "ncloudmaster",
  248. "X-Parse-Session-Token": "{vocToken}"
  249. },
  250. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  251. "paymentParams": {
  252. "user": "{resolvedUserId}",
  253. "apigid": "7HwdQZk55B",
  254. "fun_id": "HOkkX72PMF"
  255. },
  256. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  257. },
  258. "onMissing": {
  259. "action": "showPaymentQR",
  260. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  261. "title": "扫码开通 VOC-AI 数据服务",
  262. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  263. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  264. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  265. },
  266. "onBalanceInsufficient": {
  267. "action": "resolveUserThenShowPayment",
  268. "title": "VOC-AI Token 余额不足,请扫码充值",
  269. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  270. }
  271. },
  272. "errorHandling": {
  273. "balanceInsufficient": {
  274. "conditions": [
  275. {
  276. "responseField": "code",
  277. "operator": "in",
  278. "value": [
  279. -2,
  280. -3,
  281. -10,
  282. 402,
  283. 429
  284. ]
  285. },
  286. {
  287. "responseField": "msg",
  288. "operator": "contains",
  289. "value": [
  290. "余额不足",
  291. "insufficient",
  292. "balance",
  293. "quota",
  294. "没有开通",
  295. "权限或余额"
  296. ]
  297. },
  298. {
  299. "responseField": "mess",
  300. "operator": "contains",
  301. "value": [
  302. "余额不足",
  303. "insufficient",
  304. "balance",
  305. "quota",
  306. "没有开通",
  307. "权限或余额"
  308. ]
  309. },
  310. {
  311. "responseField": "message",
  312. "operator": "contains",
  313. "value": [
  314. "余额不足",
  315. "insufficient",
  316. "balance",
  317. "没有开通",
  318. "权限或余额"
  319. ]
  320. }
  321. ],
  322. "matchMode": "any",
  323. "trigger": "tokenConfig.onBalanceInsufficient"
  324. },
  325. "unauthorized": {
  326. "conditions": [
  327. {
  328. "responseField": "code",
  329. "operator": "in",
  330. "value": [
  331. 401,
  332. 403
  333. ]
  334. },
  335. {
  336. "responseField": "msg",
  337. "operator": "contains",
  338. "value": [
  339. "unauthorized",
  340. "token",
  341. "invalid",
  342. "auth"
  343. ]
  344. }
  345. ],
  346. "matchMode": "any",
  347. "trigger": "tokenConfig.onMissing"
  348. }
  349. }
  350. }