token-config-injection.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "tokenConfig": {
  2. "type": "bearer",
  3. "configFile": "~/.openclaw/voc-credentials.json",
  4. "tokenField": "vocToken",
  5. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  6. "resolutionOrder": ["configFile", "currentToken"],
  7. "onMissing": {
  8. "action": "showPaymentQR",
  9. "qrCodeUrl": "",
  10. "paymentCheckEndpoint": "",
  11. "pollingIntervalMs": 3000,
  12. "pollingTimeoutMs": 300000,
  13. "onPaymentSuccess": "retrySkillWithNewToken",
  14. "title": "扫码开通 VOC-AI 数据服务",
  15. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  16. },
  17. "onBalanceInsufficient": {
  18. "action": "showPaymentQR",
  19. "qrCodeUrl": "",
  20. "paymentCheckEndpoint": "",
  21. "pollingIntervalMs": 3000,
  22. "pollingTimeoutMs": 300000,
  23. "onPaymentSuccess": "retrySkillWithNewToken",
  24. "title": "VOC-AI Token 余额不足,请扫码充值",
  25. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  26. }
  27. },
  28. "errorHandling": {
  29. "balanceInsufficient": {
  30. "conditions": [
  31. { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
  32. { "responseField": "msg", "operator": "contains", "value": ["余额不足", "insufficient", "balance", "quota"] },
  33. { "responseField": "message", "operator": "contains", "value": ["余额不足", "insufficient", "balance"] }
  34. ],
  35. "matchMode": "any",
  36. "trigger": "tokenConfig.onBalanceInsufficient"
  37. },
  38. "unauthorized": {
  39. "conditions": [
  40. { "responseField": "code", "operator": "in", "value": [401, 403] },
  41. { "responseField": "msg", "operator": "contains", "value": ["unauthorized", "token", "invalid", "auth"] }
  42. ],
  43. "matchMode": "any",
  44. "trigger": "tokenConfig.onMissing"
  45. }
  46. }