Merge pull request #3 from desirecore/fix/media-skill-dynamic-provider

fix: 媒体技能动态 provider 发现
This commit is contained in:
2026-05-10 00:58:18 +08:00
committed by GitHub
4 changed files with 36 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ description: >-
AI 作曲、创作歌曲、写一首歌、音乐生成、AI 音乐、MiniMax 音乐、 AI 作曲、创作歌曲、写一首歌、音乐生成、AI 音乐、MiniMax 音乐、
作词作曲、纯音乐、伴奏、翻唱、cover。 作词作曲、纯音乐、伴奏、翻唱、cover。
license: Complete terms in LICENSE.txt license: Complete terms in LICENSE.txt
version: 1.1.2 version: 1.1.3
type: procedural type: procedural
risk_level: low risk_level: low
status: enabled status: enabled
@@ -123,7 +123,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -146,7 +147,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -259,7 +261,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -282,7 +285,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
- `base_resp.status_code: 1008`: insufficient balance - `base_resp.status_code: 1008`: insufficient balance
- `base_resp.status_code: 1026`: content sensitive, modify the lyrics or prompt and retry - `base_resp.status_code: 1026`: content sensitive, modify the lyrics or prompt and retry
- `base_resp.status_code: 2013`: parameter error, check required fields - `base_resp.status_code: 2013`: parameter error, check required fields
- `success: false` + `error: "未找到匹配的供应商"`: MiniMax Provider not configured - `success: false` + `error: "未找到匹配的供应商"`: No enabled MiniMax provider with `music_gen` service found
### Notes ### Notes

View File

