chore: 暂时下架 openai-image-gen、openai-tts、kling-video-gen 技能

This commit is contained in:
2026-04-27 21:02:37 +08:00
parent 2923f87fa1
commit 20553a5756
3 changed files with 0 additions and 482 deletions

View File

@@ -1,208 +0,0 @@
---
name: 可灵文生视频
description: >-
Use this skill when the user wants to generate videos from text descriptions
or images. Calls the Kling AI video generation API through the media proxy.
Supports text-to-video and image-to-video modes. The API is asynchronous —
submit a task, then poll for completion.
Use when 用户提到 生成视频、文生视频、AI 视频、创建视频、视频生成、
动画生成、可灵、Kling、把图片变成视频、图生视频。
license: Complete terms in LICENSE.txt
version: 1.1.0
type: procedural
risk_level: low
status: enabled
disable-model-invocation: false
provider: kling
tags:
- media
- video
- generation
- kling
requires:
tools:
- Bash
metadata:
author: desirecore
updated_at: '2026-04-25'
market:
icon: >-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="3"
stroke="#AF52DE" stroke-width="1.5" fill="#AF52DE"
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: 基于快手可灵 AI 的文本/图片生成视频技能
category: media
maintainer:
name: DesireCore Official
verified: true
channel: latest
---
# kling-video-gen 技能
## 强制规则(违反将导致功能失败)
1. **必须用 HTTPS 访问 agent-service**`https://127.0.0.1:${PORT}``-k` 跳过证书验证
2. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
3. **轮询间隔 10-15 秒** — 使用 `sleep 10` 等待
## 完整执行流程
### 前置条件
- 用户已在资源管理器-算力中配置可灵 Provider 并填写 API Key
- agent-service 正在运行
### 核心概念:异步任务模式
可灵 API 采用异步任务模式,分两步完成:
1. **提交任务**POST 请求创建视频生成任务,返回 `task_id`
2. **轮询结果**:用 `task_id` 查询任务状态,直到 `task_status``succeed``failed`
### 模型选择
| 模型 | 适用场景 | 特点 |
|------|---------|------|
| kling-v2-5-turbo | 快速生成(推荐默认) | 高性价比720p/1080p |
| kling-v2-5-turbo-pro | 高品质生成 | 1080p/4K |
| kling-v2 | 旗舰文生视频 | 高质量 |
| kling-v2-master | 最高品质 | 1080p/4K耗时较长 |
### 第一步:提交视频生成任务(文生视频)
```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 '{
"provider": "kling",
"serviceType": "video_gen",
"endpoint": "/videos/text2video",
"body": {
"model_name": "kling-v2-5-turbo",
"prompt": "用户描述的视频内容",
"negative_prompt": "",
"cfg_scale": 0.5,
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9"
},
"responseType": "json"
}'
```
从 JSON 响应中提取 `data.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 '{
"provider": "kling",
"serviceType": "video_gen",
"endpoint": "/videos/image2video",
"body": {
"model_name": "kling-v2-5-turbo",
"image": "图片URL或base64",
"prompt": "可选的运动描述",
"cfg_scale": 0.5,
"mode": "std",
"duration": "5"
},
"responseType": "json"
}'
```
### 第二步:轮询任务状态
每隔 10-15 秒调用一次,直到 `task_status``succeed``failed`。将 `TASK_ID` 替换为第一步返回的 `task_id`。图生视频查询路径改为 `/videos/image2video/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 "{
\"provider\": \"kling\",
\"serviceType\": \"video_gen\",
\"endpoint\": \"/videos/text2video/${TASK_ID}\",
\"method\": \"GET\",
\"responseType\": \"json\"
}"
```
轮询响应示例(进行中):
```json
{
"success": true,
"data": {
"code": 0,
"data": {
"task_id": "task_xxx",
"task_status": "processing",
"task_status_msg": "Generating video..."
}
}
}
```
完成响应示例:
```json
{
"success": true,
"data": {
"code": 0,
"data": {
"task_id": "task_xxx",
"task_status": "succeed",
"task_result": {
"videos": [
{
"id": "video_xxx",
"url": "https://...",
"duration": "5.0"
}
]
}
}
}
}
```
### 第三步:展示结果
任务完成后从 `data.data.task_result.videos[0].url` 获取视频 URL直接展示给用户。
### 参数说明
| 参数 | 说明 | 可选值 |
|------|------|--------|
| model_name | 模型名称 | kling-v2-5-turbo默认, kling-v2-5-turbo-pro, kling-v2, kling-v2-master |
| prompt | 视频描述 | 文本字符串 |
| negative_prompt | 不希望出现的内容 | 文本字符串(可选) |
| cfg_scale | 创意自由度 | 0-1默认 0.5 |
| mode | 生成模式 | "std"(标准), "pro"(高品质) |
| duration | 视频时长(秒) | "5" 或 "10" |
| aspect_ratio | 画面比例 | "16:9", "9:16", "1:1" |
### 错误处理
- `task_status: "failed"`:生成失败,向用户说明(可能是内容政策或参数错误)
- `success: false` + `error: "未找到匹配的供应商"`:用户未配置可灵 Provider
- `success: false` + `error: "未配置 API Key"`:用户未填写可灵 API Key
- 连续轮询超过 5 分钟未完成:告知用户任务可能超时,建议重试
### 注意事项
- 可灵视频生成是异步的,通常需要 1-5 分钟
- 轮询间隔建议 10-15 秒,不要太频繁
- 生成的视频 URL 有时效限制,建议及时保存
- 如果用户未明确要求,默认使用 `kling-v2-5-turbo` + `std` + `5秒` + `16:9`

