From bf2bf48e3e0c46a5d3ddd4d3ae9be7d1f604e778 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 6 Aug 2026 18:19:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(uapi):=20uapiio=20input=5Ffields=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20bricks=20=E5=85=BC=E5=AE=B9=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=8Cuapi=20stream=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/minimax_h3_setup.sql | 133 +++++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 41 deletions(-) diff --git a/sql/minimax_h3_setup.sql b/sql/minimax_h3_setup.sql index e9b0d8b..6d50de0 100644 --- a/sql/minimax_h3_setup.sql +++ b/sql/minimax_h3_setup.sql @@ -1,62 +1,113 @@ -- ============================================================ --- MiniMax-H3 Video Generation — UAPI + Pricing 完整部署 SQL --- 执行方式: 在 Sage 管理面板或 MySQL 客户端执行 +-- MiniMax-H3 — uapiio + uapi(bricks input_field 格式) -- ============================================================ --- === 1. uapiio (输入输出定义) === +-- === uapiio === +-- input_fields: bricks兼容格式,数组,每个字段有 name/label/uitype INSERT IGNORE INTO uapiio (id, name, description, input_fields) VALUES ( 'm_h3_video_gen_io', 'MiniMax-H3 视频生成', - 'MiniMax-H3 视频生成v2接口输入输出定义。支持文生视频、图生视频(首尾帧)、多模态参考生视频。', - '{"model":{"type":"string","required":true,"title":"模型名称","enum":["MiniMax-H3"]},"content":{"type":"array","required":true,"title":"多模态输入内容"},"resolution":{"type":"string","required":true,"title":"分辨率","enum":["768P","2K"]},"duration":{"type":"integer","required":true,"title":"时长(秒)","enum":[4,5,6,7,8,9,10,11,12,13,14,15]},"ratio":{"type":"string","title":"宽高比","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"]},"callback_url":{"type":"string","title":"回调地址"},"aigc_watermark":{"type":"boolean","title":"AIGC水印"}}' + 'MiniMax-H3 视频生成v2接口。支持文生视频、图生视频(首帧/尾帧)。', + '[ + { + "name": "prompt", + "label": "提示词", + "required": true, + "uitype": "text" + }, + { + "name": "image_url", + "label": "参考图片(首帧)", + "uitype": "image" + }, + { + "name": "resolution", + "label": "分辨率", + "uitype": "code", + "data": [ + {"value": "768P", "text": "768P"}, + {"value": "2K", "text": "2K"} + ], + "defaultvalue": "768P" + }, + { + "name": "duration", + "label": "视频时长", + "uitype": "code", + "data": [ + {"value": 5, "text": "5秒"}, + {"value": 6, "text": "6秒"}, + {"value": 8, "text": "8秒"}, + {"value": 10, "text": "10秒"} + ], + "defaultvalue": 5 + }, + { + "name": "ratio", + "label": "宽高比", + "uitype": "code", + "data": [ + {"value": "adaptive", "text": "自适应"}, + {"value": "16:9", "text": "16:9"}, + {"value": "9:16", "text": "9:16"}, + {"value": "1:1", "text": "1:1"} + ], + "defaultvalue": "adaptive" + } + ]' ); --- === 2. uapi - 创建视频任务 === +-- === uapi: 创建视频任务 === +-- stream=async, chunk_match=task_id (从响应中提取task_id用于轮询) INSERT IGNORE INTO uapi (id, upappid, name, title, description, need_auth, stream, path, httpmethod, chunk_match, headers, params, data, response, ioid) VALUES ( - 'm_h3_create_task', 'minimax', 'video_generation_v2', + 'm_h3_create_task', + 'minimax', + 'video_generation_v2', 'MiniMax-H3 创建视频任务', - '创建 MiniMax-H3 视频生成任务。返回 task_id,用查询接口轮询结果。', - '0', 'async', '/v2/video_generation', 'POST', 'task_id', - '{"Content-Type":"application/json","Authorization":"Bearer {{apikey}}"}', - NULL, '{{jsondata}}', '{{response}}', 'm_h3_video_gen_io' + '创建 MiniMax-H3 视频生成任务,返回 task_id 用于轮询结果', + '0', + 'async', + '/v2/video_generation', + 'POST', + 'task_id', + '{"Content-Type": "application/json", "Authorization": "Bearer {{apikey}}"}', + NULL, + '{{jsondata}}', + '{{response}}', + 'm_h3_video_gen_io' ); --- === 3. uapi - 查询视频任务 === +-- === uapi: 查询视频任务 === +-- stream=sync (直接返回任务状态) INSERT IGNORE INTO uapi (id, upappid, name, title, description, need_auth, stream, path, httpmethod, chunk_match, headers, params, data, response, ioid) VALUES ( - 'm_h3_query_task', 'minimax', 'query_video_generation', + 'm_h3_query_task', + 'minimax', + 'query_video_generation', 'MiniMax-H3 查询视频任务', - '按 task_id 查询 MiniMax-H3 视频生成任务状态与结果。', - '0', 'sync', '/v2/query/video_generation/{{task_id}}', 'GET', '', - '{"Authorization":"Bearer {{apikey}}"}', - NULL, NULL, '{{response}}', 'm_h3_video_gen_io' + '按 task_id 查询 MiniMax-H3 视频生成任务状态与结果', + '0', + 'sync', + '/v2/query/video_generation/{{task_id}}', + 'GET', + '', + '{"Authorization": "Bearer {{apikey}}"}', + NULL, + NULL, + '{{response}}', + 'm_h3_video_gen_io' ); --- === 4. upapp - 平台注册 === +-- === upapp === INSERT IGNORE INTO upapp (id, name, baseurl, myappid, ownerid, description) VALUES ( - 'minimax', 'minimax', 'https://api.minimax.chat', 'minimax', 'platform', - 'MiniMax 视频生成平台。提供 H3 视频生成模型,支持文生视频、图生视频、多模态参考生视频。' + 'minimax', + 'minimax', + 'https://api.minimax.chat', + 'minimax', + 'platform', + 'MiniMax 视频生成平台。提供 H3 视频生成模型。' ); --- === 5. upappkey - API密钥 (请替换为真实key) === +-- === upappkey (请替换真实API Key) === -- INSERT IGNORE INTO upappkey (id, upappid, orgid, apikey, enabled_date, expired_date) VALUES ( --- 'mk_minimax_default', 'minimax', 'platform', '', '2025-01-01', '9999-12-31' +-- 'mk_minimax_default', 'minimax', 'platform', '', '2025-01-01', '9999-12-31' -- ); - --- ============================================================ --- === 6. Pricing - 定价方案 === --- ============================================================ -INSERT IGNORE INTO pricing_program (id, name, description, unit, unit_price, currency, category, provider, model, resolution) VALUES ( - 'minimax_h3_2k', 'MiniMax-H3-2K', 'MiniMax-H3 2K分辨率视频生成,按秒计费', - 'second', 0.80, 'CNY', 'video_generation', 'minimax', 'MiniMax-H3', '2K' -); - -INSERT IGNORE INTO pricing_program (id, name, description, unit, unit_price, currency, category, provider, model, resolution) VALUES ( - 'minimax_h3_768p', 'MiniMax-H3-768P', 'MiniMax-H3 768P分辨率视频生成,按秒计费', - 'second', 0.50, 'CNY', 'video_generation', 'minimax', 'MiniMax-H3', '768P' -); - --- ============================================================ --- === 7. RBAC - 注册权限 (可选, DSPY已存于uapi仓库) === --- ============================================================ --- INSERT IGNORE INTO permission (id, path, name) VALUES ('perm_minimax_setup', '/uapi/api/minimax_h3_setup.dspy', 'MiniMax-H3 Setup'); --- INSERT IGNORE INTO rolepermission (id, permid, roleid) VALUES ('rp_minimax_setup', 'perm_minimax_setup', 'any');