| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- {
- "name": "jimeng-task-query",
- "displayName": "即梦任务结果查询",
- "description": "查询即梦AI生成任务状态,轮询获取图片/视频生成结果,支持所有即梦生成接口的结果查询。",
- "category": "jimeng",
- "version": "1.0.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/volcengine/jimeng/getDataByTask02",
- "headers": {
- "Content-Type": "application/json"
- }
- },
- "parameters": {
- "type": "object",
- "required": [
- "routerName",
- "token"
- ],
- "properties": {
- "workId": {
- "type": "string",
- "description": "ImagineWork数据id,与taskId二选一"
- },
- "taskId": {
- "type": "string",
- "description": "任务ID,与workId二选一"
- },
- "routerName": {
- "type": "string",
- "description": "对应接口名称,首次获取资源必填",
- "enum": [
- "getClothesV2",
- "getImgByImg",
- "getImgV4",
- "getText2ImgV3",
- "getText2ImgV31",
- "getImg2ImgV3",
- "getImgV4_pod",
- "getImgV4_goods",
- "getInpaint",
- "getSuperResolution",
- "getVideoV3_720p",
- "getVideoV3_1080p",
- "getVideoV3_Pro",
- "getActor",
- "getActorV2"
- ]
- },
- "logo_info": {
- "type": "object",
- "description": "水印信息(选填)",
- "properties": {
- "add_logo": {
- "type": "boolean",
- "description": "是否添加水印",
- "default": false
- },
- "position": {
- "type": "integer",
- "description": "水印位置: 0右下/1左下/2左上/3右上",
- "default": 0
- },
- "language": {
- "type": "integer",
- "description": "0中文/1英文",
- "default": 0
- },
- "opacity": {
- "type": "number",
- "description": "不透明度[0,1]",
- "default": 1
- },
- "logo_text_content": {
- "type": "string",
- "description": "自定义水印文本"
- }
- }
- },
- "token": {
- "type": "string",
- "description": "认证token,格式: Bearer r:xxxxxxxx"
- }
- }
- },
- "requestTransform": {
- "template": {
- "workId": "{{workId}}",
- "taskId": "{{taskId}}",
- "routerName": "{{routerName}}",
- "logo_info": "{{logo_info}}",
- "token": "{{token}}"
- }
- },
- "response": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "description": "响应状态码,200表示成功"
- },
- "data": {
- "type": "object",
- "properties": {
- "tip": {
- "type": "string",
- "description": "状态提示文字"
- },
- "isFinish": {
- "type": "boolean",
- "description": "true表示任务完成"
- }
- }
- }
- }
- },
- "notes": "轮询策略:每3-5秒调用一次,直到 data.isFinish=true。任务完成后查询 ImagineWork 表获取 images/videos 字段。",
- "usageExamples": [
- {
- "name": "查询图片生成任务状态",
- "input": {
- "workId": "82CC78HNl6",
- "routerName": "getImgV4",
- "token": "Bearer r:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- },
- "description": "查询 getImgV4 图片生成任务的完成状态"
- }
- ],
- "pollingConfig": {
- "intervalMs": 3000,
- "maxAttempts": 60,
- "completionCondition": "data.isFinish === true"
- },
- "timeout": 15000,
- "retry": {
- "maxAttempts": 3,
- "delay": 1000,
- "backoffMultiplier": 2
- },
- "tokenConfig": {
- "type": "body",
- "tokenField": "token",
- "format": "Bearer r:{{jimengToken}}",
- "configFile": "~/.openclaw/voc-credentials.json",
- "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
- "resolutionOrder": [
- "configFile",
- "currentToken"
- ],
- "onMissing": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?authid=T0iOotHcDX",
- "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
- "pollingIntervalMs": 3000,
- "pollingTimeoutMs": 300000,
- "onPaymentSuccess": "retrySkillWithNewToken",
- "title": "扫码开通即梦AI生成服务",
- "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
- },
- "onBalanceInsufficient": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?authid=T0iOotHcDX",
- "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
- "pollingIntervalMs": 3000,
- "pollingTimeoutMs": 300000,
- "onPaymentSuccess": "retrySkillWithNewToken",
- "title": "即梦AI Token 余额不足,请扫码充值",
- "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- -2,
- -3,
- -10,
- 402,
- 429
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota"
- ]
- },
- {
- "responseField": "message",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- 401,
- 403
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "unauthorized",
- "token",
- "invalid",
- "auth"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- }
- }
|