@@ -58,7 +58,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -81,7 +82,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -194,7 +196,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "music_gen",
"endpoint": "/music_generation", "endpoint": "/music_generation",
"body": { "body": {
"model": "music-2.6", "model": "music-2.6",
@@ -217,7 +220,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
- `base_resp.status_code: 1008`:余额不足 - `base_resp.status_code: 1008`:余额不足
- `base_resp.status_code: 1026`:内容敏感,修改歌词或 prompt 后重试 - `base_resp.status_code: 1026`:内容敏感,修改歌词或 prompt 后重试
- `base_resp.status_code: 2013`:参数错误,检查必填字段 - `base_resp.status_code: 2013`:参数错误,检查必填字段
- `success: false` + `error: "未找到匹配的供应商"`:未配置 MiniMax Provider - `success: false` + `error: "未找到匹配的供应商"`:未找到已启用且支持 `music_gen` 服务的 MiniMax Provider
### 注意事项 ### 注意事项

View File

@@ -7,7 +7,7 @@ description: >-
Use when 用户提到 生成视频、文生视频、AI 视频、创建视频、视频生成、 Use when 用户提到 生成视频、文生视频、AI 视频、创建视频、视频生成、
动画生成、MiniMax 视频、海螺、Hailuo、图片变视频、图生视频。 动画生成、MiniMax 视频、海螺、Hailuo、图片变视频、图生视频。
license: Complete terms in LICENSE.txt license: Complete terms in LICENSE.txt
version: 1.2.1 version: 1.2.2
type: procedural type: procedural
risk_level: low risk_level: low
status: enabled status: enabled
@@ -76,7 +76,7 @@ market:
### Prerequisites ### Prerequisites
- The user has already configured the MiniMax Media Provider in Resource Manager → Compute and entered the API Key - The user has already configured and enabled a MiniMax Provider (regular API or Token Plan) in Resource Manager → Compute and entered the API Key
- agent-service is running - agent-service is running
### Core Concept: Three-Step Asynchronous Flow ### Core Concept: Three-Step Asynchronous Flow
@@ -107,7 +107,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "video_gen",
"endpoint": "/video_generation", "endpoint": "/video_generation",
"body": { "body": {
"model": "MiniMax-Hailuo-2.3", "model": "MiniMax-Hailuo-2.3",
@@ -130,7 +131,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "video_gen",
"endpoint": "/video_generation", "endpoint": "/video_generation",
"body": { "body": {
"model": "MiniMax-Hailuo-2.3", "model": "MiniMax-Hailuo-2.3",
@@ -151,7 +153,8 @@ TASK_ID="task_id returned from step 1"
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{ -d "{
\"providerId\": \"provider-minimax-media-001\", \"provider\": \"minimax\",
\"serviceType\": \"video_gen\",
\"endpoint\": \"/query/video_generation?task_id=${TASK_ID}\", \"endpoint\": \"/query/video_generation?task_id=${TASK_ID}\",
\"method\": \"GET\", \"method\": \"GET\",
\"responseType\": \"json\" \"responseType\": \"json\"
@@ -192,7 +195,8 @@ FILE_ID="file_id returned from step 2"
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{ -d "{
\"providerId\": \"provider-minimax-media-001\", \"provider\": \"minimax\",
\"serviceType\": \"video_gen\",
\"endpoint\": \"/files/retrieve?file_id=${FILE_ID}\", \"endpoint\": \"/files/retrieve?file_id=${FILE_ID}\",
\"method\": \"GET\", \"method\": \"GET\",
\"responseType\": \"json\" \"responseType\": \"json\"
@@ -226,7 +230,7 @@ Write Markdown image syntax directly in your reply (the frontend will automatica
### Error Handling ### Error Handling
- `status: "Fail"`: video generation failed; explain to the user - `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: "No matching provider found"`: No enabled MiniMax provider with `video_gen` service found
- `success: false` + `error: "API Key not configured"`: API Key has not been entered - `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 - **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 - Polling exceeds 10 minutes without completion: inform the user that the task may have timed out

View File

@@ -12,7 +12,7 @@
### 前置条件 ### 前置条件
- 用户已在资源管理器-算力中配置 MiniMax Media Provider 并填写 API Key - 用户已在资源管理器-算力中配置并启用 MiniMax Provider(常规 API 或 Token Plan并填写 API Key
- agent-service 正在运行 - agent-service 正在运行
### 核心概念:三步异步流程 ### 核心概念:三步异步流程
@@ -43,7 +43,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "video_gen",
"endpoint": "/video_generation", "endpoint": "/video_generation",
"body": { "body": {
"model": "MiniMax-Hailuo-2.3", "model": "MiniMax-Hailuo-2.3",
@@ -66,7 +67,8 @@ PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"providerId": "provider-minimax-media-001", "provider": "minimax",
"serviceType": "video_gen",
"endpoint": "/video_generation", "endpoint": "/video_generation",
"body": { "body": {
"model": "MiniMax-Hailuo-2.3", "model": "MiniMax-Hailuo-2.3",
@@ -87,7 +89,8 @@ TASK_ID="第一步返回的task_id"
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{ -d "{
\"providerId\": \"provider-minimax-media-001\", \"provider\": \"minimax\",
\"serviceType\": \"video_gen\",
\"endpoint\": \"/query/video_generation?task_id=${TASK_ID}\", \"endpoint\": \"/query/video_generation?task_id=${TASK_ID}\",
\"method\": \"GET\", \"method\": \"GET\",
\"responseType\": \"json\" \"responseType\": \"json\"
@@ -128,7 +131,8 @@ FILE_ID="第二步返回的file_id"
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{ -d "{
\"providerId\": \"provider-minimax-media-001\", \"provider\": \"minimax\",
\"serviceType\": \"video_gen\",
\"endpoint\": \"/files/retrieve?file_id=${FILE_ID}\", \"endpoint\": \"/files/retrieve?file_id=${FILE_ID}\",
\"method\": \"GET\", \"method\": \"GET\",
\"responseType\": \"json\" \"responseType\": \"json\"
@@ -162,7 +166,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
### 错误处理 ### 错误处理
- `status: "Fail"`:视频生成失败,向用户说明 - `status: "Fail"`:视频生成失败,向用户说明
- `success: false` + `error: "未找到匹配的供应商"`:未配置 MiniMax Media Provider - `success: false` + `error: "未找到匹配的供应商"`:未找到已启用且支持 `video_gen` 服务的 MiniMax Provider
- `success: false` + `error: "未配置 API Key"`:未填写 API Key - `success: false` + `error: "未配置 API Key"`:未填写 API Key
- **额度不足**`statusCode: 429``insufficient_quota``balance` 相关错误文生视频无法降级Fast 模型不支持 T2V告知用户额度不足图生视频可换用 `MiniMax-Hailuo-2.3-fast` 从第一步重试 - **额度不足**`statusCode: 429``insufficient_quota``balance` 相关错误文生视频无法降级Fast 模型不支持 T2V告知用户额度不足图生视频可换用 `MiniMax-Hailuo-2.3-fast` 从第一步重试
- 轮询超过 10 分钟未完成:告知用户任务可能超时 - 轮询超过 10 分钟未完成:告知用户任务可能超时