@sparkelf/dsh-patch-responses-reasoning-status 0.1.0-rc.14 → 0.1.0-rc.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/package.json +3 -3
- package/patches/responses-reasoning-status.patch +17 -151
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write patches/npm/responses-reasoning-status/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 998c4b0933733ea6d01565c30647510ccb5cb5c5
|
|
6
|
+
README.zh.md: c6f95488b6525e74875490b56d655818bdbce6dc
|
package/README.md
CHANGED
|
@@ -6,4 +6,4 @@ This data-only package adds one explicit `llm-pi-ai` route option for OpenAI Res
|
|
|
6
6
|
|
|
7
7
|
The official Models editor shows a localized **Gateway compatibility mode** checkbox only for pi-ai routes whose effective protocol is `openai-responses`. User-layer disablement deletes the leaf unless an inherited true requires an explicit false, and changing protocol removes or masks the incompatible setting without replacing sibling fields.
|
|
8
8
|
|
|
9
|
-
The target is exact official source revision `
|
|
9
|
+
The target is exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`. This package has no JavaScript entry, lifecycle script, Cordis plugin, fallback, or alternate variant. Retire it when official DSH ships equivalent pi-ai Responses input adjustment and Models editor behavior.
|
package/README.zh.md
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
|
|
7
7
|
official Models editor只在effective protocol为`openai-responses`的pi-ai routes中显示localized **中转站兼容模式** checkbox。user-layer关闭操作在没有inherited true时删除该leaf;存在inherited true时写入显式false。切换protocol会删除或遮蔽不兼容设置,而不会替换sibling fields。
|
|
8
8
|
|
|
9
|
-
target是exact official source revision `
|
|
9
|
+
target是exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`。本package没有JavaScript entry、lifecycle script、Cordis plugin、fallback或alternate variant。official DSH提供等价pi-ai Responses input adjustment与Models editor behavior后,retire本package。
|
package/package.json
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"formatVersion": 1,
|
|
5
5
|
"variants": [
|
|
6
6
|
{
|
|
7
|
-
"dsh": ">=0.1.
|
|
7
|
+
"dsh": ">=0.1.5-rc.2",
|
|
8
8
|
"file": "./patches/responses-reasoning-status.patch",
|
|
9
9
|
"id": "responses-omit-reasoning-input-status",
|
|
10
10
|
"target": {
|
|
11
|
-
"baseRevision": "
|
|
11
|
+
"baseRevision": "fb2c4b9e698e30edb738bca4cf0618587db7d203",
|
|
12
12
|
"kind": "dsh-source",
|
|
13
13
|
"paths": [
|
|
14
14
|
"packages/llm/llm-pi-ai/",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
|
|
33
33
|
},
|
|
34
34
|
"type": "module",
|
|
35
|
-
"version": "0.1.0-rc.
|
|
35
|
+
"version": "0.1.0-rc.26"
|
|
36
36
|
}
|
|
@@ -1,46 +1,8 @@
|
|
|
1
|
-
diff --git a/packages/client/ui-settings-models/README.i18n.yaml b/packages/client/ui-settings-models/README.i18n.yaml
|
|
2
|
-
index 1977fc9620..0822ab8417 100644
|
|
3
|
-
--- a/packages/client/ui-settings-models/README.i18n.yaml
|
|
4
|
-
+++ b/packages/client/ui-settings-models/README.i18n.yaml
|
|
5
|
-
@@ -2,5 +2,5 @@
|
|
6
|
-
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
7
|
-
# after editing either side, bring the other along and re-record with:
|
|
8
|
-
# pnpm run verify-translation-pairing --write packages/client/ui-settings-models/README.md
|
|
9
|
-
-README.md: 920780b2193d6165a10967cc49afcb5b7e193105
|
|
10
|
-
-README.zh.md: 4ec9ae43eef9a13ffde22e2a3de0e44d3b6cb51d
|
|
11
|
-
+README.md: c68a0defc3ad882f66f81afbe61cfad4c912a4fa
|
|
12
|
-
+README.zh.md: e161a26112080d24455c5c541e501fe1fd0b7cf1
|
|
13
|
-
diff --git a/packages/client/ui-settings-models/README.md b/packages/client/ui-settings-models/README.md
|
|
14
|
-
index 920780b219..c68a0defc3 100644
|
|
15
|
-
--- a/packages/client/ui-settings-models/README.md
|
|
16
|
-
+++ b/packages/client/ui-settings-models/README.md
|
|
17
|
-
@@ -33,7 +33,7 @@ The primary field on an editor card is a single **API key** input — the page n
|
|
18
|
-
|
|
19
|
-
### Editing a provider
|
|
20
|
-
|
|
21
|
-
-The collapsed 自定义设置 fold carries the curated extras: `baseURL` for both families (the deepseek placeholder shows the public endpoint), each adapter's model catalog, and the **display name** and **API protocol** of a pi-ai route the adapter does not ship. 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. Reasoning effort is deliberately not among the editable fields: it is a per-model capability, so a provider-scoped control could only be set to a value some models reject. Each DeepSeek row edits `id`, optional display `name`, and optional `contextWindow`/`maxTokens`; existing fields outside that curated set survive edits.
|
|
22
|
-
+The collapsed 自定义设置 fold carries the curated extras: `baseURL` for both families (the deepseek placeholder shows the public endpoint), each adapter's model catalog, and the **display name** and **API protocol** of a pi-ai route the adapter does not ship. A pi-ai route whose effective protocol is `openai-responses` also shows **Gateway compatibility mode**, which writes `responsesCompatibility.omitReasoningInputStatus`; disabling it deletes the user leaf unless an inherited true requires an explicit false, and changing protocol removes or masks the incompatible setting while preserving sibling fields. 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. Reasoning effort is deliberately not among the editable fields: it is a per-model capability, so a provider-scoped control could only be set to a value some models reject. Each DeepSeek row edits `id`, optional display `name`, and optional `contextWindow`/`maxTokens`; existing fields outside that curated set survive edits.
|
|
23
|
-
|
|
24
|
-
### Adding and deleting providers
|
|
25
|
-
|
|
26
|
-
diff --git a/packages/client/ui-settings-models/README.zh.md b/packages/client/ui-settings-models/README.zh.md
|
|
27
|
-
index 4ec9ae43ee..e161a26112 100644
|
|
28
|
-
--- a/packages/client/ui-settings-models/README.zh.md
|
|
29
|
-
+++ b/packages/client/ui-settings-models/README.zh.md
|
|
30
|
-
@@ -33,7 +33,7 @@ kind: "package-reference"
|
|
31
|
-
|
|
32
|
-
### 编辑提供方
|
|
33
|
-
|
|
34
|
-
-收起的「自定义设置」折叠区承载精选的额外字段:两个家族都有 `baseURL`(deepseek 的占位符显示公共端点)、各适配器自己的模型目录,以及适配器未提供的 pi-ai 路由的**显示名称**与 **API 协议**。Provider ID 保持固定:它是 settings 的键、其他每个 namespace 与每一条已记录会话引用的名字,也是页面读不回、因而搬不走的凭据引用词干。推理等级刻意不在可编辑字段之列:它是按模型的能力,提供方级的控件只可能被设成某些模型会拒绝的值。每个 DeepSeek 行编辑 `id`、可选显示 `name` 与可选 `contextWindow`/`maxTokens`;该精选集之外的现有字段在编辑后仍会保留。
|
|
35
|
-
+收起的「自定义设置」折叠区承载精选的额外字段:两个家族都有 `baseURL`(deepseek 的占位符显示公共端点)、各适配器自己的模型目录,以及适配器未提供的 pi-ai 路由的**显示名称**与 **API 协议**。effective protocol为 `openai-responses` 的pi-ai路由还会显示**中转站兼容模式**,写入 `responsesCompatibility.omitReasoningInputStatus`;关闭时,若没有继承的true则删除user leaf,否则写入显式false,切换协议也会删除或遮蔽不兼容设置,并保留sibling fields。Provider ID 保持固定:它是 settings 的键、其他每个 namespace 与每一条已记录会话引用的名字,也是页面读不回、因而搬不走的凭据引用词干。推理等级刻意不在可编辑字段之列:它是按模型的能力,提供方级的控件只可能被设成某些模型会拒绝的值。每个 DeepSeek 行编辑 `id`、可选显示 `name` 与可选 `contextWindow`/`maxTokens`;该精选集之外的现有字段在编辑后仍会保留。
|
|
36
|
-
|
|
37
|
-
### 新增与删除提供方
|
|
38
|
-
|
|
39
1
|
diff --git a/packages/client/ui-settings-models/src/client/ModelsSection.module.css b/packages/client/ui-settings-models/src/client/ModelsSection.module.css
|
|
40
|
-
index
|
|
2
|
+
index 2dc72373ea..f0a9ab95fb 100644
|
|
41
3
|
--- a/packages/client/ui-settings-models/src/client/ModelsSection.module.css
|
|
42
4
|
+++ b/packages/client/ui-settings-models/src/client/ModelsSection.module.css
|
|
43
|
-
@@ -
|
|
5
|
+
@@ -397,6 +397,31 @@
|
|
44
6
|
padding-top: 12px;
|
|
45
7
|
}
|
|
46
8
|
|
|
@@ -162,96 +124,30 @@ index ffa8c2e1fe..3c3e7729b4 100644
|
|
|
162
124
|
the extras differ — DeepSeek's inherited capacities, pi-ai's
|
|
163
125
|
endpoint interrogation. */}
|
|
164
126
|
diff --git a/packages/client/ui-settings-models/src/client/locales.ts b/packages/client/ui-settings-models/src/client/locales.ts
|
|
165
|
-
index
|
|
127
|
+
index 3a3190416f..49aac02f68 100644
|
|
166
128
|
--- a/packages/client/ui-settings-models/src/client/locales.ts
|
|
167
129
|
+++ b/packages/client/ui-settings-models/src/client/locales.ts
|
|
168
|
-
@@ -
|
|
130
|
+
@@ -85,6 +85,7 @@ export const en = {
|
|
169
131
|
customDisplayName: 'Display name',
|
|
170
132
|
customApi: 'API protocol',
|
|
171
133
|
customApiUnset: 'Not selected',
|
|
172
134
|
+ omitReasoningInputStatus: 'Gateway compatibility mode',
|
|
173
135
|
customNeedsBaseUrl: 'A custom provider needs a base URL.',
|
|
136
|
+
customBaseUrlInvalid: 'Enter a valid HTTP or HTTPS URL.',
|
|
174
137
|
customNeedsModels: 'A custom provider needs at least one model.',
|
|
175
|
-
|
|
176
|
-
@@ -187,6 +188,7 @@ export const zh: { [Key in keyof typeof en]: string } = {
|
|
138
|
+
@@ -192,6 +193,7 @@ export const zh: { [Key in keyof typeof en]: string } = {
|
|
177
139
|
customDisplayName: '显示名称',
|
|
178
140
|
customApi: 'API 协议',
|
|
179
141
|
customApiUnset: '未选择',
|
|
180
142
|
+ omitReasoningInputStatus: '中转站兼容模式',
|
|
181
143
|
customNeedsBaseUrl: '自定义提供方需要填写 API 地址。',
|
|
144
|
+
customBaseUrlInvalid: '请输入有效的 HTTP 或 HTTPS 地址。',
|
|
182
145
|
customNeedsModels: '自定义提供方至少需要一个模型。',
|
|
183
|
-
customBaseUrlPlaceholder: 'https://gateway.example/v1',
|
|
184
|
-
diff --git a/packages/llm/llm-pi-ai/README.i18n.yaml b/packages/llm/llm-pi-ai/README.i18n.yaml
|
|
185
|
-
index 38b01bcd52..43d8e199ba 100644
|
|
186
|
-
--- a/packages/llm/llm-pi-ai/README.i18n.yaml
|
|
187
|
-
+++ b/packages/llm/llm-pi-ai/README.i18n.yaml
|
|
188
|
-
@@ -2,5 +2,5 @@
|
|
189
|
-
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
190
|
-
# after editing either side, bring the other along and re-record with:
|
|
191
|
-
# pnpm run verify-translation-pairing --write packages/llm/llm-pi-ai/README.md
|
|
192
|
-
-README.md: dcafde78e176bd0acd142145d651d6d5b5539626
|
|
193
|
-
-README.zh.md: a7292638b8449d7192d3e003f0377967d11ef94d
|
|
194
|
-
+README.md: 5db7b2fecd77bcdc27f55851fcbaa32401326adf
|
|
195
|
-
+README.zh.md: 319059c93916e87f127bf56ba5d1b9c6f81c006c
|
|
196
|
-
diff --git a/packages/llm/llm-pi-ai/README.md b/packages/llm/llm-pi-ai/README.md
|
|
197
|
-
index dcafde78e1..5db7b2fecd 100644
|
|
198
|
-
--- a/packages/llm/llm-pi-ai/README.md
|
|
199
|
-
+++ b/packages/llm/llm-pi-ai/README.md
|
|
200
|
-
@@ -79,6 +79,7 @@ Each profile may set a `retryPolicy`; omission uses normal mode with five retrie
|
|
201
|
-
| `models` | installed catalog | Replaces the route's catalog wholesale; each entry defaults from the installed model |
|
|
202
|
-
| `modelOverrides` | none | Reshapes individual installed-catalog models without replacing the rest |
|
|
203
|
-
| `compat` | catalog detection | Wire-compatibility switches for unrecognized endpoints |
|
|
204
|
-
+| `responsesCompatibility` | absent | OpenAI Responses input-item adjustments for compatible gateways |
|
|
205
|
-
| `defaultContextWindow` | `262,144` | Capacity fallback for undescribed models |
|
|
206
|
-
| `defaultMaxTokens` | `32,768` | Output-cap fallback for undescribed models |
|
|
207
|
-
| `requestImagePixelBudget` | `4,194,304` | Total-pixel budget for each deterministic request image |
|
|
208
|
-
@@ -98,7 +99,7 @@ A profile's `models` list replaces the route's installed catalog rather than ext
|
|
209
|
-
|
|
210
|
-
### Run with reasoning and wire compatibility
|
|
211
|
-
|
|
212
|
-
-`reasoningEfforts` declares a model's selectable thinking levels: each key is a level selectors offer, its value the spelling dispatch sends on the wire, so `max: ultra` renames a level for a gateway with its own vocabulary. Omitting the field keeps the installed catalog entry's capability; `false` declares a non-reasoning model. `compat` switches reshape the request for endpoints pi-ai cannot recognize — which role carries the system prompt, which field caps output, how a thinking level travels — configurable per route and per model. A model neither the entry nor the installed catalog sizes takes the route's `defaultContextWindow` and `defaultMaxTokens` fallbacks.
|
|
213
|
-
+`reasoningEfforts` declares a model's selectable thinking levels: each key is a level selectors offer, its value the spelling dispatch sends on the wire, so `max: ultra` renames a level for a gateway with its own vocabulary. Omitting the field keeps the installed catalog entry's capability; `false` declares a non-reasoning model. `compat` switches reshape the request for endpoints pi-ai cannot recognize — which role carries the system prompt, which field caps output, how a thinking level travels — configurable per route and per model. An explicit `openai-responses` route may set `responsesCompatibility.omitReasoningInputStatus: true` when its gateway accepts replayed reasoning items but rejects their response-only `status` field; the adapter removes only that field from top-level reasoning input items after pi-ai serializes the request, and every other protocol refuses the option. A model neither the entry nor the installed catalog sizes takes the route's `defaultContextWindow` and `defaultMaxTokens` fallbacks.
|
|
214
|
-
|
|
215
|
-
### Change configuration at runtime
|
|
216
|
-
|
|
217
|
-
diff --git a/packages/llm/llm-pi-ai/README.zh.md b/packages/llm/llm-pi-ai/README.zh.md
|
|
218
|
-
index a7292638b8..319059c939 100644
|
|
219
|
-
--- a/packages/llm/llm-pi-ai/README.zh.md
|
|
220
|
-
+++ b/packages/llm/llm-pi-ai/README.zh.md
|
|
221
|
-
@@ -79,6 +79,7 @@ kind: "package-reference"
|
|
222
|
-
| `models` | 已安装目录 | 整体替换路由目录;每个条目从已安装模型取默认值 |
|
|
223
|
-
| `modelOverrides` | 无 | 重塑个别已安装目录模型,而不替换其余模型 |
|
|
224
|
-
| `compat` | 目录检测 | 无法识别端点的协议兼容开关 |
|
|
225
|
-
+| `responsesCompatibility` | 无 | 兼容网关的 OpenAI Responses 输入项调整 |
|
|
226
|
-
| `defaultContextWindow` | `262,144` | 未描述模型的容量回退 |
|
|
227
|
-
| `defaultMaxTokens` | `32,768` | 未描述模型的输出上限回退 |
|
|
228
|
-
| `requestImagePixelBudget` | `4,194,304` | 每张确定性请求图片的总像素预算 |
|
|
229
|
-
@@ -98,7 +99,7 @@ profile 的 `models` 列表会替换而非扩展路由的已安装目录;每
|
|
230
|
-
|
|
231
|
-
### 带推理与协议兼容运行
|
|
232
|
-
|
|
233
|
-
-`reasoningEfforts` 声明模型可选择的 thinking 等级:每个键都是选择器提供的等级,其值是该等级过线的拼写,因此 `max: ultra` 可以为拥有自有词汇的网关重命名等级。省略该字段时保留已安装目录条目的能力;`false` 声明非推理模型。对于 pi-ai 无法识别的端点,`compat` 开关重塑请求——哪个角色携带系统提示词、哪个字段限制输出、thinking 等级如何传递——可逐路由、逐模型配置。条目与已安装目录都没有尺寸的模型,会采用路由的 `defaultContextWindow` 与 `defaultMaxTokens` 回退值。
|
|
234
|
-
+`reasoningEfforts` 声明模型可选择的 thinking 等级:每个键都是选择器提供的等级,其值是该等级过线的拼写,因此 `max: ultra` 可以为拥有自有词汇的网关重命名等级。省略该字段时保留已安装目录条目的能力;`false` 声明非推理模型。对于 pi-ai 无法识别的端点,`compat` 开关重塑请求——哪个角色携带系统提示词、哪个字段限制输出、thinking 等级如何传递——可逐路由、逐模型配置。显式使用 `openai-responses` 的路由可在网关接受历史 reasoning 项、但拒绝其中响应侧专用 `status` 字段时设置 `responsesCompatibility.omitReasoningInputStatus: true`;适配器在 pi-ai 序列化请求后,仅从顶层 reasoning 输入项删除该字段,其他协议会拒绝此选项。条目与已安装目录都没有尺寸的模型,会采用路由的 `defaultContextWindow` 与 `defaultMaxTokens` 回退值。
|
|
235
|
-
|
|
236
|
-
### 运行时更改配置
|
|
237
|
-
|
|
238
146
|
diff --git a/packages/llm/llm-pi-ai/src/adapter.ts b/packages/llm/llm-pi-ai/src/adapter.ts
|
|
239
|
-
index
|
|
147
|
+
index 8dba978c31..5bd80331c5 100644
|
|
240
148
|
--- a/packages/llm/llm-pi-ai/src/adapter.ts
|
|
241
149
|
+++ b/packages/llm/llm-pi-ai/src/adapter.ts
|
|
242
|
-
@@ -
|
|
243
|
-
} from '@earendil-works/pi-ai'
|
|
244
|
-
import {
|
|
245
|
-
attributionHeaders,
|
|
246
|
-
+ contentHasDocument,
|
|
247
|
-
contentHasImage,
|
|
248
|
-
LlmAdapter,
|
|
249
|
-
LlmError,
|
|
250
|
-
+ projectRequestDocumentsWithAttachments,
|
|
251
|
-
ReasoningEffortId,
|
|
252
|
-
} from '@deepseek-ai/dsh-llm'
|
|
253
|
-
import type {
|
|
254
|
-
@@ -111,6 +113,24 @@ export interface PiAiAuthInjection {
|
|
150
|
+
@@ -111,6 +111,24 @@ export interface PiAiAuthInjection {
|
|
255
151
|
authContext: AuthContext
|
|
256
152
|
}
|
|
257
153
|
|
|
@@ -276,7 +172,7 @@ index e20b8e0072..058e8f2824 100644
|
|
|
276
172
|
/** Copy profile stream knobs into pi-ai's common option vocabulary. */
|
|
277
173
|
function profileOptions(
|
|
278
174
|
profile: ResolvedPiAiProviderProfile,
|
|
279
|
-
@@ -126,6 +
|
|
175
|
+
@@ -126,6 +144,7 @@ function profileOptions(
|
|
280
176
|
...profile.transport === undefined ? {} : { transport: profile.transport },
|
|
281
177
|
...profile.timeoutMs === undefined ? {} : { timeoutMs: profile.timeoutMs },
|
|
282
178
|
...profile.websocketConnectTimeoutMs === undefined ? {} : { websocketConnectTimeoutMs: profile.websocketConnectTimeoutMs },
|
|
@@ -284,41 +180,11 @@ index e20b8e0072..058e8f2824 100644
|
|
|
284
180
|
// The agent recovery layer owns visible attempts; one adapter call is one SDK attempt.
|
|
285
181
|
maxRetries: 0,
|
|
286
182
|
}
|
|
287
|
-
@@ -350,20 +371,24 @@ export class PiAiAdapter extends LlmAdapter {
|
|
288
|
-
using watchdog = idleWatchdog(upstream, streamIdleTimeoutMs, 'LLM_STREAM_IDLE_TIMEOUT')
|
|
289
|
-
|
|
290
|
-
try {
|
|
291
|
-
+ const containsDocument = options.messages.some(message => contentHasDocument(message.content))
|
|
292
|
-
const containsImage = options.messages.some(message => contentHasImage(message.content))
|
|
293
|
-
if (containsImage && !model.input.includes('image')) {
|
|
294
|
-
throw new LlmError(`pi-ai model "${model.id}" does not support image input`, 'UNSUPPORTED_CONTENT')
|
|
295
|
-
}
|
|
296
|
-
- const attachments = containsImage ? this.config.resolveAttachments?.() : undefined
|
|
297
|
-
- if (containsImage && attachments === undefined) {
|
|
298
|
-
- throw new LlmError('pi-ai image input requires the durable attachment service', 'UNSUPPORTED_CONTENT')
|
|
299
|
-
+ const attachments = containsDocument || containsImage ? this.config.resolveAttachments?.() : undefined
|
|
300
|
-
+ if ((containsDocument || containsImage) && attachments === undefined) {
|
|
301
|
-
+ throw new LlmError('pi-ai document and image input requires the durable attachment service', 'UNSUPPORTED_CONTENT')
|
|
302
|
-
}
|
|
303
|
-
+ const requestOptions = containsDocument
|
|
304
|
-
+ ? { ...options, messages: await projectRequestDocumentsWithAttachments(options.messages, attachments as AttachmentStore, watchdog.signal) }
|
|
305
|
-
+ : options
|
|
306
|
-
const onReplayDegrade = (reason: string): void => {
|
|
307
|
-
this.config.onReplayDegrade?.({ provider: options.provider, model: options.model, reason })
|
|
308
|
-
}
|
|
309
|
-
const context = attachments === undefined
|
|
310
|
-
- ? toPiContext(options, undefined, onReplayDegrade)
|
|
311
|
-
- : await toPiContext({ ...options, signal: watchdog.signal }, {
|
|
312
|
-
+ ? toPiContext(requestOptions, undefined, onReplayDegrade)
|
|
313
|
-
+ : await toPiContext({ ...requestOptions, signal: watchdog.signal }, {
|
|
314
|
-
attachments,
|
|
315
|
-
resolveImageAccess: ref => this.config.resolveImageAccess?.(attachments, ref),
|
|
316
|
-
maxRequestImageBytes: profile.maxRequestImageBytes,
|
|
317
183
|
diff --git a/packages/llm/llm-pi-ai/src/config.ts b/packages/llm/llm-pi-ai/src/config.ts
|
|
318
|
-
index
|
|
184
|
+
index 2f9e563008..7eda300bad 100644
|
|
319
185
|
--- a/packages/llm/llm-pi-ai/src/config.ts
|
|
320
186
|
+++ b/packages/llm/llm-pi-ai/src/config.ts
|
|
321
|
-
@@ -
|
|
187
|
+
@@ -87,6 +87,12 @@ export type {
|
|
322
188
|
PiAiThinkingFormat,
|
|
323
189
|
} from './catalog.ts'
|
|
324
190
|
|
|
@@ -331,7 +197,7 @@ index e5a7e608b9..ce8192bf28 100644
|
|
|
331
197
|
/** Configuration for one pi-ai provider route; the `providers` dict key IS the route. */
|
|
332
198
|
export interface PiAiProviderProfile {
|
|
333
199
|
/** Credential reference (environment-variable name) resolved per request through `ctx.credentials`. */
|
|
334
|
-
@@ -
|
|
200
|
+
@@ -124,6 +130,8 @@ export interface PiAiProviderProfile {
|
|
335
201
|
* refused rather than left looking applied.
|
|
336
202
|
*/
|
|
337
203
|
compat?: PiAiCompatProfile
|
|
@@ -340,7 +206,7 @@ index e5a7e608b9..ce8192bf28 100644
|
|
|
340
206
|
/**
|
|
341
207
|
* Context capacity for a model this route lists that neither the entry nor
|
|
342
208
|
* the installed catalog sizes (default 262,144). A guess by construction, so
|
|
343
|
-
@@ -
|
|
209
|
+
@@ -319,6 +327,10 @@ const modelProfile: z<PiAiModelProfile> = z.object({
|
|
344
210
|
/** A {@link modelProfile} whose id lives in the `modelOverrides` dict key. */
|
|
345
211
|
const modelOverride: z<PiAiModelOverride> = z.object(modelFields)
|
|
346
212
|
|
|
@@ -351,7 +217,7 @@ index e5a7e608b9..ce8192bf28 100644
|
|
|
351
217
|
const profile = z.object({
|
|
352
218
|
apiKeyEnv: z.string().role('credential-ref'),
|
|
353
219
|
displayName: z.string(),
|
|
354
|
-
@@ -
|
|
220
|
+
@@ -327,6 +339,7 @@ const profile = z.object({
|
|
355
221
|
models: z.array(modelProfile),
|
|
356
222
|
modelOverrides: z.dict(modelOverride),
|
|
357
223
|
compat: compatProfile,
|
|
@@ -359,10 +225,10 @@ index e5a7e608b9..ce8192bf28 100644
|
|
|
359
225
|
defaultContextWindow: z.number().step(1).min(1).default(DEFAULT_CONTEXT_WINDOW),
|
|
360
226
|
defaultMaxTokens: z.number().step(1).min(1).default(DEFAULT_MAX_TOKENS),
|
|
361
227
|
defaultInput: z.array(z.union(MODALITIES)).default([...DEFAULT_INPUT]),
|
|
362
|
-
@@ -
|
|
363
|
-
if (source.displayName !== undefined && source.displayName.length === 0) {
|
|
228
|
+
@@ -422,6 +435,11 @@ export function resolveProfiles(
|
|
364
229
|
throw new Error(`llm-pi-ai: provider "${provider}" has an empty displayName`)
|
|
365
230
|
}
|
|
231
|
+
assertValidHeaders(provider, source.headers)
|
|
366
232
|
+ if (source.responsesCompatibility?.omitReasoningInputStatus === true && source.api !== 'openai-responses') {
|
|
367
233
|
+ throw new Error(
|
|
368
234
|
+ `llm-pi-ai: provider "${provider}" responsesCompatibility.omitReasoningInputStatus requires api "openai-responses"`,
|