mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 08:30:42 +08:00
feat: skills i18n 改造(schemaVersion 1.1,零向后兼容) (#1)
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容
把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。
## 关键变更
### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
i18n.<locale>
### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)
### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)
### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude
### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落
## 验证
- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(i18n): 修复 PR #1 review 反馈的 6 项问题
- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
与 zh-CN 版本对齐
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: MiniMax 文生视频
|
||||
name: minimax-video-gen
|
||||
description: >-
|
||||
Use this skill when the user wants to generate videos using MiniMax's
|
||||
Hailuo model. Supports text-to-video, image-to-video, and subject reference.
|
||||
@@ -25,6 +25,29 @@ requires:
|
||||
metadata:
|
||||
author: desirecore
|
||||
updated_at: '2026-04-25'
|
||||
i18n:
|
||||
default_locale: en-US
|
||||
source_locale: zh-CN
|
||||
locales:
|
||||
- zh-CN
|
||||
- en-US
|
||||
zh-CN:
|
||||
name: MiniMax 文生视频
|
||||
short_desc: 基于 MiniMax Hailuo 的文本/图片生成视频技能
|
||||
description: >-
|
||||
Use this skill when the user wants to generate videos using MiniMax's Hailuo model. Supports text-to-video, image-to-video, and subject reference. The API is asynchronous — submit a task, poll for status, then download. Use when 用户提到 生成视频、文生视频、AI 视频、创建视频、视频生成、 动画生成、MiniMax 视频、海螺、Hailuo、图片变视频、图生视频。
|
||||
body: ./SKILL.zh-CN.md
|
||||
source_hash: sha256:57314c8d07d63585
|
||||
translated_by: human
|
||||
en-US:
|
||||
name: MiniMax Video Generation
|
||||
short_desc: Text/image-to-video skill powered by MiniMax Hailuo
|
||||
description: >-
|
||||
Use this skill when the user wants to generate videos using MiniMax's Hailuo model. Supports text-to-video, image-to-video, and subject reference. The API is asynchronous — submit a task, poll for status, then download. Use when the user mentions generating videos, text-to-video, AI video, creating videos, video generation, animation generation, MiniMax video, Hailuo, image-to-video.
|
||||
body: ./SKILL.md
|
||||
source_hash: sha256:57314c8d07d63585
|
||||
translated_by: ai:claude-opus-4-7
|
||||
translated_at: '2026-05-03'
|
||||
market:
|
||||
icon: >-
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
|
||||
@@ -33,7 +56,6 @@ market:
|
||||
fill-opacity="0.1"/><polygon points="10,7 18,12 10,17" fill="#AF52DE"
|
||||
fill-opacity="0.6" stroke="#AF52DE" stroke-width="1.2"
|
||||
stroke-linejoin="round"/></svg>
|
||||
short_desc: 基于 MiniMax Hailuo 的文本/图片生成视频技能
|
||||
category: media
|
||||
maintainer:
|
||||
name: DesireCore Official
|
||||
@@ -42,43 +64,43 @@ market:
|
||||
listed: false
|
||||
---
|
||||
|
||||
# minimax-video-gen 技能
|
||||
# minimax-video-gen Skill
|
||||
|
||||
## 强制规则(违反将导致功能失败)
|
||||
## Mandatory Rules (violation will cause failure)
|
||||
|
||||
1. **必须用 HTTPS 访问 agent-service** — `https://127.0.0.1:${PORT}` 加 `-k` 跳过证书验证
|
||||
2. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
|
||||
3. **轮询间隔 10 秒** — 使用 `sleep 10` 等待
|
||||
1. **Must use HTTPS to access agent-service** — `https://127.0.0.1:${PORT}` with `-k` to skip certificate verification
|
||||
2. **Use Bash curl throughout** — do not use the HttpRequest tool or Python
|
||||
3. **Polling interval is 10 seconds** — use `sleep 10` to wait
|
||||
|
||||
## 完整执行流程
|
||||
## Full Execution Flow
|
||||
|
||||
### 前置条件
|
||||
### Prerequisites
|
||||
|
||||
- 用户已在资源管理器-算力中配置 MiniMax Media Provider 并填写 API Key
|
||||
- agent-service 正在运行
|
||||
- The user has already configured the MiniMax Media Provider in Resource Manager → Compute and entered the API Key
|
||||
- agent-service is running
|
||||
|
||||
### 核心概念:三步异步流程
|
||||
### Core Concept: Three-Step Asynchronous Flow
|
||||
|
||||
MiniMax 视频生成采用异步任务模式:
|
||||
MiniMax video generation uses an asynchronous task model:
|
||||
|
||||
1. **提交任务**:POST 创建视频生成任务,返回 `task_id`
|
||||
2. **轮询状态**:用 `task_id` 查询任务状态,直到 `status` 为 `"Success"` 或 `"Fail"`
|
||||
3. **下载视频**:用 `file_id` 获取下载 URL
|
||||
1. **Submit task**: POST to create a video generation task and receive a `task_id`
|
||||
2. **Poll status**: query the task status with `task_id` until `status` is `"Success"` or `"Fail"`
|
||||
3. **Download video**: use `file_id` to obtain the download URL
|
||||
|
||||
### 模型选择与降级策略
|
||||
### Model Selection and Fallback Strategy
|
||||
|
||||
| 模型 | 支持模式 | 特点 | 适用场景 |
|
||||
| Model | Supported Modes | Characteristics | Use Case |
|
||||
|------|---------|------|---------|
|
||||
| MiniMax-Hailuo-2.3 | 文生视频 + 图生视频 | 最高画质,默认首选 | 用户未指定时的默认选择 |
|
||||
| MiniMax-Hailuo-2.3-fast | **仅图生视频** | 速度快,成本低 50% | 图生视频场景下额度不足时降级 |
|
||||
| MiniMax-Hailuo-2.3 | Text-to-video + image-to-video | Highest quality, default first choice | Default when the user doesn't specify |
|
||||
| MiniMax-Hailuo-2.3-fast | **Image-to-video only** | Fast, 50% lower cost | Fallback when quota is insufficient in image-to-video scenarios |
|
||||
|
||||
**降级规则(强制)**:
|
||||
1. 默认使用 `MiniMax-Hailuo-2.3`
|
||||
2. **文生视频(T2V)额度不足时**:`MiniMax-Hailuo-2.3-fast` 不支持文生视频,无法降级。应直接告知用户额度不足,建议等待额度重置或切换到其他视频生成服务(如可灵)
|
||||
3. **图生视频(I2V)额度不足时**:可降级到 `MiniMax-Hailuo-2.3-fast`,告知用户"已切换到快速模型生成"
|
||||
4. 如果用户做图生视频且明确要求快速生成,直接使用 `MiniMax-Hailuo-2.3-fast`
|
||||
**Fallback rules (mandatory)**:
|
||||
1. Use `MiniMax-Hailuo-2.3` by default
|
||||
2. **When text-to-video (T2V) quota is insufficient**: `MiniMax-Hailuo-2.3-fast` does not support text-to-video and cannot be used as a fallback. Inform the user directly that the quota is insufficient and suggest waiting for the quota to reset or switching to another video generation service (such as Kling)
|
||||
3. **When image-to-video (I2V) quota is insufficient**: fall back to `MiniMax-Hailuo-2.3-fast` and inform the user "switched to the fast model for generation"
|
||||
4. If the user is doing image-to-video and explicitly requests fast generation, use `MiniMax-Hailuo-2.3-fast` directly
|
||||
|
||||
### 第一步:提交文生视频任务
|
||||
### Step 1: Submit a Text-to-Video Task
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
@@ -89,19 +111,19 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
"endpoint": "/video_generation",
|
||||
"body": {
|
||||
"model": "MiniMax-Hailuo-2.3",
|
||||
"prompt": "用户描述的视频内容"
|
||||
"prompt": "Video content described by the user"
|
||||
},
|
||||
"responseType": "json"
|
||||
}'
|
||||
```
|
||||
|
||||
可选参数(加入 body 中):
|
||||
- `"duration"`: 视频时长秒数(6 或 10)
|
||||
- `"resolution"`: `"768P"` 或 `"1080P"`
|
||||
Optional parameters (add to the body):
|
||||
- `"duration"`: video length in seconds (6 or 10)
|
||||
- `"resolution"`: `"768P"` or `"1080P"`
|
||||
|
||||
从 JSON 响应中提取 `data.task_id`。
|
||||
Extract `data.task_id` from the JSON response.
|
||||
|
||||
### 第一步(备选):图生视频
|
||||
### Step 1 (alternative): Image-to-Video
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
@@ -112,20 +134,20 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
"endpoint": "/video_generation",
|
||||
"body": {
|
||||
"model": "MiniMax-Hailuo-2.3",
|
||||
"prompt": "描述图片中场景的动态变化",
|
||||
"first_frame_image": "https://图片URL"
|
||||
"prompt": "Describe the dynamic changes of the scene in the image",
|
||||
"first_frame_image": "https://image-URL"
|
||||
},
|
||||
"responseType": "json"
|
||||
}'
|
||||
```
|
||||
|
||||
### 第二步:轮询任务状态
|
||||
### Step 2: Poll the Task Status
|
||||
|
||||
每隔 10 秒调用一次,直到 `status` 为 `"Success"` 或 `"Fail"`。将 `TASK_ID` 替换为第一步返回的 `task_id`。
|
||||
Call once every 10 seconds until `status` is `"Success"` or `"Fail"`. Replace `TASK_ID` with the `task_id` returned in Step 1.
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
TASK_ID="第一步返回的task_id"
|
||||
TASK_ID="task_id returned from step 1"
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
@@ -136,7 +158,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}"
|
||||
```
|
||||
|
||||
轮询响应(进行中):
|
||||
Polling response (in progress):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
@@ -148,7 +170,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}
|
||||
```
|
||||
|
||||
轮询响应(完成):
|
||||
Polling response (completed):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
@@ -160,13 +182,13 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}
|
||||
```
|
||||
|
||||
### 第三步:获取视频下载链接
|
||||
### Step 3: Get the Video Download URL
|
||||
|
||||
将 `FILE_ID` 替换为第二步完成响应中的 `file_id`。
|
||||
Replace `FILE_ID` with the `file_id` from the completed response in Step 2.
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
FILE_ID="第二步返回的file_id"
|
||||
FILE_ID="file_id returned from step 2"
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
@@ -177,41 +199,41 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}"
|
||||
```
|
||||
|
||||
从响应中提取 `data.file.download_url`。
|
||||
Extract `data.file.download_url` from the response.
|
||||
|
||||
### 第四步:下载并上传到 media-store
|
||||
### Step 4: Download and Upload to media-store
|
||||
|
||||
下载 URL 有 24 小时时效,必须立即下载并保存到本地 media-store。
|
||||
The download URL is valid for 24 hours; you must download immediately and save it to the local media-store.
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
VIDEO_URL="第三步获取的download_url"
|
||||
VIDEO_URL="download_url obtained in step 3"
|
||||
curl -sL "$VIDEO_URL" -o /tmp/minimax-video.mp4 && \
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
|
||||
-F "file=@/tmp/minimax-video.mp4;type=video/mp4"
|
||||
```
|
||||
|
||||
从 JSON 响应中提取 `mediaId` 字段。
|
||||
Extract the `mediaId` field from the JSON response.
|
||||
|
||||
### 第五步:用 dc-media 协议展示视频
|
||||
### Step 5: Display the Video Using the dc-media Protocol
|
||||
|
||||
在你的回复文本中直接写 Markdown 图片语法(前端会自动识别视频扩展名并渲染播放器):
|
||||
Write Markdown image syntax directly in your reply (the frontend will automatically recognize the video extension and render a player):
|
||||
|
||||
```
|
||||

