fix(vision): 按内容块提取 Anthropic 视觉文本并更新预设至 v137 (#130)

Co-authored-by: Corona <corona@CoronadeMac-Mini-2.local>
This commit is contained in:
yigeandCorona authored and GitHub committed 2026-11-03 17:49:55 +08:00
1 parent 6eef9c1fb7
commit c87e5521a4
5 files changed
+72 -10

No files matched your search

+8 -3
View File
@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://desirecore.net/schemas/config-center/api-provider.schema.json",
"title": "ApiProvider",
"description": "api-providers/<capability>/*.json:声明式外部 API 供应商(web_search / image_understanding 工具后端)。镜像 desirecore 主仓 lib/schemas/agent-service/api-provider.ts。",
"description": "api-providers/<capability>/*.json:声明式外部 API 供应商(web_search / image_understanding 工具后端)。镜像 desirecore 主仓 packages/schemas/src/agent-service/api-provider.ts。",
"type": "object",
"required": ["id", "name", "capability", "enabled", "endpoint", "auth", "request", "response"],
"additionalProperties": false,
@@ -47,7 +47,7 @@
},
"response": {
"type": "object",
"description": "响应提取",
"description": "响应解析。web_search 用 resultsPath + item;image_understanding 用 textPath + textFormat",
"additionalProperties": false,
"properties": {
"resultsPath": { "type": "string", "description": "web_search 结果数组的点路径" },
@@ -61,7 +61,12 @@
"pageAgePath": { "type": "string" }
}
},
"textPath": { "type": "string", "description": "image_understanding 结果文本的点路径" },
"textPath": { "type": "string", "description": "image_understanding:响应结果的点路径。string 格式指向字符串(如 choices.0.message.content);text-blocks 格式指向内容块数组(如 content)" },
"textFormat": {
"type": "string",
"enum": ["string", "text-blocks"],
"description": "image_understanding:textPath 指向值的格式,省略时为 string,仅接受字符串;text-blocks 仅按原顺序读取顶层数组中 type=text 且 text 为字符串的内容,以换行连接,忽略推理、工具、图片及其他块,不递归提取"
},
"successCondition": {
"type": "object",
"description": "可选业务成功判定;HTTP 成功后读取 path 并与 equals 严格比较,不匹配时按 Provider 失败继续降级",