feat(ui-settings-models): edit reasoning levels of catalog provider models
The Models page showed the per-model reasoning-level control only on hand-declared pi-ai routes. The adapter resolves a model entry's `reasoningEfforts` the same way on catalog routes, so the editor now offers the control on every pi-ai route and checks the declarations before saving. With the switch off the field is absent and a catalog model keeps the installed catalog's levels.
This commit is contained in:
1 parent
b87a481bcf
commit
19cd62a86b
17 files changed
+117
-45
No files matched your search
@@ -61,6 +61,10 @@
|
||||
- text: 文本
|
||||
- checkbox "图片" [checked]
|
||||
- text: 图片
|
||||
- group "推理等级 1":
|
||||
- text: 推理等级
|
||||
- button "推理等级说明": "?"
|
||||
- switch "推理等级 1"
|
||||
- button "添加模型"
|
||||
- button "取消"
|
||||
- button "保存"
|
||||
|
||||
@@ -543,6 +543,46 @@ describe('web e2e: Models settings page configures a dormant provider', () => {
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
}, 60_000)
|
||||
|
||||
it('replaces an installed catalog model\'s reasoning levels and returns to them when switched off', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-models-catalog-reasoning'))
|
||||
await scaffold.ctx.settings.mutate('llm-pi-ai', [{
|
||||
op: 'set', path: ['providers', 'openai'], value: { models: [{ id: 'gpt-6-astra', name: 'GPT-6 Astra' }] },
|
||||
}])
|
||||
const dialog = page.getByRole('dialog', { name: '设置' })
|
||||
const edit = dialog.getByRole('button', { name: '编辑 openai', exact: true })
|
||||
const toggle = dialog.getByRole('switch', { name: '推理等级 1' })
|
||||
const efforts = async (): Promise<string[]> =>
|
||||
(await scaffold.ctx.llm.resolveModelInfo('openai', 'gpt-6-astra')).reasoning?.efforts.map(effort => String(effort.id)) ?? []
|
||||
const openModelOptions = async (): Promise<void> => {
|
||||
await edit.click()
|
||||
await dialog.getByText('自定义设置').click()
|
||||
await dialog.getByRole('button', { name: '模型选项 1' }).click()
|
||||
}
|
||||
try {
|
||||
const inherited = await efforts()
|
||||
expect(inherited).toContain('max')
|
||||
await openModelOptions()
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
await toggle.click()
|
||||
await dialog.getByRole('button', { name: '保存', exact: true }).click()
|
||||
await toggle.waitFor({ state: 'detached' })
|
||||
expect(await efforts()).toEqual(['off', 'low', 'medium', 'high'])
|
||||
// The saved notice confirms the browser directory refresh, so the reopened draft holds the stored levels.
|
||||
await dialog.getByText('已保存 openai。', { exact: true }).waitFor({ timeout: 10_000 })
|
||||
|
||||
await openModelOptions()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await toggle.click()
|
||||
await dialog.getByRole('button', { name: '保存', exact: true }).click()
|
||||
await toggle.waitFor({ state: 'detached' })
|
||||
expect(await efforts()).toEqual(inherited)
|
||||
} finally {
|
||||
await scaffold.ctx.settings.mutate('llm-pi-ai', [{ op: 'unset', path: ['providers', 'openai'] }])
|
||||
await edit.waitFor({ state: 'detached' })
|
||||
}
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
}, 60_000)
|
||||
|
||||
it('saves model drag order, discards canceled moves, and preserves the other provider', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-models-order'))
|
||||
const dialog = page.getByRole('dialog', { name: '设置' })
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: 281b2f40645aa5eb
|
||||
zh: 861bfe9584d9d30f
|
||||
/configure-models/advanced-configuration:
|
||||
en: b882ec69a6899d8a
|
||||
zh: 66a1713aca0e6f1c
|
||||
en: 217be2655684ec9f
|
||||
zh: 50bb9ce264c545f3
|
||||
/configure-models/advanced-configuration/image-input:
|
||||
en: 75350cb615da03a4
|
||||
zh: 6f8b3510085e4ac4
|
||||
@@ -30,11 +30,11 @@
|
||||
en: fc09d02a89b211a7
|
||||
zh: e0f23a8912a24178
|
||||
/configure-models/advanced-configuration/reasoning-effort:
|
||||
en: f2ffb493997dcc72
|
||||
zh: dee9238f072e53ad
|
||||
en: f6a2efb22fb32f7a
|
||||
zh: ff8075497aca7d2a
|
||||
/configure-models/advanced-configuration/request-compatibility:
|
||||
en: 6f52195d1502783e
|
||||
zh: 34dbbeacb541afd4
|
||||
/configure-models/troubleshooting:
|
||||
en: af9f866bec7701f0
|
||||
zh: 0e4f5e1da975be41
|
||||
en: 941e0027d0decaad
|
||||
zh: 4233dbb97c08d348
|
||||
@@ -51,7 +51,7 @@ If a saved default names a provider that was deleted, the composer displays **Se
|
||||
The generated [plugin configuration catalog](../../config-catalog.md) lists every supported field and default for every plugin; [`dsh-llm-pi-ai`](../../config-catalog.md#deepseek-aidsh-llm-pi-ai) is the provider section this page configures. The [`dsh-llm-pi-ai`](../../../packages/llm/llm-pi-ai/README.md) and [`dsh-llm-deepseek`](../../../packages/llm/llm-deepseek/README.md) references own direct `cordis.patch.yml` configuration, catalog resolution, reasoning controls, credentials, and adapter errors.
|
||||
|
||||
::: tip Additional settings
|
||||
The Models page exposes the API key, display name, base URL, API protocol, and each model's id, display name, context window, max output tokens, and input types, plus the reasoning levels of a model on a custom model API provider. Configure the reasoning levels of a built-in provider's models, request-compatibility switches, headers, timeouts, and retry policy in `$DSH_HOME/profiles/<profile>/cordis.patch.yml`, the same document the page writes. Edit it directly, or, when the browser runs on the same machine as the server, open it with **Open configuration file** in the Settings header; the adapters re-read it on the next request, so nothing needs a restart. The subsections below cover the fields most gateways need.
|
||||
The Models page exposes the API key, display name, base URL, API protocol, and each model's id, display name, context window, max output tokens, and input types, plus the reasoning levels of a model on a built-in or custom model API provider. Configure request-compatibility switches, headers, timeouts, and retry policy in `$DSH_HOME/profiles/<profile>/cordis.patch.yml`, the same document the page writes. Edit it directly, or, when the browser runs on the same machine as the server, open it with **Open configuration file** in the Settings header; the adapters re-read it on the next request, so nothing needs a restart. The subsections below cover the fields most gateways need.
|
||||
|
||||
For the standard Web UI launch with `dsh web`, `<profile>` is `web`, so the path is `$DSH_HOME/profiles/web/cordis.patch.yml`. If you launch a custom profile, use the name selected at startup instead.
|
||||
:::
|
||||
@@ -135,7 +135,7 @@ A model that needs a newer DeepSeek Harness fails with `CLIENT_UPGRADE_REQUIRED`
|
||||
|
||||
The model picker offers an **Effort** menu for a model that declares reasoning levels. A built-in provider's models inherit their levels from the installed catalog, and DeepSeek's models keep the adapter's levels. A model you enter by hand declares none until you add them, so until then the Effort entry does not appear in the menu and the endpoint's own default decides whether the model thinks.
|
||||
|
||||
On a custom model API provider, declare the levels in **Settings → Models**: edit the provider, open **Customized settings**, expand the model's **Model options**, and turn on **Reasoning levels**. The rows start with off, low, medium, and high. Each row pairs a level with the **API value** sent for it, which defaults to the level name; change it only where the model provider's API documentation spells the level differently. Add or delete rows to match what the endpoint supports, keep at least one level besides off, and save. Turning the switch off removes the declaration.
|
||||
On a built-in or custom model API provider, declare the levels in **Settings → Models**: edit the provider, open **Customized settings**, expand the model's **Model options**, and turn on **Reasoning levels**. The rows start with off, low, medium, and high. Each row pairs a level with the **API value** sent for it, which defaults to the level name; change it only where the model provider's API documentation spells the level differently. Add or delete rows to match what the endpoint supports, keep at least one level besides off, and save. Levels declared for a built-in provider's model replace the ones it inherits. Turning the switch off removes the declaration, and a built-in provider's model then inherits its levels again.
|
||||
|
||||
The page writes `reasoningEfforts` in `$DSH_HOME/profiles/<profile>/cordis.patch.yml`, where you can also declare the levels directly:
|
||||
|
||||
@@ -224,7 +224,7 @@ Every switch, its accepted values, and the protocols that take it are listed und
|
||||
- **Fetching available models reports neither a `data` array nor a `models` object** — The endpoint's listing is in a format discovery does not read. Enter the models by hand.
|
||||
- **The gateway refuses every request although the key and URL are right** — Its request shape differs from OpenAI's. Start with `compat.supportsDeveloperRole: false` and `compat.maxTokensField: max_tokens` on the route.
|
||||
- **Only reasoning models fail** — pi-ai sends their system prompt as the `developer` role, which the gateway rejects. Set `compat.supportsDeveloperRole: false`.
|
||||
- **The Effort menu does not appear for a model you entered by hand** — It declares no levels. On a custom model API provider, turn on **Reasoning levels** in the model's **Model options**; elsewhere, add `reasoningEfforts` to the model in `cordis.patch.yml`.
|
||||
- **The Effort menu does not appear for a model you entered by hand** — It declares no levels. Turn on **Reasoning levels** in the model's **Model options**, or add `reasoningEfforts` to the model in `cordis.patch.yml`.
|
||||
- **`off` does not stop a DeepSeek model from thinking** — An empty `off` sends no reasoning field at all, and an endpoint that thinks by default keeps thinking. Set `compat.thinkingFormat: deepseek` on the model or the route.
|
||||
- **A compat switch is refused as having no value** — A key written with nothing after the colon. Give it a value, or remove the key to keep the installed catalog's.
|
||||
- **An image is refused before sending** — The model declares no image modality. Give a custom provider's model `input: [text, image]`; on DeepSeek's own route, select an image-capable entry from the configured catalog (`deepseek-flash` by default) and confirm that your gateway serves that model with image input.
|
||||
|
||||
@@ -51,7 +51,7 @@ Provider ID 是永久的,因为请求、已保存会话、模型默认值和
|
||||
自动生成的[插件配置目录](../../config-catalog.zh.md)列出每个插件的所有受支持字段与默认值;[`dsh-llm-pi-ai`](../../config-catalog.zh.md#deepseek-aidsh-llm-pi-ai) 就是本页所配置的那个提供商段落。[`dsh-llm-pi-ai`](../../../packages/llm/llm-pi-ai/README.zh.md) 和 [`dsh-llm-deepseek`](../../../packages/llm/llm-deepseek/README.zh.md) 参考文档负责直接 `cordis.patch.yml` 配置、目录解析、推理控制、凭据与适配器错误。
|
||||
|
||||
::: tip 其他设置
|
||||
模型页提供 API 密钥、显示名称、API 地址、API 协议,以及每个模型的 ID、显示名称、上下文窗口、最大输出 token 数和输入类型;自定义模型 API 提供商的模型还可以在这里设置推理等级。内置提供商模型的推理等级、请求兼容性开关、请求头、超时和重试策略在 `$DSH_HOME/profiles/<profile>/cordis.patch.yml` 中设置,也就是模型页写入的同一份文档。可以直接编辑它;浏览器与服务器在同一台机器时,也可以点击设置页顶部的**打开配置文件**打开它。适配器会在下一次请求时重新读取,无需重启任何东西。下面各小节介绍多数网关会用到的字段。
|
||||
模型页提供 API 密钥、显示名称、API 地址、API 协议,以及每个模型的 ID、显示名称、上下文窗口、最大输出 token 数和输入类型;内置提供商和自定义模型 API 提供商的模型还可以在这里设置推理等级。请求兼容性开关、请求头、超时和重试策略在 `$DSH_HOME/profiles/<profile>/cordis.patch.yml` 中设置,也就是模型页写入的同一份文档。可以直接编辑它;浏览器与服务器在同一台机器时,也可以点击设置页顶部的**打开配置文件**打开它。适配器会在下一次请求时重新读取,无需重启任何东西。下面各小节介绍多数网关会用到的字段。
|
||||
|
||||
按常规方式通过 `dsh web` 启动 Web UI 时,`<profile>` 就是 `web`,完整路径为 `$DSH_HOME/profiles/web/cordis.patch.yml`。如果使用自定义 profile,请替换为启动时指定的名称。
|
||||
:::
|
||||
@@ -135,7 +135,7 @@ DeepSeek 将省略的 `inputModalities` 视为纯文本,并拒绝空列表。
|
||||
|
||||
对于声明了推理等级的模型,模型选择器会提供**推理等级**菜单。内置提供商的模型从已安装目录继承其等级,DeepSeek 的模型沿用适配器提供的等级。手动录入的模型在添加等级之前不声明任何等级,因此模型菜单里不会出现推理等级项,由端点自身的默认值决定模型是否思考。
|
||||
|
||||
自定义模型 API 提供商可以在**设置 → 模型**中声明等级:编辑该提供商,打开**自定义设置**,展开该模型的**模型选项**,然后打开**推理等级**。默认带有 off、low、medium、high 四行。每行把一个档位与发送给它的 **API 参数值**配成一对,参数值默认与档位名相同;只有模型提供商的 API 文档写法不同时才需要修改。按端点支持的档位增删行,至少保留一个 off 以外的档位,然后保存。关闭开关会删除该声明。
|
||||
内置提供商和自定义模型 API 提供商都可以在**设置 → 模型**中声明等级:编辑该提供商,打开**自定义设置**,展开该模型的**模型选项**,然后打开**推理等级**。默认带有 off、low、medium、high 四行。每行把一个档位与发送给它的 **API 参数值**配成一对,参数值默认与档位名相同;只有模型提供商的 API 文档写法不同时才需要修改。按端点支持的档位增删行,至少保留一个 off 以外的档位,然后保存。为内置提供商的模型声明的等级会取代它继承的等级。关闭开关会删除该声明,内置提供商的模型随即重新继承其等级。
|
||||
|
||||
模型页会把 `reasoningEfforts` 写入 `$DSH_HOME/profiles/<profile>/cordis.patch.yml`,也可以直接在其中声明等级:
|
||||
|
||||
@@ -224,7 +224,7 @@ DeepSeek 将省略的 `inputModalities` 视为纯文本,并拒绝空列表。
|
||||
- **获取可用模型提示既没有 `data` 数组也没有 `models` 对象**:端点返回的列表格式不在探测的读取范围内。请手动输入模型。
|
||||
- **密钥与地址都正确,网关却拒绝每一个请求**:它的请求形状与 OpenAI 不同。先在路由上设 `compat.supportsDeveloperRole: false` 与 `compat.maxTokensField: max_tokens`。
|
||||
- **只有推理模型失败**:pi-ai 把它们的系统提示词以 `developer` 角色发出,而网关拒绝该角色。设 `compat.supportsDeveloperRole: false`。
|
||||
- **手动录入的模型没有推理等级菜单**:该模型没有声明任何等级。如果是自定义模型 API 提供商,在该模型的**模型选项**中打开**推理等级**;其他提供商在 `cordis.patch.yml` 中给该模型加上 `reasoningEfforts`。
|
||||
- **手动录入的模型没有推理等级菜单**:该模型没有声明任何等级。在该模型的**模型选项**中打开**推理等级**,或在 `cordis.patch.yml` 中给该模型加上 `reasoningEfforts`。
|
||||
- **`off` 无法让 DeepSeek 模型停止思考**:留空的 `off` 不发送任何推理字段,默认思考的端点就继续思考。请在模型或路由上设置 `compat.thinkingFormat: deepseek`。
|
||||
- **某个 compat 开关因没有值而被拒绝**:冒号后什么都没写。给它一个值,或删掉该键以沿用已安装 catalog 的值。
|
||||
- **图片在发送前被拒绝**:该模型未声明图片模态。请给自定义提供商的模型加上 `input: [text, image]`;在 DeepSeek 自身的路由上,请从配置的目录中选择支持图片的条目(默认为 `deepseek-flash`),并确认网关提供该模型且支持图片输入。
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: fa2cefbf8c4fdafe
|
||||
zh: 3a4689591b50f6ea
|
||||
/deepseek-ai-dsh-client-ui-settings-models/use-this-package/editing-a-provider:
|
||||
en: 041857583e079891
|
||||
zh: b6cd6dd11609aa28
|
||||
en: 23bcea3d60051515
|
||||
zh: 07b26ca9de990c5e
|
||||
/deepseek-ai-dsh-client-ui-settings-models/use-this-package/adding-and-deleting-providers:
|
||||
en: 59472e717c2f87be
|
||||
zh: dc2a51a5a40138bc
|
||||
|
||||
@@ -55,7 +55,7 @@ Leaving the saved mask untouched preserves existing authentication. A saved cred
|
||||
|
||||
An endpoint without a fixed catalog default shows the provider's `baseURLEnv` configuration names below the input. A profile endpoint remains the first placeholder choice.
|
||||
|
||||
The collapsed 自定义设置 fold carries the curated extras: `baseURL` for both families (the placeholder shows the endpoint the profile resolves to, the public endpoint for deepseek, else the `defaultBaseURL` the configurable-provider directory reports for a pi-ai catalog route), each adapter's model catalog, and the **display name** and **API protocol** of a pi-ai route the adapter does not ship. Profile `headers` remain deployment configuration in `cordis.patch.yml` or Cordis config and have no Models-page editor. The Provider ID stays fixed: it is the settings key, the name every other namespace and every logged session references, and the stem of a credential reference the page cannot read back to move. There is no provider-scoped reasoning-effort field: effort is a per-model capability, so a provider-scoped control could only be set to a value some models reject. Each model row edits `id`, optional display `name`, optional `contextWindow`/`maxTokens`, input types, and, on a hand-declared pi-ai route, reasoning levels; unrelated model fields survive edits.
|
||||
The collapsed 自定义设置 fold carries the curated extras: `baseURL` for both families (the placeholder shows the endpoint the profile resolves to, the public endpoint for deepseek, else the `defaultBaseURL` the configurable-provider directory reports for a pi-ai catalog route), each adapter's model catalog, and the **display name** and **API protocol** of a pi-ai route the adapter does not ship. Profile `headers` remain deployment configuration in `cordis.patch.yml` or Cordis config and have no Models-page editor. The Provider ID stays fixed: it is the settings key, the name every other namespace and every logged session references, and the stem of a credential reference the page cannot read back to move. There is no provider-scoped reasoning-effort field: effort is a per-model capability, so a provider-scoped control could only be set to a value some models reject. Each model row edits `id`, optional display `name`, optional `contextWindow`/`maxTokens`, input types, and, on a pi-ai route, reasoning levels; unrelated model fields survive edits.
|
||||
|
||||
The same fold edits the provider's `retryPolicy` for both families. **Retry policy** defaults to the inherited policy and names its mode; choosing **Transient errors** or **All errors** writes a user-layer policy. Transient mode edits the maximum retry count and the retried error codes, ticked from the choices the `retryableCodes` schema publishes, shown in words (for example **Rate limited** for `RATE_LIMIT`), plus any inherited or stored code outside them, shown verbatim. A third-party code is typed into **Custom error code** and added with **Add** or Enter, which never submits the card: surrounding whitespace is trimmed, case is kept, an empty entry is ignored, and a code already listed is selected instead of duplicated. An added code is selected in the draft only, stays listed after it is unchecked during the same edit, and appears again on reopening once saved; the last ticked code cannot be cleared, and ticking exactly the inherited codes keeps the field inherited; both modes edit the initial delay, maximum delay, and jitter ratio under a **Backoff** fold, which starts open only when the stored policy customizes backoff. Each empty field shows and keeps the inherited value, read from the composition layer, then the schema default. Apply is disabled while a field holds a value the adapter refuses, such as a fractional retry count, a delay that is not positive, or a jitter ratio above 1. The refusal appears below the fields, or above the card actions while the fold is closed. A stored policy without a mode shows the inherited mode, or the schema's first mode when none is inherited, and Apply saves that mode. Switching modes keeps only the fields the new mode declares. Clearing a field unsets it, so the inherited value applies again; choosing the default again removes the user-layer policy.
|
||||
|
||||
@@ -65,7 +65,7 @@ Drag a model’s reorder handle to change its position within the provider, or f
|
||||
|
||||
Expand **Customized settings → Model options** to edit each model. When the model row is narrow, the main row shows only the model ID; expand the row to view or edit its display name. Wider rows show both fields side by side. Focusing a display name expands its row and keeps it open until explicitly collapsed. Tab reaches the option and delete buttons before the display name at every width. Both provider families share the same row layout, labels, and icons: context window and max output tokens occupy two columns, and **Input types** occupies a separate row with **Text** and **Image** checkboxes. A row without an input declaration displays the installed model’s input types, then the provider default, then Text. Known pi-ai providers load their installed catalog without endpoint I/O; opening a row does not write an override. Explicit input selections take precedence, including text-only overrides of vision models. Checkbox edits save the selected types, with at least one type required. DeepSeek writes `inputModalities`; pi-ai writes `input`. Unchecking Image for DeepSeek also removes `imagePixelBudget` and `imageMaxBytes`, because the adapter rejects those limits without image input. Clearing the input field in `cordis.patch.yml` restores adapter inheritance; **Restore default models** resets the entire catalog override. Declare only input types the upstream model can actually process.
|
||||
|
||||
A model row on a hand-declared pi-ai route also edits its **Reasoning levels**, the `reasoningEfforts` the adapter already reads from `cordis.patch.yml`; the **?** beside the label explains the two columns. With the switch off the field is absent, so the model does not reason and the model picker offers no level; a stored `false` is kept until the switch is used. Turning it on always starts from rows for off, low, medium, and high; it does not restore levels removed earlier, and **Cancel** discards the edit instead. Each row pairs a level select — the keys `llm-pi-ai`'s configuration schema accepts in `reasoningEfforts`, read from the namespace schema like the protocol choices and today `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`, each usable once — with the **API value** sent for it, which starts as the level name; a field cleared while typing stores the level name and shows it once the field is left. Off only turns reasoning off, so its value field is disabled; a value already written for it in `cordis.patch.yml` is shown and kept. Changing a row's level resets a value still spelled as the old level; a custom value carries over only between two thinking levels, so changing a row to or from Off resets it. A stored key the schema does not list keeps its row and stays selectable there. Rows can be added and deleted and are saved in row order, while the model picker lists the levels in escalation order. The section refuses what the adapter refuses: no level besides Off — including a `reasoningEfforts:` left without a value, which shows the switch on with no rows — or a value that is missing on a level besides Off or empty on any level. A refused value marks its field invalid, and leaving that field fills in the level name. The rows keep no state of their own, so a model row reused after a deletion, a reset, or a fold shows only its own model. On a Gemini API route the level select offers only `minimal`, `low`, `medium`, and `high`, turning the switch on starts from low, medium, and high, and each value field is disabled and holds the level name, which changing a row's level keeps; the Gemini implementation accepts only those four names as values. A stored level, or a value other than its level name, blocks saving with a message under the rows, in the create card and in the editor alike; the editor checks inherited models as well once the protocol is Gemini. Routes served from the installed catalog and the DeepSeek card keep the adapter's levels and show no reasoning control.
|
||||
A model row on a pi-ai route, catalog or hand-declared, also edits its **Reasoning levels**, the `reasoningEfforts` the adapter already reads from `cordis.patch.yml`; the **?** beside the label explains the two columns. With the switch off the field is absent: a model the installed catalog describes keeps the catalog's levels, and any other model does not reason and the model picker offers it no level; a stored `false` is kept until the switch is used. Turning it on always starts from rows for off, low, medium, and high; it does not restore levels removed earlier, and **Cancel** discards the edit instead. Each row pairs a level select — the keys `llm-pi-ai`'s configuration schema accepts in `reasoningEfforts`, read from the namespace schema like the protocol choices and today `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`, each usable once — with the **API value** sent for it, which starts as the level name; a field cleared while typing stores the level name and shows it once the field is left. Off only turns reasoning off, so its value field is disabled; a value already written for it in `cordis.patch.yml` is shown and kept. Changing a row's level resets a value still spelled as the old level; a custom value carries over only between two thinking levels, so changing a row to or from Off resets it. A stored key the schema does not list keeps its row and stays selectable there. Rows can be added and deleted and are saved in row order, while the model picker lists the levels in escalation order. The section refuses what the adapter refuses: no level besides Off — including a `reasoningEfforts:` left without a value, which shows the switch on with no rows — or a value that is missing on a level besides Off or empty on any level. A refused value marks its field invalid, and leaving that field fills in the level name. The rows keep no state of their own, so a model row reused after a deletion, a reset, or a fold shows only its own model. On a route whose `api` names the Gemini API the level select offers only `minimal`, `low`, `medium`, and `high`, turning the switch on starts from low, medium, and high, and each value field is disabled and holds the level name, which changing a row's level keeps; the Gemini implementation accepts only those four names as values. A stored level, or a value other than its level name, blocks saving with a message under the rows, in the create card and in the editor alike; the editor checks inherited models as well once the protocol is Gemini. A catalog route normally stores no `api`; its rows then offer every level with an editable value, whichever protocol its models speak. The DeepSeek card keeps the adapter's levels and shows no reasoning control.
|
||||
|
||||
Empty pi-ai capacity fields display `1M` for the context window and `128K` for maximum output tokens. These hints use decimal K/M units; leaving the fields empty preserves adapter inheritance. Provider-level defaults can differ from the hints.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ API 密钥输入框通过 `autocomplete="new-password"` 请求浏览器不要自
|
||||
|
||||
目录未提供固定默认端点时,输入框下方显示提供方的 `baseURLEnv` 配置变量名。Profile 中的端点仍是占位符的首选。
|
||||
|
||||
收起的「自定义设置」折叠区承载精选的额外字段:两个家族都有 `baseURL`(占位符显示 profile 解析出的端点,deepseek 即公共端点;没有时显示可配置提供商目录为 pi-ai 内置路由报告的 `defaultBaseURL`)、各适配器自己的模型目录,以及适配器未提供的 pi-ai 路由的**显示名称**与 **API 协议**。Profile `headers` 仍是 `cordis.patch.yml` 或 Cordis 配置中的部署配置,Models 页面不提供编辑器。Provider ID 保持固定:它是 settings 的键、其他每个 namespace 与每一条已记录会话引用的名字,也是页面读不回、因而搬不走的凭据引用词干。这里没有提供商级的推理等级字段:它是按模型的能力,提供商级的控件只可能被设成某些模型会拒绝的值。每个模型行可编辑 `id`、可选显示 `name`、可选 `contextWindow`/`maxTokens`、输入类型,以及手工声明的 pi-ai 路由上的推理等级;无关的模型字段在编辑后仍会保留。
|
||||
收起的「自定义设置」折叠区承载精选的额外字段:两个家族都有 `baseURL`(占位符显示 profile 解析出的端点,deepseek 即公共端点;没有时显示可配置提供商目录为 pi-ai 内置路由报告的 `defaultBaseURL`)、各适配器自己的模型目录,以及适配器未提供的 pi-ai 路由的**显示名称**与 **API 协议**。Profile `headers` 仍是 `cordis.patch.yml` 或 Cordis 配置中的部署配置,Models 页面不提供编辑器。Provider ID 保持固定:它是 settings 的键、其他每个 namespace 与每一条已记录会话引用的名字,也是页面读不回、因而搬不走的凭据引用词干。这里没有提供商级的推理等级字段:它是按模型的能力,提供商级的控件只可能被设成某些模型会拒绝的值。每个模型行可编辑 `id`、可选显示 `name`、可选 `contextWindow`/`maxTokens`、输入类型,以及 pi-ai 路由上的推理等级;无关的模型字段在编辑后仍会保留。
|
||||
|
||||
同一折叠区还为两个家族编辑提供商的 `retryPolicy`。**重试策略**默认沿用继承的策略并显示其模式;选择**仅临时错误**或**所有错误**会写入用户层策略。临时错误模式编辑最大重试次数和要重试的错误码,错误码从 `retryableCodes` schema 发布的选项中勾选,选项以文字显示(例如 `RATE_LIMIT` 显示为**请求限流**),选项之外继承或已存储的错误码也会列出并原样显示。第三方错误码可在**自定义错误码**中输入,点击**添加**或按 Enter 加入,Enter 不会提交卡片:首尾空白会去除,大小写保留,空输入被忽略,已列出的错误码只会被勾选而不会重复添加。添加的错误码只在草稿中被勾选,本次编辑中取消勾选后仍保留在列表里,保存后重新打开会再次显示;最后一个勾选项不能取消,勾选的错误码与继承值完全相同时字段保持继承;两种模式都在**退避**折叠区中编辑初始延迟、最大延迟和抖动比例,只有已存储策略自定义了退避时该折叠区才默认展开。每个空字段显示并保留继承值,先取组合层的值,再取 schema 默认值。字段中有适配器会拒绝的值时,应用按钮不可用,例如小数重试次数、非正延迟或大于 1 的抖动比例。拒绝原因显示在字段下方;折叠区收起时显示在卡片操作按钮上方。未设置模式的已存储策略显示继承的模式,没有可继承的模式时显示 schema 中的第一个模式,应用时会保存该模式。切换模式时只保留新模式声明的字段。清空字段会取消该字段的设置,从而重新使用继承值;重新选择默认会移除用户层策略。
|
||||
|
||||
@@ -65,7 +65,7 @@ API 密钥输入框通过 `autocomplete="new-password"` 请求浏览器不要自
|
||||
|
||||
展开**自定义设置 → 模型选项**编辑模型。模型行较窄时,主行仅显示模型 ID,展开模型行后可查看或编辑显示名称;宽度充足时,两个输入框并排显示。显示名称获得焦点时会展开该行,并保持展开,直到显式收起。所有宽度下,Tab 都先经过模型选项和删除按钮,再到显示名称。两个提供商家族共用相同的模型行布局、标签和图标:上下文窗口与最大输出 token 数分为两列,**输入类型**独占下一行,提供**文本**和**图片**复选框。未声明输入类型的模型行优先显示已安装模型的输入类型,其次是提供商默认值,最后回退为文本。已知 pi-ai 提供商会加载已安装目录,不向端点发送请求;打开模型行不会写入覆盖值。显式输入选择具有优先权,包括为视觉模型设置的仅文本覆盖。修改复选框会保存所选类型,且至少保留一种。DeepSeek 写入 `inputModalities`,pi-ai 写入 `input`。DeepSeek 取消勾选图片时,还会移除 `imagePixelBudget` 和 `imageMaxBytes`,因为适配器在没有图片输入时拒绝这些限制。在 `cordis.patch.yml` 中清除输入字段可恢复适配器继承;**恢复默认模型**会重置整个模型目录覆盖。仅声明上游模型实际能够处理的输入类型。
|
||||
|
||||
手工声明的 pi-ai 路由上,模型行还会编辑**推理等级**,即适配器本来就从 `cordis.patch.yml` 读取的 `reasoningEfforts`;标签旁的 **?** 说明两列的含义。开关关闭时该字段不存在,模型不推理,模型选择器不提供任何档位;已存储的 `false` 在开关被操作前保持不变。打开开关总是从 off、low、medium 和 high 四行开始,不会恢复之前删掉的档位;要放弃修改请点**取消**。每行把一个档位选择框——可选值是 `llm-pi-ai` 配置 schema 允许作为 `reasoningEfforts` 键的档位,与协议选项一样从命名空间 schema 读取,目前为 `off`、`minimal`、`low`、`medium`、`high`、`xhigh`、`max`,每个档位只能用一次——与发送给它的 **API 参数值**配成一对,参数值初始为档位名;输入时清空的字段会存为档位名,离开字段后显示出来。Off 只表示关闭思考,因此它的参数值输入框是禁用的;`cordis.patch.yml` 中已为它写好的值会显示并保留。修改某行的档位时,仍是旧档位名的参数值会随之重置;自定义值只在两个思考档位之间保留,切到或切离 Off 都会重置。schema 未列出的已存键会保留自己的行,并可在该行中继续选择。行可以增删,并按行的顺序保存,模型选择器则按升级顺序列出档位。本节拒绝适配器会拒绝的配置:没有 Off 以外的档位(包括未写值的 `reasoningEfforts:`,此时开关显示为打开且没有任何行),或者 Off 以外的档位缺少参数值、任意档位的参数值为空字符串。被拒绝的值会把对应输入框标为无效,离开该输入框时会填入档位名。各行不保留自己的状态,因此删除、恢复默认或折叠之后被复用的模型行只显示它自己的模型。在 Gemini API 路由上,档位选择框只提供 `minimal`、`low`、`medium` 和 `high`,打开开关从 low、medium 和 high 三行开始,参数值输入框全部禁用并保持为档位名,修改某行档位时也随之改为新档位名;Gemini 实现只接受这四个名称作为参数值。已存储的超出范围的档位,或与档位名不同的参数值,会在行下方显示提示并阻止保存,新建卡片与编辑器都是如此;协议为 Gemini 时,编辑器也会检查继承的模型。走已安装目录的路由和 DeepSeek 卡片沿用适配器的档位,不显示推理等级控件。
|
||||
pi-ai 路由上,无论走已安装目录还是手工声明,模型行还会编辑**推理等级**,即适配器本来就从 `cordis.patch.yml` 读取的 `reasoningEfforts`;标签旁的 **?** 说明两列的含义。开关关闭时该字段不存在:已安装目录中有的模型沿用目录的档位,其他模型不推理,模型选择器不为它提供任何档位;已存储的 `false` 在开关被操作前保持不变。打开开关总是从 off、low、medium 和 high 四行开始,不会恢复之前删掉的档位;要放弃修改请点**取消**。每行把一个档位选择框——可选值是 `llm-pi-ai` 配置 schema 允许作为 `reasoningEfforts` 键的档位,与协议选项一样从命名空间 schema 读取,目前为 `off`、`minimal`、`low`、`medium`、`high`、`xhigh`、`max`,每个档位只能用一次——与发送给它的 **API 参数值**配成一对,参数值初始为档位名;输入时清空的字段会存为档位名,离开字段后显示出来。Off 只表示关闭思考,因此它的参数值输入框是禁用的;`cordis.patch.yml` 中已为它写好的值会显示并保留。修改某行的档位时,仍是旧档位名的参数值会随之重置;自定义值只在两个思考档位之间保留,切到或切离 Off 都会重置。schema 未列出的已存键会保留自己的行,并可在该行中继续选择。行可以增删,并按行的顺序保存,模型选择器则按升级顺序列出档位。本节拒绝适配器会拒绝的配置:没有 Off 以外的档位(包括未写值的 `reasoningEfforts:`,此时开关显示为打开且没有任何行),或者 Off 以外的档位缺少参数值、任意档位的参数值为空字符串。被拒绝的值会把对应输入框标为无效,离开该输入框时会填入档位名。各行不保留自己的状态,因此删除、恢复默认或折叠之后被复用的模型行只显示它自己的模型。在 `api` 为 Gemini API 的路由上,档位选择框只提供 `minimal`、`low`、`medium` 和 `high`,打开开关从 low、medium 和 high 三行开始,参数值输入框全部禁用并保持为档位名,修改某行档位时也随之改为新档位名;Gemini 实现只接受这四个名称作为参数值。已存储的超出范围的档位,或与档位名不同的参数值,会在行下方显示提示并阻止保存,新建卡片与编辑器都是如此;协议为 Gemini 时,编辑器也会检查继承的模型。走已安装目录的路由通常不存储 `api`;此时无论其模型使用哪种协议,各行都提供全部档位且参数值可编辑。DeepSeek 卡片沿用适配器的档位,不显示推理等级控件。
|
||||
|
||||
pi-ai 容量字段为空时,上下文窗口显示 `1M`,最大输出 token 数显示 `128K`。这些提示使用十进制 K/M 单位;保留空值会继续继承适配器配置。提供方级默认值可能与提示不同。
|
||||
|
||||
|
||||
@@ -75,9 +75,8 @@ export interface ModelListEditorProps {
|
||||
/** Installed provider whose catalog supplies defaults without endpoint I/O. */
|
||||
catalogProvider?: string | undefined
|
||||
/**
|
||||
* Reasoning levels a hand-declared route's rows may declare in
|
||||
* `reasoningEfforts`, in escalation order; absent or empty shows no
|
||||
* reasoning control, leaving a catalog model's levels to the catalog.
|
||||
* Reasoning levels the rows may declare in `reasoningEfforts`, in
|
||||
* escalation order; absent or empty shows no reasoning control.
|
||||
*/
|
||||
reasoningLevels?: readonly string[] | undefined
|
||||
/** Whether the route's protocol accepts only {@link reasoningLevels}, each sent under its own name. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Reasoning-level declarations for a model on a hand-declared pi-ai route. */
|
||||
/** Reasoning-level declarations for a model on a pi-ai route. */
|
||||
|
||||
import { useState } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
@@ -52,7 +52,7 @@ function readEfforts(model: DeepSeekModelDraft): Entries | undefined {
|
||||
function withEfforts(model: DeepSeekModelDraft, entries: Entries | undefined): DeepSeekModelDraft {
|
||||
const next = { ...model }
|
||||
if (entries === undefined) {
|
||||
// Absent is how a hand-declared model says it does not reason.
|
||||
// Absent keeps the installed catalog's levels; a model the catalog does not describe then does not reason.
|
||||
Reflect.deleteProperty(next, 'reasoningEfforts')
|
||||
return next
|
||||
}
|
||||
@@ -81,7 +81,7 @@ function outsideLevels(only: readonly string[], level: string, wire: unknown): b
|
||||
}
|
||||
|
||||
/**
|
||||
* Mirror the pi-ai refusals of a hand-declared `reasoningEfforts`, so a card
|
||||
* Mirror the pi-ai refusals of a model's `reasoningEfforts`, so a card
|
||||
* names the row instead of failing at the write.
|
||||
* @param value - drafted `models` value, or `undefined` while inherited.
|
||||
* @param only - the levels the route's protocol accepts, each sent under its
|
||||
@@ -120,7 +120,7 @@ interface ModelReasoningEffortsProps {
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit the `reasoningEfforts` a hand-declared pi-ai model offers: a switch,
|
||||
* Edit the `reasoningEfforts` a pi-ai model offers: a switch,
|
||||
* then one row per level pairing the level with the value sent for it. Every
|
||||
* row is read from the model, so a reused instance shows its new model.
|
||||
* @param props - model declaration and row replacement action.
|
||||
|
||||
@@ -250,12 +250,12 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
|
||||
|
||||
// The model list is validated by the same per-row checker for both families,
|
||||
// so a bad row is named by its position rather than by a blanket message.
|
||||
// Only a hand-declared pi-ai route's rows edit reasoning levels — the one
|
||||
// model list with no installed catalog behind it — so only there are the
|
||||
// levels read and the declarations checked.
|
||||
// Every pi-ai route's rows edit reasoning levels, catalog and hand-declared
|
||||
// alike: the adapter resolves a row's `reasoningEfforts` the same way on
|
||||
// both, so the levels are read and the declarations checked for both.
|
||||
const schemaReasoningLevels = useMemo(
|
||||
() => layout === 'pi-ai' && props.declared === true ? reasoningLevelChoices(namespace, schema) : [],
|
||||
[layout, props.declared, namespace, schema],
|
||||
() => layout === 'pi-ai' ? reasoningLevelChoices(namespace, schema) : [],
|
||||
[layout, namespace, schema],
|
||||
)
|
||||
// What the form currently shows, which is what an interrogation must ask and
|
||||
// what decides the protocol's own constraints: an edited-but-unsaved protocol.
|
||||
|
||||
@@ -147,7 +147,7 @@ export function protocolChoices(
|
||||
}
|
||||
|
||||
/**
|
||||
* The reasoning levels a hand-declared route's models may declare, read out of
|
||||
* The reasoning levels a pi-ai route's models may declare, read out of
|
||||
* the owning namespace's own schema for the same reason as
|
||||
* {@link protocolChoices}: the levels the page offers and the keys the
|
||||
* adapter accepts in `reasoningEfforts` come from the same `Config`.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @vitest-environment jsdom
|
||||
/** Reasoning levels of hand-declared pi-ai models: echo, level rows, API values, refusals, and placement. */
|
||||
/** Reasoning levels of pi-ai models: echo, level rows, API values, refusals, and placement. */
|
||||
import { useState } from 'react'
|
||||
import { cleanup, fireEvent, render, screen, within } from '@testing-library/react'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
@@ -325,10 +325,22 @@ describe('reasoning levels in the model list', () => {
|
||||
expect(writes.at(-1)).toEqual([{ id: 'b', reasoningEfforts: DEFAULTS }])
|
||||
})
|
||||
|
||||
it('edits a catalog route row', () => {
|
||||
const writes: DeepSeekModelDraft[][] = []
|
||||
render(<ModelListEditor
|
||||
models={[{ id: 'gpt-5' }]} onChange={(next) => { writes.push(next) }} catalogProvider="openai" reasoningLevels={LEVELS}
|
||||
probe={{ settingsNs: 'llm-pi-ai', provider: 'openai' }}
|
||||
operations={operations} disabled={false} t={t} onBusyChange={() => {}}
|
||||
/>)
|
||||
fireEvent.click(screen.getByRole('button', { name: `${en.modelAdvanced} 1` }))
|
||||
fireEvent.click(toggle())
|
||||
expect(writes.at(-1)).toEqual([{ id: 'gpt-5', reasoningEfforts: DEFAULTS }])
|
||||
})
|
||||
|
||||
it.each([
|
||||
['without a level list', undefined],
|
||||
['with an empty level list', []],
|
||||
])('shows no reasoning control %s, leaving catalog rows to the installed catalog', (_label, reasoningLevels) => {
|
||||
])('shows no reasoning control %s', (_label, reasoningLevels) => {
|
||||
render(<ModelListEditor
|
||||
models={[{ id: 'gpt-5' }]} onChange={vi.fn()} catalogProvider="openai" reasoningLevels={reasoningLevels}
|
||||
probe={{ settingsNs: 'llm-pi-ai', provider: 'openai' }}
|
||||
|
||||
@@ -497,6 +497,24 @@ describe('model list editing', () => {
|
||||
.toContainEqual({ op: 'unset', path: ['providers', 'openai', 'models'] })
|
||||
})
|
||||
|
||||
it('declares reasoning levels on a catalog route model and stores them in its models list', async () => {
|
||||
const { mutate } = await mountSection({
|
||||
providers: { openai: { apiKeyEnv: 'OPENAI_API_KEY', models: [{ id: 'gpt-5', name: 'GPT-5' }] } },
|
||||
})
|
||||
openEditor('openai')
|
||||
expandModel(1)
|
||||
// Switched off, the field is absent and the model keeps the installed catalog's levels.
|
||||
const toggle = screen.getByRole('switch', { name: `${en.modelReasoning} 1` })
|
||||
expect(toggle.getAttribute('aria-checked')).toBe('false')
|
||||
|
||||
fireEvent.click(toggle)
|
||||
fireEvent.click(screen.getByText(en.apply))
|
||||
await waitFor(() => { expect(mutate).toHaveBeenCalledTimes(1) })
|
||||
expect(firstMutate(mutate).ops).toEqual([{
|
||||
op: 'set', path: ['providers', 'openai', 'models'],
|
||||
value: [{ id: 'gpt-5', name: 'GPT-5', reasoningEfforts: { off: null, low: 'low', medium: 'medium', high: 'high' } }],
|
||||
}])
|
||||
})
|
||||
})
|
||||
|
||||
describe('capacity spellings', () => {
|
||||
@@ -1228,11 +1246,11 @@ describe('hand-declared providers', () => {
|
||||
})
|
||||
|
||||
it.each([
|
||||
['blocks a hand-declared route', true],
|
||||
['leaves a catalog route to the adapter', false],
|
||||
])('%s whose stored reasoning levels the adapter refuses', async (_label, declared) => {
|
||||
// Only a hand-declared route's rows edit reasoning levels, so only there
|
||||
// can the card name the row and offer the switch that repairs it.
|
||||
['a hand-declared route', true],
|
||||
['a catalog route', false],
|
||||
])('blocks %s whose stored reasoning levels the adapter refuses', async (_label, declared) => {
|
||||
// The adapter refuses the same declarations on both kinds of route, and
|
||||
// both edit them, so the card names the row and offers the switch that repairs it.
|
||||
await mountSection({
|
||||
providers: {
|
||||
'acme-gateway': {
|
||||
@@ -1244,9 +1262,8 @@ describe('hand-declared providers', () => {
|
||||
})
|
||||
openEditor('acme-gateway')
|
||||
|
||||
const refusal = `${en.model} 1: ${en.modelReasoningNeedsLevel}`
|
||||
expect(screen.queryByText(refusal) !== null).toBe(declared)
|
||||
expect(buttonNamed(en.apply).disabled).toBe(declared)
|
||||
expect(screen.getByText(`${en.model} 1: ${en.modelReasoningNeedsLevel}`)).toBeTruthy()
|
||||
expect(buttonNamed(en.apply).disabled).toBe(true)
|
||||
})
|
||||
|
||||
it('retries only the key after the profile landed, and reports the provider on cancel', async () => {
|
||||
|
||||
@@ -93,8 +93,8 @@
|
||||
en: b6bd570c0159ba08
|
||||
zh: 7d2d91eea6a8d830
|
||||
/deepseek-ai-dsh-llm-pi-ai/known-limitations-and-deferred-work:
|
||||
en: fdbe8ce850250b66
|
||||
zh: d8b9a06a996850c1
|
||||
en: ca569aca42ffe0bc
|
||||
zh: 2d5e30f0b422166b
|
||||
/deepseek-ai-dsh-llm-pi-ai/known-limitations-and-deferred-work/dev-note:
|
||||
en: 3678dd0f6642c2a5
|
||||
zh: 75cbdd064cc64282
|
||||
@@ -267,7 +267,7 @@ These limits define where the adapter stops and future work begins. They are cur
|
||||
- **Uncataloged models need an unambiguous protocol** — catalog routes preserve each model's protocol, including both Azure APIs under `azure`. A model absent from a mixed-protocol catalog needs an explicit route-level `api`, which overrides every model on the route and must be one of the supported custom protocols. For Azure deployment names, keep the catalog model ID and set `AZURE_OPENAI_DEPLOYMENT_NAME_MAP`.
|
||||
- **A modality declaration is not verified** — a model declaring `image` its gateway does not serve is refused by the provider after prompt admission. The durable image remains in history and the same misdeclared model can fail again; switching to a text-only model remains possible because the shared LLM runtime projects image references into stable text for that request.
|
||||
- **An unauthenticated route depends on its protocol** — a route naming no credential resolves as configured-but-keyless, but pi-ai's OpenAI-compatible implementation still requires an API key or an `Authorization` header, so a keyless local server needs a placeholder credential referenced by `apiKeyEnv` or an `Authorization` entry in `headers`. pi-ai's Gemini implementation refuses a request without an API key, so a `google-generative-ai` route always needs `apiKeyEnv`, whose value it sends as `x-goog-api-key`.
|
||||
- **Gemini accepts four reasoning levels** — on `google-generative-ai`, pi-ai's Gemini implementation sends only `minimal`, `low`, `medium`, or `high`, compared without case, and fails a request whose `reasoningEfforts` value names anything else; the [Models page](../../client/ui-settings-models/README.md) offers only these levels for such a route. A request without a level, including `off`, sends pi-ai's disabled-thinking configuration, which models that cannot disable thinking, such as Gemini 2.5 Pro, may reject.
|
||||
- **Gemini accepts four reasoning levels** — on `google-generative-ai`, pi-ai's Gemini implementation sends only `minimal`, `low`, `medium`, or `high`, compared without case, and fails a request whose `reasoningEfforts` value names anything else; the [Models page](../../client/ui-settings-models/README.md) offers only these levels for a route whose `api` names this protocol. A request without a level, including `off`, sends pi-ai's disabled-thinking configuration, which models that cannot disable thinking, such as Gemini 2.5 Pro, may reject.
|
||||
- **`GenerateOptions.stop` is unsupported** — pi-ai's common stream options cannot guarantee stop-sequence behavior across providers.
|
||||
- **Conversation update support comes only from the installed pi-ai catalog** — native system and tool updates require the catalog model’s mid-conversation compat flags, which profiles cannot set. Hand-declared routes and unflagged models receive later system text as user-role reminders and the complete current tool list at the start of each request.
|
||||
- **Images are accepted only in user and tool-result messages** — images in system, developer, or assistant history fail with `UNSUPPORTED_CONTENT` on both conversion paths.
|
||||
|
||||
@@ -267,7 +267,7 @@ pi-ai 事件变成 harness 的推理、文本、工具调用、用量与 finish
|
||||
- **目录外模型需要明确的协议**——目录路由保留每个模型的协议,包括 `azure` 下的两种 Azure API。混合协议目录中不存在的模型需要显式设置路由级 `api`;该设置覆盖路由上的所有模型,且必须属于受支持的自定义协议。Azure 部署名称应通过 `AZURE_OPENAI_DEPLOYMENT_NAME_MAP` 设置,模型 ID 保持为目录中的 ID。
|
||||
- **模态声明不受校验**——声明 `image` 而其网关不支持的模型会在提示词准入后被提供方拒绝。持久图片仍留在历史中,同一误声明模型可能再次失败;切换到纯文本模型仍然可行,因为共享 LLM 运行时会针对该请求把图片引用投影为稳定文本。
|
||||
- **未认证路由取决于其协议**——不点名凭据的路由解析为已配置但无密钥,但 pi-ai 的 OpenAI 兼容实现仍要求 API 密钥或 `Authorization` 标头,因此无密钥本地服务器需要由 `apiKeyEnv` 引用或 `headers` 中的 `Authorization` 条目提供的占位凭据。pi-ai 的 Gemini 实现会拒绝没有 API 密钥的请求,因此 `google-generative-ai` 路由始终需要 `apiKeyEnv`,其值以 `x-goog-api-key` 发送。
|
||||
- **Gemini 只接受四个推理等级**——在 `google-generative-ai` 上,pi-ai 的 Gemini 实现只发送 `minimal`、`low`、`medium` 或 `high`(不区分大小写),`reasoningEfforts` 的值为其他名称时请求失败;[模型页](../../client/ui-settings-models/README.zh.md)只为此类路由提供这些档位。不带等级的请求(包括 `off`)会发送 pi-ai 的关闭思考配置,无法关闭思考的模型(例如 Gemini 2.5 Pro)可能拒绝该请求。
|
||||
- **Gemini 只接受四个推理等级**——在 `google-generative-ai` 上,pi-ai 的 Gemini 实现只发送 `minimal`、`low`、`medium` 或 `high`(不区分大小写),`reasoningEfforts` 的值为其他名称时请求失败;[模型页](../../client/ui-settings-models/README.zh.md)只为 `api` 指定该协议的路由提供这些档位。不带等级的请求(包括 `off`)会发送 pi-ai 的关闭思考配置,无法关闭思考的模型(例如 Gemini 2.5 Pro)可能拒绝该请求。
|
||||
- **不支持 `GenerateOptions.stop`**——pi-ai 的通用流式选项无法跨提供方保证停止序列行为。
|
||||
- **对话更新支持只来自已安装的 pi-ai 目录**——原生系统与工具更新需要目录模型的对话中 compat 标志,profile 不能设置这些标志。手工声明的路由与未标记的模型会以用户角色提醒接收后续系统文本,并在每次请求开头接收完整的当前工具列表。
|
||||
- **图片只在 user 与工具结果消息中被接受**——system、developer 或 assistant 历史中的图片在两条转换路径上都会以 `UNSUPPORTED_CONTENT` 失败。
|
||||
|
||||
Reference in new issue
Block a user