mirror of
https://git.openapi.site/https://github.com/desirecore/config-center.git
synced 2026-07-23 03:33:22 +08:00
feat(api-providers): 新增 web_search / image_understanding 声明式后端默认配置 (#31)
- api-providers/{web-search,image-understanding}/*.json + _index.json
- 新增 schemas/api-provider.schema.json,validate.mjs 纳入校验(CI 自检)
- 不改 compute/ 与 manifest,presetDataVersion 不变:老客户端忽略新目录,线上不受影响
Co-authored-by: yi-ge <jackyoncode@gmail.com>
This commit is contained in:
4
api-providers/image-understanding/_index.json
Normal file
4
api-providers/image-understanding/_index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "image_understanding 工具后端加载顺序索引",
|
||||
"order": ["configured-vision-openai", "configured-vision-anthropic", "minimax"]
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"id": "configured-vision-anthropic",
|
||||
"name": "视觉模型(Anthropic 兼容,复用默认映射)",
|
||||
"capability": "image_understanding",
|
||||
"enabled": true,
|
||||
"builtin": true,
|
||||
"priority": 20,
|
||||
"endpoint": "${baseUrl}/messages",
|
||||
"method": "POST",
|
||||
"computeServiceType": "vision",
|
||||
"requiresApiFormat": "anthropic-messages",
|
||||
"auth": { "type": "header", "headerName": "x-api-key" },
|
||||
"request": {
|
||||
"imageMode": "base64",
|
||||
"headers": { "anthropic-version": "2023-06-01" },
|
||||
"bodyTemplate": {
|
||||
"model": "${model}",
|
||||
"max_tokens": 1024,
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{ "type": "image", "source": { "type": "base64", "media_type": "${imageMime}", "data": "${imageBase64}" } },
|
||||
{ "type": "text", "text": "${prompt}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": { "textPath": "content.0.text" },
|
||||
"timeoutMs": 30000
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"id": "configured-vision-openai",
|
||||
"name": "视觉模型(OpenAI 兼容,复用默认映射)",
|
||||
"capability": "image_understanding",
|
||||
"enabled": true,
|
||||
"builtin": true,
|
||||
"priority": 10,
|
||||
"endpoint": "${baseUrl}/chat/completions",
|
||||
"method": "POST",
|
||||
"computeServiceType": "vision",
|
||||
"requiresApiFormat": "openai-completions",
|
||||
"auth": { "type": "bearer" },
|
||||
"request": {
|
||||
"imageMode": "url",
|
||||
"bodyTemplate": {
|
||||
"model": "${model}",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{ "type": "text", "text": "${prompt}" },
|
||||
{ "type": "image_url", "image_url": { "url": "${imageUrl}" } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": { "textPath": "choices.0.message.content" },
|
||||
"timeoutMs": 30000
|
||||
}
|
||||
18
api-providers/image-understanding/minimax.json
Normal file
18
api-providers/image-understanding/minimax.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"id": "minimax",
|
||||
"name": "MiniMax 图像理解(内测网关)",
|
||||
"capability": "image_understanding",
|
||||
"enabled": false,
|
||||
"builtin": true,
|
||||
"priority": 30,
|
||||
"endpoint": "${baseUrl}/understand_image",
|
||||
"method": "POST",
|
||||
"baseUrlRef": "internal-testing",
|
||||
"auth": { "type": "bearer" },
|
||||
"request": {
|
||||
"imageMode": "url",
|
||||
"bodyTemplate": { "prompt": "${prompt}", "image_url": "${imageUrl}" }
|
||||
},
|
||||
"response": { "textPath": "text" },
|
||||
"timeoutMs": 30000
|
||||
}
|
||||
Reference in New Issue
Block a user