View File

@@ -1,120 +0,0 @@
---
name: OpenAI 文生图
description: >-
Use this skill when the user wants to generate images from text descriptions.
Calls the OpenAI DALL-E 3 API through the media proxy to create images.
Supports different sizes (1024x1024, 1792x1024, 1024x1792) and styles
(natural, vivid). Use when 用户提到 生成图片、画图、文生图、创建图片、
AI 绘画、生成插图、画一张、帮我画、设计图片、DALL-E。
license: Complete terms in LICENSE.txt
version: 1.3.0
type: procedural
risk_level: low
status: enabled
disable-model-invocation: false
provider: openai
tags:
- media
- image
- generation
- dall-e
- openai
requires:
tools:
- Bash
metadata:
author: desirecore
updated_at: '2026-04-25'
market:
icon: >-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="3"
stroke="#34C759" stroke-width="1.5" fill="#34C759"
fill-opacity="0.1"/><circle cx="8.5" cy="8.5" r="2" stroke="#34C759"
stroke-width="1.2"/><path d="M3 16l5-5 4 4 3-3 6 6" stroke="#34C759"
stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"/></svg>
short_desc: 基于 OpenAI DALL-E 3 的文本生成图片技能
category: media
maintainer:
name: DesireCore Official
verified: true
channel: latest
---
# openai-image-gen 技能
## 强制规则(违反将导致功能失败)
1. **必须使用 `"response_format": "url"`** — 禁止 `"b64_json"`base64 会导致输出截断
2. **必须用 HTTPS 访问 agent-service**`https://127.0.0.1:${PORT}``-k` 跳过证书验证
3. **必须通过 `/api/media/upload` 上传到 media-store** — 禁止保存到本地路径
4. **必须使用 `dc-media://` 协议展示图片** — 唯一能让前端正确渲染的方式
5. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
## 完整执行流程(严格按此三步执行)
### 第一步:调用 API 生成图片
```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 '{
"provider": "openai",
"serviceType": "image_gen",
"endpoint": "/images/generations",
"body": {
"model": "dall-e-3",
"prompt": "这里替换为图片描述",
"n": 1,
"size": "1024x1024",
"style": "vivid",
"quality": "standard",
"response_format": "url"
},
"responseType": "json"
}'
```
从 JSON 响应中提取 `data.data[0].url` 得到图片 URL。`data.data[0].revised_prompt` 是 DALL-E 优化后的提示词,可展示给用户。
### 第二步:下载并上传到 media-store
OpenAI URL 仅 1 小时有效,必须立即下载。
```bash
PORT=$(cat ~/.desirecore/agent-service.port)
IMAGE_URL="第一步拿到的图片URL"
curl -sL "$IMAGE_URL" -o /tmp/dalle-gen.png && \
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
-F "file=@/tmp/dalle-gen.png;type=image/png"
```
从 JSON 响应中提取 `mediaId` 字段。
### 第三步:用 dc-media 协议展示图片
在你的回复文本中直接写 Markdown 图片语法:
```
![图片描述](dc-media://这里替换为mediaId)
```
前端会自动将 `dc-media://` 转为可访问的图片 URL 并渲染。
## 参数映射
| 用户意图 | size | style | quality |
|---------|------|-------|---------|
| 正方形(默认) | "1024x1024" | "vivid" | "standard" |
| 横版/风景 | "1792x1024" | "vivid" | "standard" |
| 竖版/手机 | "1024x1792" | "vivid" | "standard" |
| 写实/自然 | — | "natural" | — |
| 高清 | — | — | "hd" |
## 错误处理
- `"error": "未找到匹配的供应商"`:未配置 OpenAI Provider
- `statusCode: 401`API Key 无效或过期
- `statusCode: 429`:速率限制,稍后重试

View File

