feat(api-providers): 声明式 web_search / image_understanding 后端默认配置#31
Merged
Conversation
- api-providers/{web-search,image-understanding}/*.json + _index.json
- 新增 schemas/api-provider.schema.json,validate.mjs 纳入校验(CI 自检)
- 不改 compute/ 与 manifest,presetDataVersion 不变:老客户端忽略新目录,线上不受影响
There was a problem hiding this comment.
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.jsonand validateapi-providers/**JSON viascripts/validate.mjs. - Introduce default provider definitions for
web_search(Tavily / Serper / MiniMax) with an_index.jsonload order. - Introduce default provider definitions for
image_understanding(configured vision for OpenAI-/Anthropic-compatible + MiniMax) with an_index.jsonload 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 时的查询参数名" } | ||
| } | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
为 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.json,presetDataVersion不变:老客户端忽略新目录,线上用户不受影响;新客户端按 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/UnderstandImagefallback tools.api-providers/web-search/(Tavily / Serper / MiniMax) andapi-providers/image-understanding/(OpenAI-compatible / Anthropic-compatible reusing the defaultvisionmapping, MiniMax) with_index.json.schemas/api-provider.schema.json, wired intoscripts/validate.mjs; CI self-validates.compute/ormanifest.json;presetDataVersionunchanged — old clients ignore the new dir (no impact on production users), new clients load per schema.enabled:falseexcept the default-mapping vision entries; users enable + provide keys in the client.Local
npm run validate(72 validated, 0 failed) andnpm test(28 pass) green.