1
0
Эх сурвалжийг харах

docs(user): simplify discovery, protocol, and OAuth wording in the provider guide

Yichen Jiang 1 сар өмнө
parent
commit
34b33c2273

+ 2 - 2
docs/user/guide/providers.i18n.yaml

@@ -2,5 +2,5 @@
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
 #   pnpm run verify-translation-pairing --write docs/user/guide/providers.md
-providers.md: 74d7e704b03bab122e58609e1848cc0bc7f61fc1
-providers.zh.md: a9f60f2806f16a331a5ad3244892a5c161181fec
+providers.md: 410d8e75e3ba15b6a457496afd1010e0fbfa6aa2
+providers.zh.md: c0c50134da30867a4c5bce1ca545b689bcf1e2c6

+ 4 - 6
docs/user/guide/providers.md

@@ -16,11 +16,11 @@ Keys are write-only. The page receives a redacted descriptor after saving, never
 
 Choose **Add provider** and pick a provider dsh ships with, such as Anthropic, OpenAI, Moonshot Kimi, or Zhipu GLM; enter its API key and save. The installed catalog supplies the endpoint, protocol, and model list.
 
-Providers with native authentication need their native credentials instead. Bedrock, Vertex, Azure, and Codex use AWS credentials and a region, an ADC project, an `api-version`, and OAuth respectively; filling only the API-key field does not configure them.
+Providers that sign in with OAuth, such as Codex, are not supported here yet.
 
 ## Add a custom provider
 
-Choose **Add a custom provider** for a company gateway, self-hosted server, or provider absent from the installed catalog. Supply a lowercase Provider ID, base URL, API protocol, credential, and at least one model.
+Choose **Add a custom provider** for a company gateway, self-hosted server, or provider absent from the installed catalog. Supply a lowercase Provider ID, base URL, API protocol, credential, and at least one model. The **API protocol** must be the one your gateway speaks, and the form offers three: `openai-completions` for OpenAI Chat Completions, `openai-responses` for the OpenAI Responses API, and `anthropic-messages` for the Anthropic Messages API. A provider speaks one protocol, so a gateway that serves two needs two providers.
 
 ![The custom provider form: Provider ID, display name, base URL, API protocol, and API key](providers-custom-form.png)
 
@@ -28,11 +28,9 @@ The Provider ID is permanent because requests, saved sessions, model defaults, a
 
 ### Discover models
 
-Under **Model catalog**, choose **Fetch available models** to ask the endpoint what it serves. The request goes to the base URL and API protocol currently in the form, with the key typed there or, for a saved provider, the stored one: `openai-completions` and `openai-responses` call `GET /models` with bearer auth, and `anthropic-messages` calls Anthropic's native `GET /v1/models`, whether the base URL is written with or without a trailing `/v1`. The reply may be OpenAI's `data` array or the enriched `models` object some gateways return; either way each candidate arrives with its id and, when the endpoint reports them, a display name, context window, and max output tokens.
+Under **Model catalog**, choose **Fetch available models** to ask the endpoint which models it serves. The request uses the base URL, protocol, and key currently in the form, or a saved provider's stored key, and the reply opens a searchable picker: search, tick the models you want, and choose **Add selected**. Nothing is stored until you save or create the provider.
 
-The reply opens a searchable picker rather than writing anything. Search matches ids and display names, **Select all** adds the visible results, **Deselect all** clears every selection including hidden ones, and **Add selected** copies the chosen candidates into the model list. The provider is not stored until you save or create it, so a fetch is safe to repeat while drafting.
-
-A built-in provider is answered from the installed catalog without a network request, even when its base URL points at a gateway. To see what a gateway actually serves under a built-in provider's protocol, fetch through a custom provider with the same base URL, or enter the gateway's ids by hand.
+Discovery reads the listing formats common gateways publish, but not every endpoint answers in one of them, so treat it as a convenience rather than a guarantee: when it fails or lists nothing, add the model ids by hand and they work just the same. A built-in provider is always answered from the installed catalog, even when its base URL points at a gateway, so fetch through a custom provider to see what the gateway really serves.
 
 ## Select a model
 

