fix(dashscope-image-gen): 移除硬编码 provider,改用 serviceType 自动发现 (#23)

## Summary

- 移除 `media-proxy` curl 命令中硬编码的 `"provider": "dashscope"`,改为仅传
`"serviceType": "image_gen"` 让系统自动匹配已启用的供应商
- 修改 frontmatter `provider: dashscope` → `provider: auto`
- 更新前置条件和错误处理描述,不再要求配置 DashScope 专用 Provider
- Bump version 1.1.1 → 1.2.0

## Background

之前技能硬编码了 `"provider": "dashscope"`,导致使用中转 key(如 DesireCore Cloud /
鹏耀科技)时 `findProvider` 按 slug 匹配不到已启用的供应商,文生图功能无法使用。

改为 `serviceType: "image_gen"` 自动发现后,`findProvider` 会在所有已启用的 provider
中查找支持 `image_gen` 服务类型的供应商,兼容直连和中转场景。

## Changes

| File | Change |
|------|--------|
| `SKILL.md` | 去掉 curl 中 `"provider": "dashscope"`;更新 prerequisites /
error handling |
| `SKILL.zh-CN.md` | 同步中文版修改 |

## Test plan

- [ ] 使用 DesireCore Cloud(鹏耀科技)默认算力,发送「画一幅小狗」验证技能触发和图片生成
- [ ] 使用独立 DashScope API Key 配置,验证兼容性
This commit is contained in:
2026-06-05 18:03:50 +08:00
committed by GitHub
parent 17fe79ab49
commit 954891f9c2
2 changed files with 6 additions and 8 deletions

View File

@@ -8,12 +8,12 @@ description: >-
Use when 用户提到 生成图片、画图、文生图、创建图片、AI 绘画、
生成插图、画一张、帮我画、设计图片、通义万相、万相、阿里云画图、dashscope 画图。
license: Complete terms in LICENSE.txt
version: 1.1.1
version: 1.2.0
type: procedural
risk_level: low
status: enabled
disable-model-invocation: false
provider: dashscope
provider: auto
tags:
- media
- image
@@ -87,7 +87,7 @@ market:
### Prerequisites
- The user has configured an Alibaba Cloud DashScope provider in Resource Manager → Compute and filled in an API Key
- At least one enabled compute provider supports `image_gen` service type (e.g. DashScope, or the default DesireCore Cloud provider)
- agent-service is running
### Step 1: Call the text-to-image API (synchronous)
@@ -99,7 +99,6 @@ PORT=$(cat ${DESIRECORE_ROOT}/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \
-d '{
"provider": "dashscope",
"serviceType": "image_gen",
"endpoint": "/chat/completions",
"body": {
@@ -210,7 +209,7 @@ When `n > 1`, the `choices` array contains multiple entries, each with an image
## Error Handling
- `success: false` + `error: "No matching provider"`: DashScope provider not configured or disabled
- `success: false` + `error: "No matching provider"`: No enabled provider supports `image_gen` service type
- `success: false` + `error: "API Key not configured"`: API Key missing
- `statusCode: 401`: API Key invalid or expired
- `statusCode: 429`: rate limited, retry later

View File

@@ -23,7 +23,7 @@
### 前置条件
- 用户已在资源管理器-算力中配置阿里云 DashScope Provider 并填写 API Key
- 至少有一个已启用的算力供应商支持 `image_gen` 服务类型(如 DashScope 或默认的 DesireCore Cloud 供应商)
- agent-service 正在运行
### 第一步:调用文生图 API同步
@@ -35,7 +35,6 @@ PORT=$(cat ${DESIRECORE_ROOT}/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \
-d '{
"provider": "dashscope",
"serviceType": "image_gen",
"endpoint": "/chat/completions",
"body": {
@@ -146,7 +145,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
## 错误处理
- `success: false` + `error: "未找到匹配的供应商"`未配置 DashScope Provider 或未启用
- `success: false` + `error: "未找到匹配的供应商"`没有已启用的供应商支持 `image_gen` 服务类型
- `success: false` + `error: "未配置 API Key"`:未填写 API Key
- `statusCode: 401`API Key 无效或已过期
- `statusCode: 429`:频率限制,稍后重试