mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 09:30:42 +08:00
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:
@@ -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`:频率限制,稍后重试
|
||||
|
||||
Reference in New Issue
Block a user