+ 4 - 6
docs/user/guide/providers.zh.md

@@ -16,11 +16,11 @@
 
 选择**添加提供方**,选取 dsh 自带的提供方,例如 Anthropic、OpenAI、Moonshot Kimi 或智谱 GLM;输入其 API 密钥并保存。已安装目录会提供端点、协议和模型列表。
 
-使用原生认证的提供方需要各自的原生凭据。Bedrock、Vertex、Azure 和 Codex 分别使用 AWS 凭据与区域、ADC 项目、`api-version` 和 OAuth;只填写 API 密钥字段无法完成配置。
+通过 OAuth 登录的提供方(例如 Codex)暂不支持。
 
 ## 添加自定义提供方
 
-对于公司网关、自建服务器或已安装目录中不存在的提供方,选择**添加自定义提供方**。提供小写 Provider ID、基础 URL、API 协议、凭据和至少一个模型。
+对于公司网关、自建服务器或已安装目录中不存在的提供方,选择**添加自定义提供方**。提供小写 Provider ID、基础 URL、API 协议、凭据和至少一个模型。**API 协议**必须选网关实际使用的那一种,表单提供三种:`openai-completions` 对应 OpenAI Chat Completions,`openai-responses` 对应 OpenAI Responses API,`anthropic-messages` 对应 Anthropic Messages API。一个提供方只使用一种协议,网关同时提供两种时需要建两个提供方。
 
 ![自定义提供方表单:Provider ID、显示名称、API 地址、API 协议、API 密钥](providers-custom-form.zh.png)
 
@@ -28,11 +28,9 @@ Provider ID 是永久的,因为请求、已保存会话、模型默认值和
 
 ### 探测模型
 
-在**模型目录**中选择**获取可用模型**,即可询问端点它提供哪些模型。请求发往表单当前显示的 API 地址和 API 协议,密钥用表单里输入的,已保存的提供方则用已存储的密钥:`openai-completions` 和 `openai-responses` 以 bearer 认证调用 `GET /models`,`anthropic-messages` 调用 Anthropic 原生的 `GET /v1/models`,API 地址末尾带不带 `/v1` 都可以。响应可以是 OpenAI 的 `data` 数组,也可以是部分网关返回的富信息 `models` 对象;无论哪种,每个候选都带有 ID,端点若报告了显示名称、上下文窗口和最大输出 token 数,也会一并带上。
+在**模型目录**中选择**获取可用模型**,即可询问端点它提供哪些模型。请求使用表单当前的 API 地址、协议和密钥,已保存的提供方则用已存储的密钥;响应会打开一个可搜索的选择框,搜索、勾选想要的模型,再点**添加所选**。保存或创建提供方之前不会存储任何内容。
 
-响应会打开一个可搜索的选择框,而不是直接写入任何内容。搜索同时匹配 ID 和显示名称,**全选**只加入可见结果,**取消全选**清空包括隐藏项在内的全部勾选,**添加所选**把选中的候选复制进模型列表。保存或创建之前提供方不会被存储,因此起草时可以放心重复探测。
-
-内置提供方一律由已安装目录作答,不发起网络请求,即使其 API 地址指向网关也是如此。要查看网关在内置提供方的协议下实际提供的模型,请用同一 API 地址通过自定义提供方探测,或手动录入网关的模型 ID。
+探测读取的是常见网关公开的列表格式,但并非每个端点都用这些格式作答,所以它只是便利手段而非保证:探测失败或列表为空时,手动添加模型 ID 即可,效果完全一样。内置提供方一律由已安装目录作答,即使其 API 地址指向网关也是如此,要查看网关实际提供的模型,请通过自定义提供方探测。
 
 ## 选择模型