api-config.json 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {
  2. "name": "wechat-send-text",
  3. "displayName": "微信发送文字消息",
  4. "description": "向指定微信用户或群聊发送文字消息,是自动应答的核心技能。",
  5. "category": "wechat",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "{{wechatApiBase}}/message/send-text",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": ["toWxid", "content"],
  17. "properties": {
  18. "toWxid": {
  19. "type": "string",
  20. "description": "接收方 wxid(好友wxid 或 群聊id,如 12345@chatroom)"
  21. },
  22. "content": {
  23. "type": "string",
  24. "description": "文字消息内容"
  25. },
  26. "ats": {
  27. "type": "string",
  28. "description": "群聊中 @的用户 wxid,多个用逗号分隔",
  29. "default": ""
  30. }
  31. }
  32. },
  33. "requestTransform": {
  34. "description": "直接透传参数",
  35. "template": {
  36. "toWxid": "{{toWxid}}",
  37. "content": "{{content}}",
  38. "ats": "{{ats}}"
  39. }
  40. },
  41. "response": {
  42. "type": "object",
  43. "properties": {
  44. "ret": { "type": "integer", "description": "200 表示发送成功" },
  45. "msg": { "type": "string", "description": "操作结果描述" }
  46. }
  47. },
  48. "usageExamples": [
  49. {
  50. "name": "回复好友消息",
  51. "input": { "toWxid": "wxid_abc123", "content": "收到,我马上处理!" },
  52. "description": "向好友发送文字回复"
  53. },
  54. {
  55. "name": "群聊发消息",
  56. "input": { "toWxid": "12345678@chatroom", "content": "大家好!", "ats": "" },
  57. "description": "在群聊中发送文字消息"
  58. }
  59. ],
  60. "tokenConfig": {
  61. "type": "config",
  62. "configFile": "~/.openclaw/wechat-credentials.json",
  63. "tokenField": "wechatApiBase",
  64. "currentToken": "http://8.138.37.248/api/wechat-agent",
  65. "resolutionOrder": ["configFile", "currentToken"]
  66. },
  67. "timeout": 15000,
  68. "retry": {
  69. "maxAttempts": 2,
  70. "delay": 1000,
  71. "backoffMultiplier": 2
  72. }
  73. }