@@ -1,154 +0,0 @@
---
name: OpenAI 语音合成
description: >-
Use this skill when the user wants to convert text to speech audio.
Calls the OpenAI TTS API through the media proxy to generate audio files.
Supports multiple voices (alloy, echo, fable, onyx, nova, shimmer) and
audio formats (mp3, opus, aac, flac).
Use when 用户提到 语音合成、文字转语音、TTS、朗读、读出来、
生成语音、生成音频、文本转音频、配音、念出来。
license: Complete terms in LICENSE.txt
version: 1.1.0
type: procedural
risk_level: low
status: enabled
disable-model-invocation: false
provider: openai
tags:
- media
- audio
- tts
- speech
- openai
requires:
tools:
- Bash
metadata:
author: desirecore
updated_at: '2026-04-25'
market:
icon: >-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="3"
stroke="#007AFF" stroke-width="1.5" fill="#007AFF"
fill-opacity="0.1"/><path d="M8 9v6M11 7v10M14 10v4M17 8v8"
stroke="#007AFF" stroke-width="2"
stroke-linecap="round"/></svg>
short_desc: 基于 OpenAI TTS 的文本转语音技能
category: media
maintainer:
name: DesireCore Official
verified: true
channel: latest
---
# openai-tts 技能
## 强制规则(违反将导致功能失败)
1. **必须用 HTTPS 访问 agent-service**`https://127.0.0.1:${PORT}``-k` 跳过证书验证
2. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
3. **`responseType` 必须为 `"binary"`** — OpenAI TTS 返回二进制音频流,不是 JSON
## 完整执行流程
### 前置条件
- 用户已在资源管理器-算力中配置 OpenAI Provider 并填写 API Key
- agent-service 正在运行
### 语音选择指南
| 语音 | 特点 | 适用场景 |
|------|------|---------|
| alloy | 中性平衡 | 通用(推荐默认) |
| echo | 低沉稳重 | 旁白、播客 |
| fable | 温暖叙事 | 故事、有声书 |
| onyx | 深沉有力 | 新闻播报 |
| nova | 活泼明亮 | 对话、教学 |
| shimmer | 柔和温柔 | 冥想、助眠 |
### 生成语音
```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 '{
"provider": "openai",
"serviceType": "tts",
"endpoint": "/audio/speech",
"body": {
"model": "tts-1",
"input": "要转换的文本内容",
"voice": "alloy",
"response_format": "mp3",
"speed": 1.0
},
"responseType": "binary",
"binaryMimeType": "audio/mpeg"
}'
```
成功响应(代理层自动保存音频文件到 media-store
```json
{
"success": true,
"media": {
"type": "audio",
"mediaId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.mp3",
"name": "media-proxy-generated",
"mimeType": "audio/mpeg",
"size": 123456
},
"statusCode": 200
}
```
### 展示结果
从响应中提取 `media.mediaId`,音频文件可通过以下 URL 访问:
```
https://127.0.0.1:${PORT}/api/media/${mediaId}
```
向用户提供播放链接即可。
### 参数说明
| 参数 | 说明 | 可选值 | 默认值 |
|------|------|--------|--------|
| model | 模型 | "tts-1"(标准), "tts-1-hd"(高清) | tts-1 |
| input | 要转换的文本 | 最大 4096 字符 | — |
| voice | 语音角色 | alloy, echo, fable, onyx, nova, shimmer | alloy |
| response_format | 音频格式 | mp3, opus, aac, flac | mp3 |
| speed | 语速倍率 | 0.25 - 4.0 | 1.0 |
### binaryMimeType 映射
根据 `response_format` 设置对应的 `binaryMimeType`
| response_format | binaryMimeType |
|----------------|----------------|
| mp3 | audio/mpeg |
| opus | audio/opus |
| aac | audio/aac |
| flac | audio/flac |
### 错误处理
- `success: false` + `statusCode: 400`:通常是 input 为空或超长
- `success: false` + `statusCode: 401`API Key 无效或过期
- `success: false` + `statusCode: 429`:速率限制,建议稍后重试
- `success: false` + `error: "未找到匹配的供应商"`:用户未配置 OpenAI Provider
- `success: false` + `error: "未配置 API Key"`:用户未填写 OpenAI API Key
### 注意事项
- OpenAI TTS API 返回的是二进制音频流,不是 JSON所以 `responseType` 必须设为 `"binary"`
- `binaryMimeType` 必须与 `response_format` 对应,否则文件扩展名可能不正确
- `tts-1-hd` 音质更好但生成速度较慢,适合离线场景
- input 最大 4096 字符,超长文本需要分段处理
- 如果用户未明确要求,默认使用 `tts-1` + `alloy` + `mp3` + `1.0` 倍速