|
||||

|
||||
```
|
||||
|
||||
### 错误处理
|
||||
### Error Handling
|
||||
|
||||
- `status: "Fail"`:视频生成失败,向用户说明
|
||||
- `success: false` + `error: "未找到匹配的供应商"`:未配置 MiniMax Media Provider
|
||||
- `success: false` + `error: "未配置 API Key"`:未填写 API Key
|
||||
- **额度不足**(`statusCode: 429`、`insufficient_quota`、`balance` 相关错误):文生视频无法降级(Fast 模型不支持 T2V),告知用户额度不足;图生视频可换用 `MiniMax-Hailuo-2.3-fast` 从第一步重试
|
||||
- 轮询超过 10 分钟未完成:告知用户任务可能超时
|
||||
- `status: "Fail"`: video generation failed; explain to the user
|
||||
- `success: false` + `error: "No matching provider found"`: MiniMax Media Provider is not configured
|
||||
- `success: false` + `error: "API Key not configured"`: API Key has not been entered
|
||||
- **Insufficient quota** (errors related to `statusCode: 429`, `insufficient_quota`, `balance`): text-to-video cannot fall back (the Fast model does not support T2V); inform the user of insufficient quota; image-to-video can switch to `MiniMax-Hailuo-2.3-fast` and retry from Step 1
|
||||
- Polling exceeds 10 minutes without completion: inform the user that the task may have timed out
|
||||
|
||||
### 注意事项
|
||||
### Notes
|
||||
|
||||
- MiniMax 视频生成是异步的,通常需要 2-10 分钟
|
||||
- 轮询间隔建议 10 秒
|
||||
- 下载 URL 有 24 小时时效
|
||||
- 如果用户未明确要求,默认不传 duration 和 resolution(使用 API 默认值)
|
||||
- MiniMax video generation is asynchronous and typically takes 2–10 minutes
|
||||
- A polling interval of 10 seconds is recommended
|
||||
- The download URL is valid for 24 hours
|
||||
- If the user does not explicitly request otherwise, by default do not pass `duration` or `resolution` (use API defaults)
|
||||
|
||||
175
skills/minimax-video-gen/SKILL.zh-CN.md
Normal file
175
skills/minimax-video-gen/SKILL.zh-CN.md
Normal file
@@ -0,0 +1,175 @@
|
||||
<!-- locale: zh-CN -->
|
||||
|
||||
# minimax-video-gen 技能
|
||||
|
||||
## 强制规则(违反将导致功能失败)
|
||||
|
||||
1. **必须用 HTTPS 访问 agent-service** — `https://127.0.0.1:${PORT}` 加 `-k` 跳过证书验证
|
||||
2. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
|
||||
3. **轮询间隔 10 秒** — 使用 `sleep 10` 等待
|
||||
|
||||
## 完整执行流程
|
||||
|
||||
### 前置条件
|
||||
|
||||
- 用户已在资源管理器-算力中配置 MiniMax Media Provider 并填写 API Key
|
||||
- agent-service 正在运行
|
||||
|
||||
### 核心概念:三步异步流程
|
||||
|
||||
MiniMax 视频生成采用异步任务模式:
|
||||
|
||||
1. **提交任务**:POST 创建视频生成任务,返回 `task_id`
|
||||
2. **轮询状态**:用 `task_id` 查询任务状态,直到 `status` 为 `"Success"` 或 `"Fail"`
|
||||
3. **下载视频**:用 `file_id` 获取下载 URL
|
||||
|
||||
### 模型选择与降级策略
|
||||
|
||||
| 模型 | 支持模式 | 特点 | 适用场景 |
|
||||
|------|---------|------|---------|
|
||||
| MiniMax-Hailuo-2.3 | 文生视频 + 图生视频 | 最高画质,默认首选 | 用户未指定时的默认选择 |
|
||||
| MiniMax-Hailuo-2.3-fast | **仅图生视频** | 速度快,成本低 50% | 图生视频场景下额度不足时降级 |
|
||||
|
||||
**降级规则(强制)**:
|
||||
1. 默认使用 `MiniMax-Hailuo-2.3`
|
||||
2. **文生视频(T2V)额度不足时**:`MiniMax-Hailuo-2.3-fast` 不支持文生视频,无法降级。应直接告知用户额度不足,建议等待额度重置或切换到其他视频生成服务(如可灵)
|
||||
3. **图生视频(I2V)额度不足时**:可降级到 `MiniMax-Hailuo-2.3-fast`,告知用户"已切换到快速模型生成"
|
||||
4. 如果用户做图生视频且明确要求快速生成,直接使用 `MiniMax-Hailuo-2.3-fast`
|
||||
|
||||
### 第一步:提交文生视频任务
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"providerId": "provider-minimax-media-001",
|
||||
"endpoint": "/video_generation",
|
||||
"body": {
|
||||
"model": "MiniMax-Hailuo-2.3",
|
||||
"prompt": "用户描述的视频内容"
|
||||
},
|
||||
"responseType": "json"
|
||||
}'
|
||||
```
|
||||
|
||||
可选参数(加入 body 中):
|
||||
- `"duration"`: 视频时长秒数(6 或 10)
|
||||
- `"resolution"`: `"768P"` 或 `"1080P"`
|
||||
|
||||
从 JSON 响应中提取 `data.task_id`。
|
||||
|
||||
### 第一步(备选):图生视频
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"providerId": "provider-minimax-media-001",
|
||||
"endpoint": "/video_generation",
|
||||
"body": {
|
||||
"model": "MiniMax-Hailuo-2.3",
|
||||
"prompt": "描述图片中场景的动态变化",
|
||||
"first_frame_image": "https://图片URL"
|
||||
},
|
||||
"responseType": "json"
|
||||
}'
|
||||
```
|
||||
|
||||
### 第二步:轮询任务状态
|
||||
|
||||
每隔 10 秒调用一次,直到 `status` 为 `"Success"` 或 `"Fail"`。将 `TASK_ID` 替换为第一步返回的 `task_id`。
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
TASK_ID="第一步返回的task_id"
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"providerId\": \"provider-minimax-media-001\",
|
||||
\"endpoint\": \"/query/video_generation?task_id=${TASK_ID}\",
|
||||
\"method\": \"GET\",
|
||||
\"responseType\": \"json\"
|
||||
}"
|
||||
```
|
||||
|
||||
轮询响应(进行中):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"task_id": "task_xxx",
|
||||
"status": "Processing",
|
||||
"file_id": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
轮询响应(完成):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"task_id": "task_xxx",
|
||||
"status": "Success",
|
||||
"file_id": "file_xxx"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 第三步:获取视频下载链接
|
||||
|
||||
将 `FILE_ID` 替换为第二步完成响应中的 `file_id`。
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
FILE_ID="第二步返回的file_id"
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"providerId\": \"provider-minimax-media-001\",
|
||||
\"endpoint\": \"/files/retrieve?file_id=${FILE_ID}\",
|
||||
\"method\": \"GET\",
|
||||
\"responseType\": \"json\"
|
||||
}"
|
||||
```
|
||||
|
||||
从响应中提取 `data.file.download_url`。
|
||||
|
||||
### 第四步:下载并上传到 media-store
|
||||
|
||||
下载 URL 有 24 小时时效,必须立即下载并保存到本地 media-store。
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
VIDEO_URL="第三步获取的download_url"
|
||||
curl -sL "$VIDEO_URL" -o /tmp/minimax-video.mp4 && \
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
|
||||
-F "file=@/tmp/minimax-video.mp4;type=video/mp4"
|
||||
```
|
||||
|
||||
从 JSON 响应中提取 `mediaId` 字段。
|
||||
|
||||
### 第五步:用 dc-media 协议展示视频
|
||||
|
||||
在你的回复文本中直接写 Markdown 图片语法(前端会自动识别视频扩展名并渲染播放器):
|
||||
|
||||
```
|
||||

|
||||
```
|
||||
|
||||
### 错误处理
|
||||
|
||||
- `status: "Fail"`:视频生成失败,向用户说明
|
||||
- `success: false` + `error: "未找到匹配的供应商"`:未配置 MiniMax Media Provider
|
||||
- `success: false` + `error: "未配置 API Key"`:未填写 API Key
|
||||
- **额度不足**(`statusCode: 429`、`insufficient_quota`、`balance` 相关错误):文生视频无法降级(Fast 模型不支持 T2V),告知用户额度不足;图生视频可换用 `MiniMax-Hailuo-2.3-fast` 从第一步重试
|
||||
- 轮询超过 10 分钟未完成:告知用户任务可能超时
|
||||
|
||||
### 注意事项
|
||||
|
||||
- MiniMax 视频生成是异步的,通常需要 2-10 分钟
|
||||
- 轮询间隔建议 10 秒
|
||||
- 下载 URL 有 24 小时时效
|
||||
- 如果用户未明确要求,默认不传 duration 和 resolution(使用 API 默认值)
|
||||
Reference in New Issue
Block a user