Skip to content

feat(api-providers): 声明式 web_search / image_understanding 后端默认配置#31

Merged
yi-ge merged 1 commit into
mainfrom
feat/api-providers
Jun 9, 2026
Merged

feat(api-providers): 声明式 web_search / image_understanding 后端默认配置#31
yi-ge merged 1 commit into
mainfrom
feat/api-providers

Conversation

@yi-ge

@yi-ge yi-ge commented Jun 9, 2026

Copy link
Copy Markdown
Member

中文

为 DesireCore 的 WebSearch / UnderstandImage 两个降级工具新增声明式外部 API 供应商默认配置。

  • 新增 api-providers/web-search/(Tavily / Serper / MiniMax)与 api-providers/image-understanding/(OpenAI 兼容 / Anthropic 兼容 复用默认映射 vision、MiniMax)+ 各自 _index.json
  • 新增 schemas/api-provider.schema.json,并在 scripts/validate.mjs 纳入校验,CI 自检通过。
  • 不改 compute/manifest.jsonpresetDataVersion 不变:老客户端忽略新目录,线上用户不受影响;新客户端按 schema 加载。
  • 默认除「复用默认映射」的视觉项外均 enabled:false,需用户在客户端启用并填 Key。

本地 npm run validate(72 validated, 0 failed)与 npm test(28 pass)均通过。

English

Adds declarative external API provider defaults for the WebSearch / UnderstandImage fallback tools.

  • New api-providers/web-search/ (Tavily / Serper / MiniMax) and api-providers/image-understanding/ (OpenAI-compatible / Anthropic-compatible reusing the default vision mapping, MiniMax) with _index.json.
  • New schemas/api-provider.schema.json, wired into scripts/validate.mjs; CI self-validates.
  • Does not touch compute/ or manifest.json; presetDataVersion unchanged — old clients ignore the new dir (no impact on production users), new clients load per schema.
  • All providers default to enabled:false except the default-mapping vision entries; users enable + provide keys in the client.

Local npm run validate (72 validated, 0 failed) and npm test (28 pass) green.

- api-providers/{web-search,image-understanding}/*.json + _index.json
- 新增 schemas/api-provider.schema.json,validate.mjs 纳入校验(CI 自检)
- 不改 compute/ 与 manifest,presetDataVersion 不变:老客户端忽略新目录,线上不受影响
Copilot AI review requested due to automatic review settings June 9, 2026 01:53
@yi-ge yi-ge merged commit ef632d4 into main Jun 9, 2026
3 checks passed
@yi-ge yi-ge deleted the feat/api-providers branch June 9, 2026 01:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new declarative configuration surface (api-providers/) for external fallback backends used by the web_search and image_understanding tools, along with a dedicated JSON Schema and repository validation wiring so these new configs are CI-validated like existing compute/* data.

Changes:

  • Add schemas/api-provider.schema.json and validate api-providers/** JSON via scripts/validate.mjs.
  • Introduce default provider definitions for web_search (Tavily / Serper / MiniMax) with an _index.json load order.
  • Introduce default provider definitions for image_understanding (configured vision for OpenAI-/Anthropic-compatible + MiniMax) with an _index.json load order.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/validate.mjs Routes api-providers/** JSON files to the correct schema keys during repo validation.
schemas/api-provider.schema.json New JSON Schema for declarative API provider definitions.
api-providers/web-search/tavily.json Default Tavily web search provider definition (disabled by default).
api-providers/web-search/serper.json Default Serper web search provider definition (disabled by default).
api-providers/web-search/minimax.json Default MiniMax (internal-testing gateway) web search provider definition (disabled by default).
api-providers/web-search/_index.json Declares load order for web_search providers.
api-providers/image-understanding/minimax.json Default MiniMax (internal-testing gateway) image understanding provider definition (disabled by default).
api-providers/image-understanding/configured-vision-openai.json Enabled-by-default “reuse compute vision mapping” entry for OpenAI-compatible image understanding.
api-providers/image-understanding/configured-vision-anthropic.json Enabled-by-default “reuse compute vision mapping” entry for Anthropic-compatible image understanding.
api-providers/image-understanding/_index.json Declares load order for image_understanding providers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +36
"auth": {
"type": "object",
"description": "鉴权配置",
"required": ["type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "enum": ["bearer", "header", "query", "none"] },
"apiKeyRef": { "type": "string", "description": "secrets.json 中的密钥引用名" },
"headerName": { "type": "string", "description": "type=header 时的请求头名称" },
"queryParam": { "type": "string", "description": "type=query 时的查询参数名" }
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants